Files
plex-playlist/docs/adr/ADR004-registry-image-resolution-and-auth-resilience.md
Xlorep DarkHelm e539f9b0d8
Some checks failed
CICD / Build and Push CICD Images (push) Successful in 14m35s
CICD / Build CICD Image Failure Postmortem (push) Has been skipped
CICD / Dependency Audits (Informational) (push) Successful in 3m46s
CICD / Source Checks (push) Successful in 8m32s
CICD / Source Lanes Failure Postmortem (push) Has been skipped
CICD / CICD Tests Complete (push) Successful in 2s
CICD / Build Release Images (push) Failing after 3m4s
CICD / Build Tester Images (push) Successful in 37m6s
CICD / Production Images Complete (push) Failing after 8s
CICD / Runtime Black-Box Integration Tests (push) Has been skipped
CICD / End-to-End Tests (push) Has been skipped
CICD / Integration Tests Failure Postmortem (push) Has been skipped
CICD / Production Image Failures Postmortem (push) Successful in 20s
CICD / E2E Tests Failure Postmortem (push) Has been skipped
CICD / Promote Staging Images To Release (push) Has been skipped
ci: consolidate cicd workflow lanes, clean up helpers, and align CI docs (#86)
## Summary
This PR simplifies the CICD workflow by merging related lanes, reducing duplicated script logic, and keeping the same overall pipeline behavior and gates. It also updates CI documentation to match the new job topology.

## What Changed

### Workflow consolidation
- Merged base and complete CICD image publication into one producer job:
  - Build and Push CICD Images
- Merged dependency audits into one informational lane:
  - Dependency Audits (Informational)
- Merged runtime image build lanes into one release producer:
  - Build Release Images
- Merged tester image build lanes into one tester producer:
  - Build Tester Images

### Dependency/gate rewiring
- Updated downstream needs to consume merged producers.
- Kept output contracts for deployable and tester image references.
- Updated production and postmortem gates to the new job IDs.

### Cleanup/simplification
- Removed duplicate helper-function definition(s) in CICD scripts.
- Replaced a manual docker login retry loop with existing retry helper usage.
- Removed redundant shell option declarations where behavior was unchanged.
- Removed one unused E2E environment variable.

### Documentation alignment
- Updated CI architecture documentation to reflect merged workflow lanes.
- Updated troubleshooting guidance to reference current job sequencing.

## Why
- Reduce job startup overhead on self-hosted runners.
- Keep behavior consistent while lowering workflow complexity.
- Improve maintainability by removing duplicated/unused script fragments.
- Keep docs in sync with operational workflow reality.

## Validation
- Workflow file checks passed with pre-commit.
- Documentation checks passed with pre-commit (including markdownlint/prettier).
- No diagnostics/errors reported for updated workflow/docs files.

## Risk and Impact
- Low-to-medium operational risk due to job-ID/needs rewiring.
- Mitigated by preserving output keys consumed by integration and e2e lanes.
- Audit lane remains informational-only (non-blocking), same intent as before.

Co-authored-by: copilotcoder <copilotcoder@darkhelm.org>
Reviewed-on: #86
2026-07-17 17:14:00 -04:00

2.5 KiB

ADR004: Registry Image Resolution and Auth Resilience Policy

  • Status: Accepted
  • Date: 2026-07-16

Context

The CI and Renovate workflows run on self-hosted runners with intermittent DNS and network instability. Recent failures showed that image pull/push reliability depends on more than simple retries:

  • registry token realms may resolve to a different host than the registry endpoint
  • mirror images can become stale relative to upstream
  • downstream lanes require immutable references from upstream lanes
  • Renovate must operate across internal/external endpoint paths with token variability

Without an explicit policy, each job implements ad hoc behavior and drift reintroduces flakiness.

Decision

Adopt a cross-workflow reliability policy for registry/image operations:

  1. Prefer mirrored images first, then fallback upstream sources when mirror resolution fails.
  2. Use digest-aware freshness checks when deciding whether local image cache is current.
  3. Pin registry auth realm hosts when WWW-Authenticate challenge host differs from registry host.
  4. Use bounded login/pull/push retry wrappers in image publication and consumption lanes.
  5. Propagate and verify immutable digest references for downstream runtime validation lanes.
  6. Keep retry counts/timeouts configurable as operational tuning, not architectural invariants.

Scope

This ADR applies to:

  • .gitea/workflows/cicd.yaml
  • .gitea/workflows/renovate.yml
  • helper scripts used for mirrored image resolution and lane orchestration

This ADR does not prescribe exact retry constants or runner sizing thresholds.

Consequences

Positive:

  • reduced CI flakiness from token realm host mismatch and transient registry failures
  • stronger traceability via digest-first downstream checks
  • clearer operator expectations for endpoint/token/image fallback behavior
  • consistent reliability approach across CICD and Renovate workflows

Negative:

  • increased workflow script complexity and duplicated helper logic inside isolated step shells
  • additional maintenance burden to keep helper patterns consistent across lanes

Alternatives Considered

  1. Keep per-job ad hoc retries only.
  • Rejected due to repeated regressions and inconsistent behavior.
  1. Depend solely on upstream registries.
  • Rejected due to local network and availability constraints.
  1. Rebuild missing artifacts in downstream lanes.
  • Rejected because it breaks publish-once/consume-many behavior and weakens traceability.
  • ADR002-cicd_base_image_tagging.md
  • ADR003-deployable_runtime_image_contract.md