Match the default AI Gateway tag to the GitLab version, falling back by patch

Closes #41 (closed)

Plain up derived self-hosted-v<X.Y.Z>-ee from the GitLab version and failed at the pull when upstream had not published that patch. Today the derived tag is v19.5.6, which is unpublished; v19.5.5 is the newest. This MR makes the default match the GitLab version as closely as the registry allows, and says so.

flowchart TD
  A[up starts the gateway] --> B{--aigw-branch, --aigw-mr or SIM_AIGW_IMAGE alone?}
  B -- yes --> Z[No tag resolved: built or custom image]
  B -- no --> C{SIM_AIGW_TAG set?}
  C -- yes --> D[Use it as given]
  D --> P[Pull: unpublished is fatal, no fallback]
  C -- no --> E[Derive self-hosted-vX.Y.Z-ee from the GitLab version]
  E --> F[List the minor's published tags, anonymous]
  F --> G{Registry answered?}
  G -- no --> H[Warn, use the exact tag unchecked]
  G -- yes --> I{Exact tag published?}
  I -- yes --> J[Use the exact tag]
  I -- no --> K{Lower patch in the same minor?}
  K -- yes --> L[Warn naming both tags, use the newest lower patch]
  K -- no --> M[Fail: the minor has no published tag]
  H --> P2[Pull]
  J --> R[Record aigw_tag]
  L --> R2[Record aigw_tag and aigw_tag_requested]
  P2 --> R

What changed

  • With no tag set, up lists the registry once (a pull-scoped token from the public auth endpoint, then the tag list; no credentials). It uses the exact tag when published, else the newest published lower patch of the same major.minor, with a warning that names both tags.
  • Patches compare numerically, so 19.5.10 follows 19.5.9. A patch above the requested one is never taken.
  • A minor with no published tag fails with a message saying so. A registry that cannot be read keeps the exact tag with a warning, and the pull decides, as before.
  • An explicit SIM_AIGW_TAG is never replaced; unpublished, it still fails at the pull and names the nearest tag. --aigw-branch and --aigw-mr never resolve a tag.
  • State: aigw_tag is the tag that ran. New aigw_tag_requested holds the tag wanted, set only after a fallback and cleared by the next exact start. status --json carries it; schema_version is 11.
  • This reverses the "never falls back" stance of !143 (merged) for the default path only.

Proof

  • Resolver against the real registry for the default version 19.5.6: prints WARNING: AI Gateway tag self-hosted-v19.5.6-ee is unpublished; using self-hosted-v19.5.5-ee, the newest published patch below it in the same minor and resolves to self-hosted-v19.5.5-ee.
  • Engine self-test (stubbed registry listing): exact match used; fallback to the newest lower patch, including 19.5.10 over 19.5.9; no tag in the minor is fatal; unreadable registry keeps the exact tag; explicit unpublished tag is fatal at the pull; --aigw-mr unaffected; state records both keys and clears the requested one on an exact start.
  • Rig run, one omnibus rig (sim-aigwm1), plain up with no AI Gateway tag set: it logged the same warning, pulled self-hosted-v19.5.5-ee, and came up ready. status --json showed schema_version 11, aigw_tag self-hosted-v19.5.5-ee and aigw_tag_requested self-hosted-v19.5.6-ee; the gateway's /monitoring/healthz returned 200. The rig is torn down and no sim-aigwm instance remains.

Word budget is unchanged at 40484 of 40489: the doc edit is paid for with equal cuts in aigw.md.

Edited by Andrew Dunn

Merge request reports

Loading
Loading