Repository navigation
Conversation
- APC astro deploy --dags no longer needs a Dockerfile: a DAG-only deploy builds nothing, so a 1.x project or a pyproject.toml project makes one. - --image-name bypasses test the value, not whether the flag was given, on astro deploy, astro remote deploy and APC deploy: an empty --image-name= builds, so the project check runs. - astro remote deploy --image-name skips the project check, as astro deploy does: a prebuilt image is pushed as it is. - EnsureDockerfileProjectDir also requires the Dockerfile the APC build parses, names what is missing, and gives advice that can be followed: astro package --tag <image>, then astro deploy <id> --image-name <image>. - In the home directory the advice no longer suggests astro init, and astro init refuses to make a new project of the home directory. Co-Authored-By: Claude <noreply@anthropic.com>
Coverage Report for CI Build 37941716828Coverage increased (+0.03%) to 57.496%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
…e guard - astro remote deploy --image-name runs the project check again: the push reads its registry from the project's .astro/config.yaml. - APC deploy --remote skips the project check, so RunE reports a missing --image-name instead of a missing Dockerfile. - astro deploy's RunE reads --image-name's value as PreRunE does: an empty --image-name= no longer makes a --dags deploy image-only. - APC deploy --save refuses a pyproject.toml project rather than writing a .astro/config.yaml into it. - The APC project-check test restores every global it sets. - Drop astro init's home-directory refusal: in Astro Runtime images HOME is the project root. - One home comparison: config.IsProjectDir uses config.IsHomeDir (cleaned path or os.SameFile), and cmd/utils calls it instead of its own copy. Co-Authored-By: Claude <noreply@anthropic.com>
This was referenced Oct 9, 2026
Open
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces #2288 with the core user-facing fixes to the project-directory advice #2283 added, built on v2's existing helpers (
config.IsProjectDir,project.HasManifest). The only change underconfig/is thatIsProjectDir's existing home check now compares paths properly (see 6). Non-test lines vs v2: +102 / -15.Fixes
astro deploy --dagsno longer needs a Dockerfile. A DAG-only deploy builds nothing; it uploadsdags/.cmd/apc'sEnsureProjectDirvar (name kept) now points atensureDeployProjectDir. For--dagsit accepts a pyproject.toml project (project.HasManifest) or a 1.x project (utils.EnsureProjectDir, with no Dockerfile check). Every other APC deploy still goes throughutils.EnsureDockerfileProjectDir.astro deploy --remoteskips the project check.--remotepoints the Deployment at an image already in the registry and builds nothing, so a missing--image-nameis reported by RunE ("--image-name is mandatory when --remote flag is passed") rather than as a missing Dockerfile.--remote --dagsstill checks the project, since RunE makes a DAG-only deploy then.--image-nameis read by its value in PreRunE and RunE alike. Inastro deploy(Astro) and APC deploy, an explicit empty--image-name=names no image. The project check runs, and on Astro,--image-name= --dagsis no longer refused as "--image-name implies an image-only deploy".astro deploy --saverefuses a pyproject.toml project that has no.astro/config.yaml, with a usage error: "--save stores the deployment in .astro/config.yaml, which a pyproject.toml project does not have; pass the deployment id on each deploy instead". Without this, saving would create.astro/config.yamland turn the project into a 1.x one.EnsureDockerfileProjectDiralso requires<WorkingPath>/Dockerfile, which the APC build parses there. The error names what is missing ("this directory has no .astro/config.yaml and no Dockerfile" / "has no Dockerfile"), and its advice can be followed:run astro package --tag <image>, then astro deploy <deployment-id> --image-name <image>.config.IsProjectDir's home check used a rawHomePath == path. It now callsconfig.IsHomeDir, which compares the cleaned paths and falls back toos.SameFile, so~/and a symlink to~are not project directories either.cmd/utilsuse that same helper to say so, and they do not suggestastro init.astro remote deployis unchanged from v2: the pyproject.toml bypass stays, and--image-namedoes not skip the project check.DeployClientImagereads the registry it pushes to from the project's.astro/config.yaml, so outside a project it could push to the wrong registry.TestRemoteDeployImageNameStillChecksTheProjectpins this.Tests:
TestDeployProjectCheckFollowsTheDeploy(cmd/apc): covers --dags, --remote and --save. It restores every global it sets.TestDeploySkipsEnsureProjectDirWhenImageNameSetandTestDeployEmptyImageNameIsNotImageOnly(cmd/astro)TestRemoteDeployImageNameStillChecksTheProjectTestEnsureDockerfileProjectDirNamesWhatIsMissingTestEnsureProjectDirInTheHomeDirectoryTestIsProjectDirRefusesHomeUnderAnySpelling(config)Left out on purpose (follow-ups)
#2288 rewrote project detection to cover these, and each review round found new regressions in that machinery (#2288's reviews). Each needs its own design:
astro initguard against scaffolding into$HOME. An earlier revision of this PR refused it, but that breaks containers and CI where HOME is the project root (Astro Runtime images use HOME=/usr/local/airflow). The advice no longer sends anyone to run init in~..astro/config.yamland pyproject.toml manifests.ASTRO_HOMEsettings-file handling: the CLI's own~/.astro/config.yaml, or one underASTRO_HOME, can be mistaken for a 1.x project's.astro deploy --saveon Astro from a pyproject project, which may need the same refusal APC deploy now has.astro init's warning when nesting a project inside another.Checks
go build ./...andGOOS=windows go build ./...GOOS=windows go veton config, cmd/utils, cmd/apc, cmd/astro and cmd/localmake testandmake test-e2e(tier 0)make lint(no autofix rewrites),make lint-goosandmake deadcodeMerge-tree
git merge-tree --write-treeis conflict-free against all three open branches. Each combination also passesgo vet ./cmd/... ./config/andgo teston the touched packages:go testcovered all of./cmd/...