Skip to content

[backport camel-4.18.x] CAMEL-23580: camel-openstack - align Exchange header constant names with Camel naming convention#23540

Open
oscerd wants to merge 1 commit into
apache:camel-4.18.xfrom
oscerd:backport/23438-to-camel-4.18.x
Open

[backport camel-4.18.x] CAMEL-23580: camel-openstack - align Exchange header constant names with Camel naming convention#23540
oscerd wants to merge 1 commit into
apache:camel-4.18.xfrom
oscerd:backport/23438-to-camel-4.18.x

Conversation

@oscerd
Copy link
Copy Markdown
Contributor

@oscerd oscerd commented May 26, 2026

Backports #23438 to camel-4.18.x.

Cherry-pick of merge commit 902504dd360 with one adaptation: the original
PR's upgrade-guide entry was added to camel-4x-upgrade-guide-4_21.adoc,
which does not exist on the 4.18.x maintenance branch. Per the project's
backport policy the same content has been added to
camel-4x-upgrade-guide-4_18.adoc instead.

Summary

Renames the Exchange header string values across OpenstackConstants,
KeystoneConstants, NovaConstants, CinderConstants, GlanceConstants,
NeutronConstants and SwiftConstants that were not in the Camel
namespace to CamelOpenstack<Subsystem><Name>. 55+ constants across the 6
subsystems (cinder/glance/keystone/neutron/nova/swift) plus the common
OpenstackConstants.

Scope decisions preserved from main PR

  • Common headers in OpenstackConstants use a CamelOpenstack<Name>
    prefix (CamelOpenstackOperation, CamelOpenstackId, CamelOpenstackName,
    CamelOpenstackDescription, CamelOpenstackProperties).
  • Subsystem-specific headers use CamelOpenstack<Subsystem><Name>.
  • SwiftConstants.CONTAINER_METADATA_PREFIX, VERSIONS_LOCATION,
    CONTAINER_READ, CONTAINER_WRITE are unchanged
    because they are
    Swift HTTP protocol contract values (X-Container-Meta-,
    X-Versions-Location, X-Container-Read, X-Container-Write) used by
    openstack4j.
  • Non-header constants (SCHEME_*, CREATE, UPDATE, GET_ALL, GET,
    DELETE, subsystem-name constants) keep their previous values.

The cherry-pick includes the fix to ContainerProducerTest.getTest that was
shipped with the main-branch PR — the test had been using
SwiftConstants.LIMIT/DELIMITER to look up values in the openstack4j
ContainerListOptions internal map; with the rename, the test correctly uses
the literal openstack4j parameter names ("limit", "delimiter").

Test plan

  • mvn test in components/camel-openstack on 4.18.x — 142 tests pass
  • Cherry-pick applied cleanly except for the 4_21 → 4_18 guide-file
    rename described above (no merge marker shipped)
  • Upgrade-guide entry added under === camel-openstack - potential breaking change in camel-4x-upgrade-guide-4_18.adoc

Tracker: CAMEL-23577

Reported by Claude Code on behalf of Andrea Cosentino

…ith Camel naming convention (apache#23438)

Renames the Exchange header string values across OpenstackConstants,
KeystoneConstants, NovaConstants, CinderConstants, GlanceConstants,
NeutronConstants and SwiftConstants from non-Camel prefixed values
(operation, ID, name, description, properties, password, action, FlavorId,
ImageId, AdminPassword, ...) to CamelOpenstack<Subsystem><Name>, following
the convention used across the rest of the Camel component catalog and
matching the pattern established in CAMEL-23526 (camel-cxf), CAMEL-23522
(camel-mail), CAMEL-23461 (camel-aws-bedrock), CAMEL-23532
(camel-vertx-websocket / camel-atmosphere-websocket / camel-iggy), and
CAMEL-23576 (camel-jira).

The Java field names (OPERATION, ID, NAME, PASSWORD, ADMIN_PASSWORD, ACTION,
FLAVOR_ID, IMAGE_ID, etc.) are unchanged so routes referencing the constants
symbolically continue to work; routes using the literal string values must
be updated (documented in the 4.21 upgrade guide).

Scope decisions:
- Common headers in OpenstackConstants get a "CamelOpenstack<Name>" prefix
  (CamelOpenstackOperation, CamelOpenstackId, CamelOpenstackName,
  CamelOpenstackDescription, CamelOpenstackProperties)
- Subsystem-specific headers get a "CamelOpenstack<Subsystem><Name>" prefix
  to keep them distinguishable from the common ones (especially needed for
  KeystoneConstants.DESCRIPTION which previously collided with
  OpenstackConstants.DESCRIPTION via inheritance hiding)
- SwiftConstants.CONTAINER_METADATA_PREFIX, VERSIONS_LOCATION, CONTAINER_READ,
  and CONTAINER_WRITE intentionally keep their previous values
  (X-Container-Meta-, X-Versions-Location, X-Container-Read, X-Container-Write)
  because they are part of the Swift HTTP protocol contract used by
  openstack4j to forward container metadata and ACLs to the Swift backend.
- The non-header constants in OpenstackConstants (SCHEME_*, CREATE, UPDATE,
  GET_ALL, GET, DELETE) and the subsystem-name constants
  (NOVA_SUBSYSTEM_*, NEUTRON_*_SYSTEM, etc.) keep their previous values
  because they are operation enum / subsystem identifiers, not Exchange
  header names.

Fixes one test (ContainerProducerTest.getTest) that was incorrectly using
the SwiftConstants.LIMIT/DELIMITER constants as keys to look up values in
the openstack4j ContainerListOptions internal map. The map keys are the
openstack4j-defined URL parameter names ("limit", "delimiter"), not the
Camel header constants. The test now uses the literal names.

The generated Endpoint DSL header accessors on each component's
HeaderNameBuilder have been renamed accordingly (operation() ->
openstackOperation(), password() -> openstackKeystonePassword(),
adminPassword() -> openstackNovaAdminPassword(), etc.).

Tracker: CAMEL-23577

Reported by Claude Code on behalf of Andrea Cosentino

Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
Copy link
Copy Markdown
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

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

Large backport (~5000 lines) of the camel-openstack header rename to 4.18.x. Covers all OpenStack sub-components: Cinder, Glance, Keystone, Neutron, Nova, and Swift. Headers renamed from short names (e.g., size, operation, ID, name) to Camel-prefixed names (e.g., CamelOpenstackCinderSize, CamelOpenstackOperation, CamelOpenstackId). Bulk of the diff is generated catalog metadata. Upgrade guide entry included.

Partial review (large diff) — focused on source code changes and upgrade guide. Generated metadata consistent with the constant renames.

LGTM.

Fully automatic review from Claude Code

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants