Skip to content

feat(dsl): accept default_image as a deprecated back-compat shim#148

Closed
markovejnovic wants to merge 1 commit into
mainfrom
feat/pipeline-default-image-deprecation-shim
Closed

feat(dsl): accept default_image as a deprecated back-compat shim#148
markovejnovic wants to merge 1 commit into
mainfrom
feat/pipeline-default-image-deprecation-shim

Conversation

@markovejnovic

Copy link
Copy Markdown
Contributor

Problem

default_image was 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:

TypeError: pipeline() got an unexpected keyword argument 'default_image'

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_image as a deprecated, back-compat shim 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 the old behavior.
  • The decorator (@hm.pipeline) 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: 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.

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.
@markovejnovic markovejnovic deleted the feat/pipeline-default-image-deprecation-shim branch June 13, 2026 17:44
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.

1 participant