Validate image.source: registry requires a tag; warn on tag: latest - #552
Open
RonaldHensbergen wants to merge 1 commit into
Open
Validate image.source: registry requires a tag; warn on tag: latest#552RonaldHensbergen wants to merge 1 commit into
RonaldHensbergen wants to merge 1 commit into
Conversation
…ource: registry Adds validate_image_source_config(), a new cross-field check that runs whenever a module instance's resolved config.image.source is "registry": - config.image.tag missing or empty -> error E103 (there'd be nothing to pull). - config.image.tag == "latest" -> warning W097 (validates, but discourages the drifting-latest tag in favor of a pinned, reproducible version). - config.image.source: build (the default) is unaffected. Documents both new codes in README.md's error-code reference table, matching the existing E1xx/W0xx entries' style. Resolves #533. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Resolves #533.
Summary
config.image.source: registry(e.g.modules/orchestration/dagster) needsconfig.image.tagset to something pullable, but a plain JSON SchemaconfigSchemacan't express "tag is required only when source is registry"as a cross-field constraint. This adds
validate_image_source_config()incli/validator.pyto enforce it directly, wired intovalidate_loaded_profilealongside the existing contract-binding/observability checks.
config.image.source: registrywithoutconfig.image.tag(missing orempty string) → new error
E103.config.image.tag: "latest"undersource: registry→ new warningW097(the profile still validates — this nudges toward pinned,reproducible versions per Allow modules to pull published images instead of always building locally #407's goal, matching the version scheme
publish-images.ymlalready publishes).config.image.source: build(the default) is unaffected — no newdiagnostics for the existing local-build path.
README.md's error-code reference table,matching the existing E1xx/W0xx entries' style.
Testing
ImageSourceConfigValidationTestintests/test_validator.py:missing tag (error), empty-string tag (error), pinned tag (valid),
tag: latest(warning, not error),source: builddefault path(unaffected), and a full
validate_profile()run through a realmodule.yaml + profile.yaml fixture confirming
tag: latestproduces awarning with zero errors.
modules/orchestration/dagster/module.yaml: noimageconfig → clean,tag: latest→W097only, pinned tag → clean, empty tag →E103.python -m unittest discover -s tests -p "test_*.py" -v— full suite,all pass.
make lint— clean.