Skip to content

camel-aws2-transcribe: deprecate the protocol option, which has no effect - #29706

Open
Dhairya-007 wants to merge 4 commits into
apache:mainfrom
Dhairya-007:fix/aws2-transcribe-dead-protocol-option
Open

Dhairya-007 wants to merge 4 commits into
apache:mainfrom
Dhairya-007:fix/aws2-transcribe-dead-protocol-option

Conversation

@Dhairya-007

Copy link
Copy Markdown
Contributor

Problem

Transcribe2Configuration declares a protocol option:

@UriParam(enums = "HTTP,HTTPS", defaultValue = "HTTPS")
private Protocol protocol = Protocol.HTTPS;

Nothing reads it. The Transcribe client is built by the shared AwsClientBuilderUtil, which reads the region, the endpoint override and the proxy settings off the AwsCommonConfiguration interface — and that interface has no protocol, only getProxyProtocol(). Across all of components/camel-aws, the only callers of Transcribe2Configuration.getProtocol() are the generated Transcribe2EndpointConfigurer and Transcribe2ComponentConfigurer. Setting protocol=HTTP on an aws2-transcribe endpoint is accepted and does nothing.

It is also the only Protocol protocol field in the whole aws2 family. aws2-sqs has a protocol option too, but a String one that it genuinely uses to build the queue URL scheme.

The description made it worse. setProtocol carried setProxyProtocol's javadoc:

/**
 * To define a proxy protocol when instantiating the Transcribe client
 */
public void setProtocol(Protocol protocol) {

so the option read as if it configured the proxy — which is exactly what proxyProtocol, declared ten lines below it, really does and which the shared builder really applies. A user following the documentation would set protocol and get no proxy and no warning.

Fix

Deprecate it with a deprecationNote, following camel-docling's apiKeyHeader in #29591 — the same situation, deprecated the same way in this release — and give it a description that no longer claims to configure a proxy.

Changed:

  • Transcribe2Configuration — @Deprecated + @Metadata(deprecationNote = ...), and the getter/setter javadoc.
  • aws2-transcribe.json and its camel-catalog copy — "deprecated": true plus the note, on both the component property and the endpoint parameter. The two files are byte-identical afterwards.
  • Transcribe2EndpointBuilderFactory (2 methods) and Aws2TranscribeComponentBuilderFactory (1 method) — @Deprecated and the re-wrapped javadoc.
  • camel-4x-upgrade-guide-4_24.adoc — the entry a deprecation takes, pointing users at proxyProtocol/proxyHost/proxyPort.

The generated files were updated by hand, since I cannot run maven here; I took the exact shape from the apiKeyHeader commit (5de82a9) and re-wrapped the DSL javadoc with the generator's own width (69 characters of text at indent 9), checking first that the wrap reproduces the untouched lines. If the regen job still finds a difference I will take its patch.

Tests

No behaviour changes, so there is nothing new to assert: the option did nothing before and does nothing now, it is only labelled honestly. The existing aws2-transcribe tests cover the client building that this does not touch.

…fect

Transcribe2Configuration declares a protocol option that nothing reads. The
Transcribe client is built by the shared AwsClientBuilderUtil, which takes the
region, the endpoint override and the proxy settings off AwsCommonConfiguration;
protocol is not part of that interface, and getProtocol() is called only by the
generated configurer. Setting protocol=HTTP on an aws2-transcribe endpoint is
accepted and does nothing.

Its description made that worse: the setter carried the javadoc of
setProxyProtocol, "To define a proxy protocol when instantiating the Transcribe
client", so the option read as if it configured the proxy - which is what
proxyProtocol, three fields below, actually does.

Deprecate it with a note, as camel-docling's apiKeyHeader was deprecated in
this release, and give it a description that no longer claims to configure a
proxy. The catalog metadata, both DSL builder factories and the 4.24 upgrade
guide follow.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The protocol field is correctly annotated with @Deprecated and @Metadata(deprecationNote=...), but the getter and setter methods are missing the same deprecation markers. Per Camel convention (see e.g. AWS2S3VectorsConfiguration), both the accessor methods should carry @Deprecated and a @deprecated Javadoc tag.

Additionally, the new Javadoc text "The protocol to use when instantiating the Transcribe client" is misleading for a no-op option — it implies the value is actually used. Consider something like "The protocol to use when instantiating the Transcribe client (deprecated, this option has no effect)" or simply retain the original wording with a deprecation note.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Dhairya-007 and others added 2 commits November 12, 2026 16:21
…pache/camel/component/aws2/transcribe/Transcribe2Configuration.java

Co-authored-by: Guillaume Nodet - AI Bot <gnodet+bot@gmail.com>
…pache/camel/component/aws2/transcribe/Transcribe2Configuration.java

Co-authored-by: Guillaume Nodet - AI Bot <gnodet+bot@gmail.com>

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following up on my earlier review — the @Deprecated/@deprecated finding has been addressed. One issue remains.

The fix introduced a duplicate Javadoc block on both the getter and setter: each method now has two consecutive /** ... */ blocks immediately before it. The Java language and all Javadoc tooling only recognize the last Javadoc comment immediately preceding a declaration — the first block is an orphan that will silently be ignored. The resulting class-level documentation will show just the second block, but the stray first block is misleading noise in the source.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Comment on lines +267 to +275
/**
* To define a proxy protocol when instantiating the Transcribe client
* The protocol to use when instantiating the Transcribe client
*/
/**
* The protocol to use when instantiating the Transcribe client
*
* @deprecated Not used: nothing reads this option when the Transcribe client is built
*/
@Deprecated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate Javadoc block. There are two consecutive /** ... */ comments before getProtocol(). Java only associates the last Javadoc block immediately preceding a declaration — the first one is a stray orphan that will be silently ignored by javadoc and IDEs. Remove it and keep only the second block (the one with @deprecated).

Suggested change
/**
* To define a proxy protocol when instantiating the Transcribe client
* The protocol to use when instantiating the Transcribe client
*/
/**
* The protocol to use when instantiating the Transcribe client
*
* @deprecated Not used: nothing reads this option when the Transcribe client is built
*/
@Deprecated
/**
* The protocol to use when instantiating the Transcribe client.
*
* @deprecated Not used: nothing reads this option when the Transcribe client is built
*/
@Deprecated

Comment on lines +280 to +288
/**
* To define a proxy protocol when instantiating the Transcribe client
* The protocol to use when instantiating the Transcribe client
*/
/**
* The protocol to use when instantiating the Transcribe client
*
* @deprecated Not used: nothing reads this option when the Transcribe client is built
*/
@Deprecated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Duplicate Javadoc block. Same issue as getProtocol(): two consecutive /** ... */ before setProtocol(). Remove the stray first block.

Suggested change
/**
* To define a proxy protocol when instantiating the Transcribe client
* The protocol to use when instantiating the Transcribe client
*/
/**
* The protocol to use when instantiating the Transcribe client
*
* @deprecated Not used: nothing reads this option when the Transcribe client is built
*/
@Deprecated
/**
* The protocol to use when instantiating the Transcribe client.
*
* @deprecated Not used: nothing reads this option when the Transcribe client is built
*/
@Deprecated

@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@davsclaus davsclaus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TL;DR: correct deprecation of a dead option, one leftover from the suggestion commits to clean up.

I checked that protocol is really unused: apart from the generated Transcribe2EndpointConfigurer/Transcribe2ComponentConfigurer, nothing calls getProtocol(), and Transcribe2ClientFactory and the shared AWS client builder only apply proxyProtocol. The field, accessors, both JSON copies, both DSL factories and the upgrade-guide entry are all in place, and fixing the borrowed proxyProtocol description is a nice catch.

The one thing left: applying the review suggestions left two Javadoc blocks on each accessor. In Transcribe2Configuration.java, the old /** The protocol to use when instantiating the Transcribe client */ blocks right before the new ones on getProtocol() (line 267) and setProtocol() (line 280) are now orphaned. Could you delete those two and run mvn formatter:format impsort:sort on the module once, since GitHub suggestion commits are not formatted? Heads-up: #29709 appends an upgrade-guide entry at the same spot, so one of the two will need a small rebase.

Claude Code on behalf of davsclaus. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.

@github-actions

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • catalog/camel-catalog
  • components/camel-aws/camel-aws2-transcribe
  • docs
  • dsl/camel-componentdsl
  • dsl/camel-endpointdsl

🔬 Scalpel shadow comparison — Scalpel: 9 of 723 tested, 23 compile-only — current: 9 all tested

Maveniverse Scalpel detected 9 affected modules (current approach: 9).

Skip-tests mode would test 9 modules (5 direct + 8 downstream), skip tests for 23 (generated code, meta-modules)

Modules Scalpel would test (9)
  • camel-aws2-transcribe ← components/camel-aws/camel-aws2-transcribe/src/generated/resources/META-INF/org/apache/camel/component/aws2/transcribe/aws2-transcribe.json, components/camel-aws/camel-aws2-transcribe/src/main/java/org/apache/camel/component/aws2/transcribe/Transcribe2Configuration.java
  • camel-jbang-mcp ← downstream of org.apache.camel:camel-catalog
  • camel-jbang-plugin-mcp ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-tui ← downstream of org.apache.camel:camel-catalog
  • camel-jbang-plugin-validate ← downstream of org.apache.camel:camel-yaml-dsl-validator
  • camel-jbang-run ← downstream of org.apache.camel:camel-catalog
  • camel-launcher-container ← downstream of org.apache.camel:camel-launcher
  • camel-yaml-dsl-validator ← downstream of org.apache.camel:camel-catalog
  • camel-yaml-dsl-validator-maven-plugin ← downstream of org.apache.camel:camel-yaml-dsl-validator
Modules with tests skipped (23)
  • apache-camel
  • camel-allcomponents
  • camel-catalog-console
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

All tested modules (36 modules, 5m 45s total)

Total reactor time: 5m 45s

Module Duration Status
Camel :: JBang :: Plugin :: TUI 54.3s SUCCESS
Camel :: Launcher 49.7s SUCCESS
Camel :: JBang :: MCP 31.4s SUCCESS
Camel :: Component DSL 25.5s SUCCESS
Camel :: AWS2 :: Transcribe 22.8s SUCCESS
Camel :: JBang :: Plugin :: Validate 20.7s SUCCESS
Camel :: YAML DSL 18.2s SUCCESS
Camel :: YAML DSL :: Validator 18.0s SUCCESS
Camel :: Catalog :: Camel Catalog 15.2s SUCCESS
Camel :: JBang :: Run 13.5s SUCCESS
Camel :: Docs 10.0s SUCCESS
Camel :: Kamelet Main 9.2s SUCCESS
Camel :: JBang :: Plugin :: Testing 7.7s SUCCESS
Camel :: JBang :: Plugin :: Kubernetes 7.2s SUCCESS
Camel :: Catalog :: Camel Report Maven Plugin 5.5s SUCCESS
Camel :: Catalog :: Camel Route Parser 5.3s SUCCESS
Camel :: YAML DSL :: Deserializers 5.1s SUCCESS
Camel :: Catalog :: Suggest (deprecated) 5.0s SUCCESS
Camel :: All Components Sync point 3.5s SUCCESS
Camel :: JBang :: Plugin :: Generate 3.4s SUCCESS
Camel :: Catalog :: Maven 2.4s SUCCESS
Camel :: YAML DSL :: Validator Maven Plugin 2.3s SUCCESS
Camel :: YAML DSL :: Maven Plugins 2.2s SUCCESS
Camel :: Catalog :: Dummy Component 0.9s SUCCESS
Camel :: Assembly 0.9s SUCCESS
Camel :: Catalog :: Console 0.8s SUCCESS
Camel :: Launcher :: Container 0.8s SUCCESS
Camel :: Coverage 0.7s SUCCESS
Camel :: Endpoint DSL :: Support 0.7s SUCCESS
Camel :: JBang :: Plugin :: MCP 0.7s SUCCESS
Camel :: JBang :: Plugin :: Edit 0.6s SUCCESS
Camel :: JBang :: Integration tests 0.5s SUCCESS
Camel :: JBang :: Main 0.5s SUCCESS
Camel :: Endpoint DSL n/a
Camel :: Integration Tests n/a
Camel :: JBang :: Core n/a

Top 20 slowest modules:

  • Camel :: JBang :: Plugin :: TUI (54.3s)
  • Camel :: Launcher (49.7s)
  • Camel :: JBang :: MCP (31.4s)
  • Camel :: Component DSL (25.5s)
  • Camel :: AWS2 :: Transcribe (22.8s)
  • Camel :: JBang :: Plugin :: Validate (20.7s)
  • Camel :: YAML DSL (18.2s)
  • Camel :: YAML DSL :: Validator (18.0s)
  • Camel :: Catalog :: Camel Catalog (15.2s)
  • Camel :: JBang :: Run (13.5s)
  • Camel :: Docs (10.0s)
  • Camel :: Kamelet Main (9.2s)
  • Camel :: JBang :: Plugin :: Testing (7.7s)
  • Camel :: JBang :: Plugin :: Kubernetes (7.2s)
  • Camel :: Catalog :: Camel Report Maven Plugin (5.5s)
  • Camel :: Catalog :: Camel Route Parser (5.3s)
  • Camel :: YAML DSL :: Deserializers (5.1s)
  • Camel :: Catalog :: Suggest (deprecated) (5.0s)
  • Camel :: All Components Sync point (3.5s)
  • Camel :: JBang :: Plugin :: Generate (3.4s)

⚙️ View full build and test results

@oscerd oscerd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, complete deprecation, with one small thing to tidy.

The call is right: protocol is dead. The Transcribe client comes from the shared AwsClientBuilderUtil, which reads region, endpoint override and the proxy settings off AwsCommonConfiguration, and that interface exposes getProxyProtocol(), not getProtocol(). So the option was never applied, and its description was the proxyProtocol one copied over, which made it read as if it configured the proxy. Deprecating it and correcting the description to stop claiming a proxy role is the right pair of changes.

The regeneration is complete: deprecated: true plus the deprecationNote land in both the component META-INF JSON and the camel-catalog copy, and the component and endpoint DSL factories carry the note too. The upgrade-guide entry points users at proxyProtocol with proxyHost and proxyPort, which is the option that actually reaches the client builder. Good.

One cleanup: getProtocol() and setProtocol(...) each end up with two /** ... */ blocks back to back, the first without the @deprecated tag and the second with it. Javadoc keeps only the block immediately above the member, so the first is dropped and left as a dangling comment. That is the same orphaned-Javadoc pattern your own #29641 swept out of the tree, so it is worth collapsing each pair into the single block that carries the @deprecated tag.

Claude Code on behalf of oscerd

…plicated

Applying the review suggestions through GitHub left two consecutive /** */
blocks on getProtocol and setProtocol, the first without the @deprecated tag.
Javadoc keeps only the block immediately above the member, so the first one is
an orphan - the same defect apache#29641 swept out of the tree. Each pair is now the
single block that carries the tag.

The generated description is unchanged: the generator reads the last block
before the member, and its first line is the same.
@Dhairya-007

Copy link
Copy Markdown
Contributor Author

Fixed — and thanks for spotting it; the irony of leaving orphaned Javadoc behind is not lost on me, given #29641.

Both pairs on getProtocol() and setProtocol() are collapsed into the single block that carries the @deprecated tag:

/**
 * The protocol to use when instantiating the Transcribe client
 *
 * @deprecated Not used: nothing reads this option when the Transcribe client is built
 */
@Deprecated
public Protocol getProtocol() {

I checked the file for any other adjacent */ … /** pair and there are none left.

The generated metadata is unchanged by this, which is worth stating explicitly since I cannot run the regen here: the schema generator reads the last Javadoc block before the member, and that block's first line is the same text as the orphan's, so the description in both JSON copies and in the two DSL factories stays byte-identical. I re-read them after the edit to confirm.

On mvn formatter:format impsort:sort — I cannot run maven in this environment, so I checked by hand instead: no line in the touched region exceeds 120 columns, the blank * separator before the tag is there, and no imports changed. If the formatter still has an opinion, the regen job's patch will show it and I will apply it.

On the rebase heads-up — agreed, #29706 and #29709 both append to camel-4x-upgrade-guide-4_24.adoc. Whichever lands second I will rebase; #29709 already needs one, so I am doing that now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants