Skip to content

CAMEL-24201: camel-aws2-step-functions - listExecutions sets the state machine ARN#24928

Merged
oscerd merged 1 commit into
apache:mainfrom
oscerd:fix/CAMEL-24201
Jul 20, 2026
Merged

CAMEL-24201: camel-aws2-step-functions - listExecutions sets the state machine ARN#24928
oscerd merged 1 commit into
apache:mainfrom
oscerd:fix/CAMEL-24201

Conversation

@oscerd

@oscerd oscerd commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes CAMEL-24201. StepFunctions2Producer.listExecutions built the request with only maxResults:

ListExecutionsRequest.Builder builder = ListExecutionsRequest.builder();
if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(StepFunctions2Constants.EXECUTIONS_MAX_RESULTS))) {
    builder.maxResults(maxRes);
}

The AWS ListExecutions API requires a stateMachineArn (or a mapRunArn), so in header (non-POJO) mode the call was always rejected by AWS — the operation was effectively unusable. The CamelAwsStepFunctionsStateMachineArn header already exists and is read by the sibling operations (deleteStateMachine, updateStateMachine, describeStateMachine, …), but listExecutions never read it.

The ARN is now read from that header using the same optional-header pattern as its siblings.

Tests

Extends the existing sfnListExecutionsTest to set the state-machine-ARN header and assert (via the client mock, which now records the request) that it reaches the ListExecutionsRequest. All 17 tests in StepFunctions2ProducerTest pass.

Backport

Same code on camel-4.18.x and camel-4.14.x; will be backported after merge (fixVersions 4.22.0 / 4.18.4 / 4.14.9).


Claude Code on behalf of oscerd

…e machine ARN

listExecutions built the ListExecutions request with only maxResults and never
read CamelAwsStepFunctionsStateMachineArn. The AWS API requires a state machine
ARN (or a map run ARN), so in header mode the call was always rejected and the
operation was effectively unusable.

The state machine ARN is now read from the header following the same optional
pattern used by the sibling operations. Extends the existing listExecutions test
to supply the header and assert it reaches the request.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
@oscerd oscerd added the bug Something isn't working label Jul 20, 2026
@oscerd
oscerd requested review from Croway and davsclaus July 20, 2026 08:23

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

Clear and correct fix. The listExecutions non-POJO path was missing the required stateMachineArn parameter, making the operation always fail against AWS. The fix reads it from the existing CamelAwsStepFunctionsStateMachineArn header, consistent with how all sibling operations (deleteStateMachine, updateStateMachine, describeStateMachine, etc.) read the same header.

Code: The 4-line addition follows the exact same pattern used for maxResults directly below it, and for STATE_MACHINE_ARN in the other operations — consistent and idiomatic.

Test: Good approach — capturing the request in the mock with getLastListExecutionsRequest() lets the test assert the ARN was actually wired into the request builder, not just that the call didn't throw.

LGTM ✅

Claude Code on behalf of gnodet — AI-generated review

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

@github-actions

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-aws/camel-aws2-step-functions

🔬 Scalpel shadow comparison — Scalpel: 9 tested, 29 compile-only — current: 9 all tested

Maveniverse Scalpel detected 38 affected modules (current approach: 9).

⚠️ Modules only in Scalpel (29)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

Skip-tests mode would test 9 modules (1 direct + 8 downstream), skip tests for 29 (generated code, meta-modules)

Modules Scalpel would test (9)
  • camel-aws2-step-functions
  • camel-jbang-mcp
  • camel-jbang-plugin-mcp
  • camel-jbang-plugin-route-parser
  • camel-jbang-plugin-tui
  • camel-jbang-plugin-validate
  • camel-launcher-container
  • camel-yaml-dsl-validator
  • camel-yaml-dsl-validator-maven-plugin
Modules with tests skipped (29)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

All tested modules (38 modules)
  • Camel :: AWS Step Functions
  • Camel :: All Components Sync point
  • Camel :: Assembly
  • Camel :: Catalog :: CSimple Maven Plugin (deprecated)
  • Camel :: Catalog :: Camel Catalog
  • Camel :: Catalog :: Camel Report Maven Plugin
  • Camel :: Catalog :: Camel Route Parser
  • Camel :: Catalog :: Console
  • Camel :: Catalog :: Dummy Component
  • Camel :: Catalog :: Lucene (deprecated)
  • Camel :: Catalog :: Maven
  • Camel :: Catalog :: Suggest
  • Camel :: Component DSL
  • Camel :: Coverage
  • Camel :: Docs
  • Camel :: Endpoint DSL
  • Camel :: Endpoint DSL :: Support
  • Camel :: Integration Tests
  • Camel :: JBang :: Core
  • Camel :: JBang :: Integration tests
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Main
  • Camel :: JBang :: Plugin :: Edit
  • Camel :: JBang :: Plugin :: Generate
  • Camel :: JBang :: Plugin :: Kubernetes
  • Camel :: JBang :: Plugin :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Testing
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Kamelet Main
  • Camel :: Launcher
  • Camel :: Launcher :: Container
  • Camel :: YAML DSL
  • Camel :: YAML DSL :: Deserializers
  • Camel :: YAML DSL :: Maven Plugins
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

@oscerd oscerd self-assigned this Jul 20, 2026
@oscerd oscerd added this to the 4.22.0 milestone Jul 20, 2026
@oscerd
oscerd merged commit 7689900 into apache:main Jul 20, 2026
5 checks passed
davsclaus pushed a commit that referenced this pull request Jul 20, 2026
…e machine ARN

Backport of #24928. listExecutions now reads CamelAwsStepFunctionsStateMachineArn,
which the AWS ListExecutions API requires.

Closes #24950

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
davsclaus pushed a commit that referenced this pull request Jul 20, 2026
…e machine ARN

Backport of #24928. listExecutions now reads CamelAwsStepFunctionsStateMachineArn,
which the AWS ListExecutions API requires.

Closes #24951

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working components components-aws

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants