Skip to content

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

Merged
gnodet merged 1 commit into
apache:camel-4.18.xfrom
zbendhiba:backport/28231-CAMEL-25895-to-camel-4.18.x
Oct 23, 2026
Merged

gnodet merged 1 commit into
apache:camel-4.18.xfrom
zbendhiba:backport/28231-CAMEL-25895-to-camel-4.18.x

Conversation

@zbendhiba

Copy link
Copy Markdown
Contributor

Backport of #28231 to camel-4.18.x

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

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 and the 4.21 and 4.24 upgrade guides do not exist on this branch at all.

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

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.

LGTM. Clean byte-identical backport of the SwiftConstants rename from #28231. The constant values, tests, and generated artifacts are all consistent. The six new tests correctly exercise the renamed headers through ContainerProducer — in particular containerUpdateIgnoresThePreviousSwiftHeaderNames confirms the old wire-format names no longer match. No issues found.

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.

@zbendhiba

Copy link
Copy Markdown
Contributor Author

The failure is unrelated to this changeset. Maven Central returned a 500 on net.thisptr:jackson-jq:pom:1.6.0 while building camel-jq, which also cancelled build (17) through matrix fail-fast. It resolves from my machine right now, so re-running.

@gnodet
gnodet merged commit 51bb7b1 into apache:camel-4.18.x Oct 23, 2026
3 of 5 checks passed
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 components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants