feat(dsl): accept default_image as a deprecated back-compat shim#148
Closed
markovejnovic wants to merge 1 commit into
Closed
feat(dsl): accept default_image as a deprecated back-compat shim#148markovejnovic wants to merge 1 commit into
markovejnovic wants to merge 1 commit into
Conversation
Removing `default_image` was a hard break: prod renders committed
pipelines server-side against its baked DSL, so every existing
`@hm.pipeline(..., default_image=...)` started failing render with
TypeError: pipeline() got an unexpected keyword argument 'default_image'
Restore the param on both the decorator and the factory. When given it
overrides the root-step image stamp (in place of the auto-stamped
ubuntu:24.04), exactly as before, and the decorator emits a
DeprecationWarning pointing at the per-step `image=` replacement. Absent
(the migrated path), behavior is unchanged and no warning fires.
This buys a grace period so old pipeline files keep rendering while users
migrate off the param.
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.
Problem
default_imagewas removed from the pipeline DSL outright. But prod renders committed pipelines server-side against its baked DSL — so the moment the removal shipped, every existing@hm.pipeline(..., default_image=...)started failing at render:i.e. a hard break for all users who hadn't yet edited their pipeline files (e.g. #147 was our own dogfood hitting exactly this).
Fix
Restore
default_imageas a deprecated, back-compat shim on both the decorator and the factory:ubuntu:24.04) — exactly the old behavior.@hm.pipeline) emits aDeprecationWarningpointing at the per-stepimage=replacement.This buys a grace period: old pipeline files keep rendering while users migrate off the param, instead of breaking on the next prod deploy.
Tests
tests/test_decorator.py:test_default_image_deprecation_warns— accepted + warns + carried on the registration.test_no_default_image_does_not_warn— migrated path is silent.test_default_image_applies_to_root_step— deprecated value still stamps the root in rendered IR.Full suite:
557 passed, 1 skipped; ruff + mypy clean.Follow-up
The error-quality side (renderer leaking raw Python tracebacks instead of a doctrine-shaped migration error) is handled in a separate PR.