Skip to content

fix(deploy): do not treat --image-name as image-only#2113

Open
jlaneve wants to merge 1 commit into
mainfrom
julianlaneve/ai-464-image-name-implies-image-only-regression
Open

fix(deploy): do not treat --image-name as image-only#2113
jlaneve wants to merge 1 commit into
mainfrom
julianlaneve/ai-464-image-name-implies-image-only-regression

Conversation

@jlaneve
Copy link
Copy Markdown
Contributor

@jlaneve jlaneve commented Apr 30, 2026

Summary

  • Regression in v1.42.0: astro deploy <id> --image-name <tag> is auto-promoted to an image-only deploy. On any Deployment that has not enabled DAG deploys, that fails with DAG-only deploys are not enabled for this Deployment.
  • The same flag combination performed an image-and-dags deploy through v1.41.0, and the GitHub Action astronomer/deploy-action relies on that — its deploy-type: image-and-dags step runs astro deploy <id> --wait --image-name <tag> and uses the explicit --image --image-name form for image-only. Auto-flipping --image-name to image-only therefore breaks the image-and-dags + prebuilt-image flow with no replacement.

This restores the historical semantics: --image-name specifies the image source, --image specifies the deploy type. They compose:

Invocation Deploy type Project dir required
astro deploy --image-name X image-and-dags (default) yes (DAGs come from ./dags)
astro deploy --image image-only yes
astro deploy --image --image-name X image-only no (skipped — no local files needed)

Changes

  • cmd/cloud/deploy.go: drop image = true auto-set and the forbidden-flag list (--dags, --dags-path, --no-dags-base-dir, --pytest, --parse, --build-secrets) introduced for --image-name. Scope the EnsureProjectDir skip to --image && --image-name.
  • cmd/cloud/deploy_test.go: replace the now-inverted assertions; add a regression test that --image-name alone does not flip Image to true.

The previous user-facing scenario (astro deploy --image-name X from a non-project dir) is now served by the explicit astro deploy --image --image-name X, which is the form deploy-action already uses for image-only deploys.

Test plan

  • go test ./cmd/cloud/ ./cloud/deploy/ passes
  • go vet ./cmd/cloud/ ./cloud/deploy/ clean
  • Manual: astro deploy <id> --image-name <tag> against a Deployment without DAG deploys enabled completes (no enableDagDeployMsg)
  • Manual: astro deploy --image --image-name <tag> from a non-project directory still works

🤖 Generated with Claude Code

Restore the pre-1.42.0 semantics of --image-name: it specifies the image
source, not the deploy type. Defaulting to image-only on --image-name
broke image-and-dags deploys against deployments that do not have DAG
deploys enabled. Dropping the auto-set and the forbidden-flag list
restores the historical behavior; --image --image-name remains the
explicit image-only form and still skips the project-dir check.
@jlaneve jlaneve requested a review from a team as a code owner April 30, 2026 17:07
@coveralls-official
Copy link
Copy Markdown

Coverage Report for CI Build 8

Coverage decreased (-0.004%) to 39.563%

Details

  • Coverage decreased (-0.004%) from the base build.
  • Patch coverage: 3 of 3 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 64120
Covered Lines: 25368
Line Coverage: 39.56%
Coverage Strength: 9.56 hits per line

💛 - Coveralls

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.

2 participants