Skip to content

Skip yanked runtime versions when picking default image tags#2094

Open
jedcunningham wants to merge 1 commit intomainfrom
ignore_yanked
Open

Skip yanked runtime versions when picking default image tags#2094
jedcunningham wants to merge 1 commit intomainfrom
ignore_yanked

Conversation

@jedcunningham
Copy link
Copy Markdown
Member

@jedcunningham jedcunningham commented Apr 17, 2026

Description

astro dev init and astro dev start --standalone were selecting yanked Astro Runtime versions (e.g. 3.0-9, yanked 2025-08-20 for broken connection-extras deserialization) because the version-selection logic only filtered on Channel, not on the yanked field now present in the updates.astronomer.io/astronomer-runtime JSON feed.

This PR:

  • Adds Yanked / YankedReason to RuntimeVersionMetadata.
  • Skips yanked entries in getAstroRuntimeTag (used by dev init, dev upgrade-runtime, client image resolution, and cloud default-runtime lookups).
  • Skips yanked entries in ResolveFloatingTag (used by dev start --standalone to map a floating tag in the user's Dockerfile to a concrete pinned runtime version). The selection logic is extracted into a pure helper so it's testable without the HTTP layer.

Note: existing projects that pin a floating tag in their Dockerfile (e.g. FROM astrocrpublic.azurecr.io/runtime:3.0) aren't helped by this PR — Docker pulls whatever the registry says that tag points to. A separate RUNTIME-team issue will track repointing floating tags at yank time.

🎟 Issue(s)

Fixes #1923

🧪 Functional Testing

The live updates.astronomer.io/astronomer-runtime feed has no "latest of a line is yanked" scenario — yanks so far haven't hit the top of a line. To exercise the fix end-to-end, I served a locally-doctored copy of the feed (marking the current top of each 3.x line as yanked) via python3 -m http.server, temporarily pointed RuntimeReleaseURL at it, and ran the CLI.

  • go test ./airflow_versions/... passes.
  • In a scratch dir against the doctored feed, astro dev init generated a Dockerfile with FROM astrocrpublic.azurecr.io/runtime:3.1-13 — the highest non-yanked version — skipping the yanked 3.1-14, 3.2-1, and 3.2-2.
  • In a scratch dir with FROM astrocrpublic.azurecr.io/runtime:3.1 (floating), astro dev start --standalone installed apache-airflow==3.1.7 (from 3.1-13, non-yanked), not 3.1.8 (which is the yanked 3.1-14).

📸 Screenshots

N/A

📋 Checklist

  • Rebased from the main (or release if patching) branch (before testing)
  • Ran make test before taking out of draft
  • Ran make lint before taking out of draft
  • Added/updated applicable tests
  • Tested against Astro-API (if necessary).
  • Tested against Houston-API and Astronomer (if necessary).
  • Communicated to/tagged owners of respective clients potentially impacted by these changes.
  • Updated any related documentation

The updates.astronomer.io runtime feed marks bad releases with
`yanked: true` (e.g. 3.0-9), but the CLI ignored that field. Two code
paths picked yanked versions:

- getAstroRuntimeTag (used by `astro dev init`, `dev upgrade-runtime`,
  client image resolution, and cloud default-runtime lookups)
- ResolveFloatingTag (used by `astro dev start --standalone` to map a
  floating tag in the user's Dockerfile to a pinned runtime version)

Both now skip entries where Metadata.Yanked is true. The floating-tag
selection is extracted into a pure helper so it can be unit-tested
without the HTTP layer.

Fixes #1923
@jedcunningham jedcunningham requested a review from a team as a code owner April 17, 2026 21:01
@coveralls-official
Copy link
Copy Markdown

Coverage Report for CI Build 0

Coverage increased (+0.02%) to 39.399%

Details

  • Coverage increased (+0.02%) from the base build.
  • Patch coverage: 1 uncovered change across 1 file (15 of 16 lines covered, 93.75%).
  • 1 coverage regression across 1 file.

Uncovered Changes

File Changed Covered %
airflow_versions/airflow_versions.go 16 15 93.75%

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
airflow_versions/airflow_versions.go 1 84.66%

Coverage Stats

Coverage Status
Relevant Lines: 63337
Covered Lines: 24954
Line Coverage: 39.4%
Coverage Strength: 9.52 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.

astro dev init does not ignore yanked images

1 participant