fix(ci): fix stale cache key and add full data sync to build-container.yml#111
fix(ci): fix stale cache key and add full data sync to build-container.yml#111castrojo wants to merge 3 commits into
Conversation
…r.yml SO-35: Update cache key from tap-history-v1 to tap-history-v4, matching the key used by daily-build.yml. The stale v1 key meant the GHCR container image built with a cold cache every day, producing no homebrew trend history. SO-36: Add missing data sync steps (testhub, countme, releases, supply-chain, scorecard, brewfile-taps) with continue-on-error: true so partial failures don't block the container image push. Also add save steps for both tap-history-v4 and testhub-history-v1 caches so the container build accumulates trend history over time. The GHCR OCI image now produces a full-data dashboard matching the GitHub Pages site. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Assisted-by: Claude Sonnet 4.6 via GitHub Copilot
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
📝 WalkthroughWalkthroughCI workflow restructured: cache keys bumped for tap history (v1→v4), separate testhub/builds history caches added, the single "Sync tap data" step replaced by building the Changes
Sequence Diagram(s)sequenceDiagram
participant Runner as GitHub Runner
participant Actions as Actions Steps
participant Repo as Repository (src/.sync-cache)
participant Cache as Actions Cache
participant Stats as stats binary
Runner->>Actions: start job (timeout=120m)
Actions->>Cache: restore `tap-history-v4-${{ github.run_id }}` & other versioned caches
Actions->>Repo: ensure .sync-cache files available
Actions->>Runner: `go build` stats -> Stats
Runner->>Stats: run `stats fetch-*` (multiple commands, many continue-on-error)
Stats->>Repo: write `src/data/*.json` and `.sync-cache/*-history.json`
Actions->>Cache: save `.sync-cache` -> `tap-history-v4-${{ github.run_id }}` (if: always())
Actions->>Cache: save `testhub-history.json` (if: always())
Actions->>Cache: save builds-history cache (if: always())
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/build-container.yml (1)
63-87: Standardize timeouts across remaining fetch steps.
fetch-countme,fetch-supply-chain, andfetch-scorecardcurrently have no timeout, so a hung network call can stall the job. Add explicittimeout-minuteslike the testhub/releases steps for consistency.Suggested diff
- name: Fetch countme active-user stats continue-on-error: true + timeout-minutes: 5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: ./stats-go/stats fetch-countme - name: Fetch supply chain data continue-on-error: true + timeout-minutes: 5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: ./stats-go/stats fetch-supply-chain - name: Fetch Scorecard data continue-on-error: true + timeout-minutes: 5 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: ./stats-go/stats fetch-scorecard🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/build-container.yml around lines 63 - 87, The three GitHub Actions steps "Fetch countme active-user stats", "Fetch supply chain data", and "Fetch Scorecard data" lack timeouts and can hang; add a timeout-minutes entry (e.g., timeout-minutes: 5 to match the "Fetch release frequency data" step) to each of those steps so they abort after the configured time and keep behavior consistent with the existing "fetch-releases" step.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/build-container.yml:
- Around line 63-87: The three GitHub Actions steps "Fetch countme active-user
stats", "Fetch supply chain data", and "Fetch Scorecard data" lack timeouts and
can hang; add a timeout-minutes entry (e.g., timeout-minutes: 5 to match the
"Fetch release frequency data" step) to each of those steps so they abort after
the configured time and keep behavior consistent with the existing
"fetch-releases" step.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7022ed5f-b41d-4ef1-b681-6cb45f808bdf
📒 Files selected for processing (1)
.github/workflows/build-container.yml
SO-38: computeArchStatus and computeLastStatus both sorted their input
slice on every call (O(N×S log S) across all app loops). Pre-sort
store.Snapshots once before the app loops in runFetchTesthub() instead.
Both functions now receive pre-sorted newest-first input and iterate
directly. Add 7 regression tests for computeArchStatus covering: both
known, newest-wins, failing, unknown app, empty snapshots, no mutation,
and arch-independent resolution from older snapshots.
SO-40: Expand the skills/SKILL.md subcommand table from 3 entries to all
19 implemented subcommands (fetch-brewfile-taps, fetch-releases,
fetch-contributors, fetch-scorecard, fetch-supply-chain,
fetch-builds-{bluefin,aurora,bazzite,universal-blue,ucore,zirconium,
bootcrew,blue-build}, fetch-quay-{fedora,centos,almalinux}). Update the
daily-build.yml CI step list to reflect the full 15-step pipeline.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Assisted-by: Claude Sonnet 4.6 via GitHub Copilot
…test column - Add restore/save caches for contributor-history and builds-history - Add fetch steps for all 8 build pipeline targets (bluefin/aurora/bazzite/etc) - Add fetch-quay steps for fedora/centos/almalinux - Add job-level timeout-minutes: 120 - Fix smoke test: testhub status is column 2, uses ✅/❌ not 🟢/🔴 Assisted-by: Claude Sonnet 4.6 via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Fixes two critical data correctness bugs and one performance issue in the Go stats pipeline (from SO-5 bootc-ecosystem tech assessment).
SO-35: Stale cache key (Critical G1)
build-container.ymlwas using cache keytap-history-v1whiledaily-build.ymlusestap-history-v4. This meant the GHCR OCI image build always got a cold/stale cache — the container image had no homebrew trend history at all.Fix: Update both
keyandrestore-keysfromtap-history-v1-totap-history-v4-.SO-36: Missing data sync steps (Critical G2)
build-container.ymlonly synced homebrew data. The GHCR OCI image was missing testhub, countme, releases, supply-chain, scorecard, and brewfile analytics — a degraded subset of what the Pages site shows.Fix: Add sync steps for:
fetch-brewfile-tapsfetch-testhub(withtesthub-history-v1cache restore + save)fetch-countmefetch-releasesfetch-supply-chainfetch-scorecardAll steps use
continue-on-error: trueconsistent withdaily-build.ymlpattern, so partial API failures don't block the container push. Cache save steps added so trend history accumulates over time.SO-38: Fix computeArchStatus O(N×S log S) sort-per-call pattern (Medium/P1)
computeArchStatusandcomputeLastStatuswere both sortingstore.Snapshotson every call — an O(N×S log S) pattern that degrades with scale.Root cause: Both functions internally sorted the snapshot slice before iterating, meaning S×N sorts (once per app per function call) instead of one.
Fix: Pre-sort
store.Snapshotsnewest-first once before the two app-loops inrunFetchTesthub(). BothcomputeArchStatusandcomputeLastStatusnow receive a pre-sorted slice and iterate directly. The contract is documented in each function's godoc.Regression tests added (
cmd/stats/main_test.go):TestComputeArchStatus_BothKnown— both arches resolved from newest snapshotTestComputeArchStatus_NewestWins— newest data takes precedence over older failuresTestComputeArchStatus_Failing— failing result propagated correctlyTestComputeArchStatus_UnknownApp— missing app returns unknown/unknownTestComputeArchStatus_EmptySnapshots— nil input returns unknown/unknownTestComputeArchStatus_DoesNotMutateInput— input slice order is not modified by the functionTestComputeArchStatus_ArmOnlyResolvesFromOlderSnapshot— arch independence: each arch resolved independently from its most-recent snapshotTesting
go test ./...passes: all 16 packages passdaily-build.ymlstructure exactly