Skip to content

[RUN-5080] Return non-zero exit code when scm setup fails - #655

Open
fdevans wants to merge 1 commit into
mainfrom
fix/652-scm-setup-exit-code
Open

fdevans wants to merge 1 commit into
mainfrom
fix/652-scm-setup-exit-code

Conversation

@fdevans

@fdevans fdevans commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Fixes #652

rd projects scm setup returned a boolean, which picocli ignores as an exit code, so failures exited 0. It now returns an int, matching scm perform:

  • 2: validation error from the server (e.g. invalid config JSON)
  • 1: setup unsuccessful
  • 0: success

Added SCMSpec tests for each exit code.

Copilot AI balanced review requested due to automatic review settings October 14, 2026 22:12
@fdevans fdevans added the to-jira (automation) add to jira label Oct 14, 2026
@fdevans fdevans changed the title Return non-zero exit code when scm setup fails [RUN-5080] Return non-zero exit code when scm setup fails Oct 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused fix correctly maps setup outcomes to exit codes and includes regression coverage for each outcome.

0 open findings

What changed in this PR

Fixes #652 by making rd projects scm setup return integer exit codes that picocli recognizes.

Changes:

  • Returns 0 for success, 1 for unsuccessful setup, and 2 for server validation errors.
  • Adds regression tests for all three outcomes.
File Description
rd-cli-tool/​src/​test/​groovy/​org/​rundeck/​client/​tool/​commands/​projects/​SCMSpec.groovy Tests each setup exit code.
rd-cli-tool/​src/​main/​java/​org/​rundeck/​client/​tool/​commands/​projects/​SCM.java Converts setup results to integer exit codes.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

This branch has not been deployed

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

Labels

to-jira (automation) add to jira

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SCM import setup error returns 0 exit code

3 participants