CAMEL-23580: camel-openstack - align Exchange header constant names with Camel naming convention#23438
Conversation
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
All tested modules (10 modules)
|
gnodet
left a comment
There was a problem hiding this comment.
Looks good — thorough rename across all 6 sub-components (Cinder, Glance, Keystone, Neutron, Nova, Swift). Naming is consistent: CamelOpenstack* for common headers, CamelOpenstack<Subsystem>* for sub-component-specific ones. Swift protocol headers (X-Container-Meta-, X-Versions-Location, etc.) correctly preserved with a clear comment explaining why. Upgrade guide is excellent with per-subsystem mapping tables.
Minor: the PR title says CAMEL-23580 but the body says "Tracker: CAMEL-23577" — might want to align those.
Claude Code on behalf of Guillaume Nodet
…ith Camel naming convention
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>
Summary
Renames the Exchange header string values across
OpenstackConstants,KeystoneConstants,NovaConstants,CinderConstants,GlanceConstants,NeutronConstantsandSwiftConstantsfrom non-Camel prefixed values(
operation,ID,name,description,properties,password,action,FlavorId,ImageId,AdminPassword, ...) toCamelOpenstack<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), andCAMEL-23576 (
camel-jira).The Java field names (
OPERATION,ID,NAME,PASSWORD,ADMIN_PASSWORD,ACTION,FLAVOR_ID,IMAGE_ID, etc.) are unchanged so routes referencingthe constants symbolically continue to work; routes using the literal string
values must be updated (documented in the 4.21 upgrade guide).
Scope decisions
OpenstackConstantsget aCamelOpenstack<Name>prefix (
CamelOpenstackOperation,CamelOpenstackId,CamelOpenstackName,CamelOpenstackDescription,CamelOpenstackProperties).CamelOpenstack<Subsystem><Name>prefix to keep them distinguishable from the common ones — especially
needed for
KeystoneConstants.DESCRIPTIONwhich previously collided withOpenstackConstants.DESCRIPTIONvia inheritance hiding (both were theliteral string
description).SwiftConstants.CONTAINER_METADATA_PREFIX,VERSIONS_LOCATION,CONTAINER_READ,CONTAINER_WRITEintentionally keep their previousvalues (
X-Container-Meta-,X-Versions-Location,X-Container-Read,X-Container-Write) because they are part of the Swift HTTP protocolcontract used by openstack4j to forward container metadata and ACLs to
the Swift backend. Renaming them would break interoperability with the
Swift API.
OpenstackConstants(SCHEME_*,CREATE,UPDATE,GET_ALL,GET,DELETE) and the subsystem-name constants(
NOVA_SUBSYSTEM_*,NEUTRON_*_SYSTEM, etc.) keep their previous valuesbecause they are operation enum / subsystem identifiers, not Exchange
header names.
Test changes
Fixes one test (
ContainerProducerTest.getTest) that was incorrectly usingthe
SwiftConstants.LIMIT/DELIMITERconstants as keys to look up valuesin the openstack4j
ContainerListOptionsinternal map. The map keys arethe openstack4j-defined URL parameter names (
"limit","delimiter"),not the Camel header constants — the previous test relied on the coincidence
that the Camel constant values happened to equal the openstack4j parameter
names. With the rename the two diverge, and the test is updated to use
the literal openstack4j names.
Generated artifacts
components/camel-openstack/.../openstack-{cinder,glance,keystone,neutron,nova,swift}.json— component catalogscatalog/camel-catalog/.../components/openstack-*.json— catalog mirrorsdsl/camel-endpointdsl/.../{Cinder,Glance,Keystone,Neutron,Nova,Swift}EndpointBuilderFactory.java— DSL header accessors renamed (e.g.operation()→openstackOperation(),password()→openstackKeystonePassword(),adminPassword()→openstackNovaAdminPassword(),flavorId()→openstackNovaFlavorId())Backports
camel-openstackexists oncamel-4.18.xandcamel-4.14.xwith identicalsource. Backports are straightforward; will be filed as follow-up PRs.
Test plan
mvn testincomponents/camel-openstack— 142 tests passcamel-openstackregen artifacts in
git statusX-Container-Meta-etc.) verifiedto keep their previous values in the regenerated DSL
=== camel-openstackwith per-subsystemmapping tables and explicit note about the Swift protocol constants
Tracker: CAMEL-23577
Reported by Claude Code on behalf of Andrea Cosentino