allthingssecurity opened a new pull request, #31008: URL: https://github.com/apache/camel/pull/31008
# Description [CAMEL-27623](https://issues.apache.org/jira/browse/CAMEL-27623) The ticket lists three problems of camel-aws2-ecs that came up while the option descriptions were written for CAMEL-23832 (#30962). I checked each one against main. Two are fixed here, one is left as it is. Fixed: 1. **operation was marked required, but the header can replace it.** `ECS2Producer.determineOperation()` reads the `CamelAwsECSOperation` header first and uses the option only when the header is not set. When both are missing it already fails the exchange with "Operation must be specified, either with the operation option or the CamelAwsECSOperation header". The option is no longer marked required, so a URI such as `aws2-ecs:test` with the operation in the header passes the catalog validation. The producer does not change. 2. **The header labels were operation names.** `CamelAwsECSNextToken` and `CamelAwsECSIsTruncated` had the label `listClusters`, and `CamelAwsECSClusterArn` had `createCluster describeCluster deleteCluster`. The label becomes the group of the header in the catalog and in the docs, so these headers were in groups of their own. The other three headers had no label. All six now have the label `producer`, as the component is producer only. The descriptions of the three headers that had operation names in their label now name the operations instead. Not changed: 3. **The label path is not used.** That is true: `ECS2Configuration.label` has no getter or setter, and `ECS2Component.createEndpoint()` ignores the remaining part of the URI. #30962 already documents it as a logical name that you can choose freely. Making it optional would change the endpoint syntax `aws2-ecs:label`, which most AWS components share, so as the ticket says it is better done for all of them together. No upgrade guide entry: the producer behaves as before, only the catalog metadata changes. This touches the same lines as #30962 (the `@Metadata` of `operation`, the six headers in `ECS2Constants`, and the generated files), so the two PRs will conflict textually and whichever is merged second needs a rebase. No description in #30962 becomes wrong. #30962 keeps the old header labels, for example: - `@Metadata(label = "listClusters", description = "The token of the next page of listClusters. ...")` - `@Metadata(label = "createCluster describeCluster deleteCluster", description = "The ARN of the cluster that the operation created, described or deleted. The producer sets it.", ...)` On a rebase the labels should become `producer` and the descriptions of #30962 can stay, as they already name the operations. Tests: - `ECS2OperationHeaderMetadataTest` (new): the JSON schema of the component, as Camel reads it at runtime, has `operation` not required, and all six headers with the label and group `producer`; a route without the operation option and with the operation in the header lists the clusters. Against the main sources the two metadata tests fail (`operation` is required, the labels are empty or operation names); the route test passes, as the producer did not change. Results (offline, module build of camel-aws2-ecs, test phase, unit tests only; the module was built with the AWS SDK 2.55.15, given on the command line, as 2.57.11 of main was not available offline): 28 tests run, 0 failures, 0 errors, 0 skipped. The new test class passed 5 runs in a row. Generated files: `aws2-ecs.json` of the component and its catalog copy, and `ECS2EndpointBuilderFactory` of the endpoint DSL (the `Required: true` lines of `operation`, and the header descriptions and groups). # Target - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch) # Tracking - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it): [CAMEL-27623](https://issues.apache.org/jira/browse/CAMEL-27623). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [ ] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes. (I built camel-aws2-ecs and ran its unit tests, and committed the regenerated component JSON. The catalog copy is a copy of it (the two were identical on main), and the endpoint DSL was regenerated from it with the generate-endpoint-dsl goal of camel-package-maven-plugin, as an offline build of those modules was not possible here. I did not run the full root build.) # AI-assisted contributions - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used. This PR was prepared with Claude Code (Claude Opus 5.5). The commit carries a `Co-Authored-By` trailer. _Claude Code on behalf of allthingssecurity_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
