Skip to content

Comments

feat: add runtime version validation for remote client deployments#1983

Merged
feluelle merged 2 commits intomainfrom
feature/remote-deploy-cmd-runtime-version-validation
Nov 25, 2025
Merged

feat: add runtime version validation for remote client deployments#1983
feluelle merged 2 commits intomainfrom
feature/remote-deploy-cmd-runtime-version-validation

Conversation

@feluelle
Copy link
Member

@feluelle feluelle commented Nov 5, 2025

Description

Describe the purpose of this pull request.

Prevent deployment of client images with runtime versions newer than the target deployment's runtime version to ensure compatibility.

Changes:

  • Add --deployment-id flag to 'astro remote deploy' command for validation
  • Implement validateClientImageRuntimeVersion() function that:
    • Fetches deployment runtime version from platform API
    • Parses Dockerfile.client to extract client image runtime version
    • Rejects deployment if client version > deployment version
  • Enhance ParseImageTag() function to extract runtime versions from image tags like '3.1-1-python-3.12-astro-agent-1.1.0'
  • Add comprehensive test coverage for all validation scenarios
  • Update docker parsing to support Dockerfile.client files

This ensures client images are compatible with the deployment environment and prevents runtime incompatibility issues.

🎟 Issue(s)

closes: #1957

🧪 Functional Testing

List the functional testing steps to confirm this feature or fix.

📸 Screenshots

❯ ../astro remote deploy --deployment-id cmieixby600r601mx9snv8pf1
Error: client image runtime version validation failed:

The client image is based on Astro Runtime version 3.1-5, which is newer than the deployment's runtime version 3.1-4.

To fix this issue, you can either:
1. Downgrade the client image version by updating the base image in Dockerfile.client to use runtime version 3.1-4 or earlier
2. Upgrade the deployment's runtime version to 3.1-5 or later

This validation ensures compatibility between your client image and the deployment environment.

Add screenshots to illustrate the validity of these changes.

📋 Checklist

  • Rebased from the main (or release if patching) branch (before testing)
  • Ran make test before taking out of draft
  • Ran make lint before taking out of draft
  • Added/updated applicable tests
  • Tested against Astro-API (if necessary).
  • Tested against Houston-API and Astronomer (if necessary).
  • Communicated to/tagged owners of respective clients potentially impacted by these changes.
  • Updated any related documentation

@coveralls-official
Copy link

coveralls-official bot commented Nov 5, 2025

Pull Request Test Coverage Report for Build 500c460f-4dde-4c77-8b5a-e7bb50a8f16d

Details

  • 76 of 80 (95.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.07%) to 38.705%

Changes Missing Coverage Covered Lines Changed/Added Lines %
cloud/deploy/deploy.go 63 65 96.92%
cmd/cloud/remote.go 1 3 33.33%
Totals Coverage Status
Change from base Build e19bb0f4-f19d-4857-a0b0-191799712877: 0.07%
Covered Lines: 24350
Relevant Lines: 62911

💛 - Coveralls

Prevent deployment of client images with runtime versions newer than
the target deployment's runtime version to ensure compatibility.

Changes:
- Add --deployment-id flag to 'astro remote deploy' command for validation
- Implement validateClientImageRuntimeVersion() function that:
  - Fetches deployment runtime version from platform API
  - Parses Dockerfile.client to extract client image runtime version
  - Rejects deployment if client version > deployment version
- Enhance ParseImageTag() function to extract runtime versions from
  image tags like '3.1-1-python-3.12-astro-agent-1.1.0'
- Add comprehensive test coverage for all validation scenarios
- Update docker parsing to support Dockerfile.client files

This ensures client images are compatible with the deployment environment
and prevents runtime incompatibility issues.
@feluelle feluelle force-pushed the feature/remote-deploy-cmd-runtime-version-validation branch from f2ce526 to 3f78af2 Compare November 17, 2025 15:50
@feluelle feluelle marked this pull request as ready for review November 18, 2025 10:47
Copy link
Contributor

@neel-astro neel-astro left a comment

Choose a reason for hiding this comment

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

Left some tiny nits, but otherwise LGTM

@feluelle feluelle merged commit f2e6ca3 into main Nov 25, 2025
7 checks passed
@feluelle feluelle deleted the feature/remote-deploy-cmd-runtime-version-validation branch November 25, 2025 12:02
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.

Reject astro remote deploys for too-new agent clients

2 participants