Skip to content

Soften API version mismatch from error to warning in tw info#629

Merged
jordeu merged 3 commits into
masterfrom
improve-api-version-warning
May 21, 2026
Merged

Soften API version mismatch from error to warning in tw info#629
jordeu merged 3 commits into
masterfrom
improve-api-version-warning

Conversation

@robsyme
Copy link
Copy Markdown
Member

@robsyme robsyme commented May 21, 2026

Summary

Originating from FD-7550: the tw info API-version check currently renders as a red FAILED with the message "Tower API version is X while the minimum required version to be fully compatible is Y", and exits non-zero. Customers read this as a blocking incompatibility, even though the CLI still works for most operations against the older Platform.

This PR reframes the check as a compatibility warning:

  • Health table shows yellow WARNING instead of red FAILED for the version row.
  • New message states the mismatch, the practical impact, and the two remediations (upgrade Platform, or install an older tw matching the Platform version).
  • getExitCode() no longer fails on a version mismatch — only connection or auth failures produce a non-zero exit. Scripts running tw info as a health check no longer break for a non-fatal condition.

Example output:

Tower API version check                              WARNING

    Warning: Platform API version 1.20 is older than this CLI's minimum (1.30).
    Some tw commands may fail or return incomplete results.
    To ensure full compatibility, upgrade Seqera Platform, or install a tw
    release matching your Platform version:
    https://github.com/seqeralabs/tower-cli/releases

Test plan

  • ./gradlew test passes (existing InfoCmdTest does not assert on the warning text)
  • Manually run tw info against a Platform older than the CLI's versionApi and confirm yellow WARNING + new message
  • Manually run tw info against a compatible Platform and confirm green OK
  • Confirm tw info exit code is 0 when only the version check warns, non-zero on connection/auth failure

🤖 Generated with Claude Code

robsyme added 3 commits May 20, 2026 20:11
Reframe the Tower/Platform API version check as a compatibility
warning instead of a hard failure: yellow WARNING in the health
table, a clearer message describing impact and remediation, and
no non-zero exit code when only the version check is off.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Signed-off-by: Rob Syme <rob.syme@gmail.com>
The version-mismatch path is a warning, not a failure, so `tw info`
exits 0 instead of 1 in that scenario.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Signed-off-by: Rob Syme <rob.syme@gmail.com>
Visual presentation stays as a warning (yellow WARNING, rewritten
message) but the command still exits non-zero so scripts using
`tw info` as a strict health check continue to detect the mismatch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Signed-off-by: Rob Syme <rob.syme@gmail.com>
@robsyme robsyme force-pushed the improve-api-version-warning branch from ae2c3e9 to 9d81dfd Compare May 21, 2026 00:31
Copy link
Copy Markdown
Contributor

@stefanoboriero stefanoboriero left a comment

Choose a reason for hiding this comment

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

LGTM

@jordeu jordeu merged commit dd679a6 into master May 21, 2026
16 checks passed
@jordeu jordeu mentioned this pull request May 22, 2026
2 tasks
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