Skip to content

[backport camel-4.22.x] CAMEL-25895: camel-openstack - align the remaining Swift header constants with the Camel naming convention - #28280

Open
zbendhiba wants to merge 1 commit into
apache:camel-4.22.xfrom
zbendhiba:backport/28231-CAMEL-25895-to-camel-4.22.x
Open

zbendhiba wants to merge 1 commit into
apache:camel-4.22.xfrom
zbendhiba:backport/28231-CAMEL-25895-to-camel-4.22.x

Conversation

@zbendhiba

Copy link
Copy Markdown
Contributor

Backport of #28231 to camel-4.22.x

Cherry-pick of #28231 (3ef68e407da3) onto camel-4.22.x, shipping in 4.22.3.

What this carries

The five functional files of the original commit, applied with no change:

File
SwiftConstants.java the four header constants take their CamelOpenstackSwift* values
ContainerProducerTest.java six new tests for the container options path, which had no coverage
openstack-swift.json (component + catalog) regenerated metadata
SwiftEndpointBuilderFactory.java regenerated Endpoint DSL header accessors

The Java field names are unchanged, so routes using the constants symbolically keep working. The request Camel
sends to Swift is unchanged: openstack4j builds the X-Container-* wire names itself from
CreateUpdateContainerOptions, so the Exchange header key never reaches Swift.

What this does not carry, and why

The original commit also touched design/headers.adoc and three upgrade guides. None of them is carried here:
the project keeps the upgrade guides for every version on main, where they act as the canonical history
across releases. design/headers.adoc does exist on this branch, but the design notes are kept on main for the
same reason.

The 4.22.3 upgrade-guide note is added on main instead, in the companion PR, under
== Upgrading from 4.22.2 to 4.22.3.

Mechanical-port check

The code is a byte-identical port: the resulting ContainerProducerTest.java is identical to main,
ContainerProducer.java is identical on this branch and on main, and the changeset is identical to the
camel-4.18.x / camel-4.22.x sibling backport. The only conflict resolution was removing the doc files that
do not exist on this branch, so a gh pr diff comparison against #28231 will show those doc hunks as the
difference. No reviewers are requested, per the project's backport rule; the code went through review on #28231.

…ants with the Camel naming convention

CAMEL-23580 renamed the camel-openstack Exchange header constants to the
CamelOpenstack* convention, but left four of them in SwiftConstants on their
openstack4j values, on the understanding that those values are part of the
Swift HTTP contract:

  CONTAINER_METADATA_PREFIX  X-Container-Meta-    -> CamelOpenstackSwiftContainerMetadata
  VERSIONS_LOCATION          X-Versions-Location  -> CamelOpenstackSwiftVersionsLocation
  CONTAINER_READ             X-Container-Read     -> CamelOpenstackSwiftContainerRead
  CONTAINER_WRITE            X-Container-Write    -> CamelOpenstackSwiftContainerWrite

They are not. ContainerProducer passes the values to the openstack4j
CreateUpdateContainerOptions, which builds the X-Container-Meta-,
X-Versions-Location, X-Container-Read and X-Container-Write names of the Swift
request itself, so the Exchange header key never reaches Swift and the request
on the wire is unchanged by this rename. This commit therefore partly reverses
the decision taken in CAMEL-23580, because the reason recorded for it does not
hold.

The Java field names are unchanged, so routes that reference the constants
symbolically keep working. Routes that set one of these headers by its literal
string value must move to the new value.

ContainerProducerTest had no coverage of the container options path at all;
six tests are added for it.

Backport of apache#28231. The upgrade-guide note for this release line and the
design/headers.adoc correction stay on main, where the project keeps the
upgrade guides for every version.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Zineb Bendhiba <bendhiba.zineb@gmail.com>
@zbendhiba zbendhiba added components bug Something isn't working backport indicate that a Pull request is a backport from a fix from the main branch labels Oct 22, 2026

@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.

Clean mechanical backport of the reviewed PR (#28231). The code is byte-identical to main per the PR claim, the 4 omitted doc files are consistent with Camel's backport convention (upgrade guides live on main), and the 6 new tests provide valid coverage.

The test containerUpdateIgnoresThePreviousSwiftHeaderNames is the most important test: proves old wire header names are now silently ignored. Worth confirming companion upgrade-guide PR on main exists before 4.22.3 release.

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

@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.

Thanks Zineb. I diffed this backport against #28231: the changed lines in SwiftConstants, ContainerProducerTest, the component JSON, the catalog JSON and the endpoint DSL are the same, so this is a straight cherry-pick. The upgrade-guide changes stay on main, where #28231 already put them. Approving, to merge once CI is green.

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

🌟 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.

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

Labels

backport indicate that a Pull request is a backport from a fix from the main branch bug Something isn't working catalog components dsl

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants