Skip to content

fix(fetch/alma-errata): restore advisories dropped by upstream#191

Open
shino wants to merge 4 commits into
mainfrom
shino/fetch-alma-errata-restore
Open

fix(fetch/alma-errata): restore advisories dropped by upstream#191
shino wants to merge 4 commits into
mainfrom
shino/fetch-alma-errata-restore

Conversation

@shino

@shino shino commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • AlmaLinux has re-curated the AlmaLinux 10 errata.full.json feed twice, silently dropping published advisories while their HTML pages (https://errata.almalinux.org/10/) and the official OSV export (AlmaLinux/osv-database, osv.dev) keep carrying them:
    • cb5d6bc44 (raw, 2025-11-26): -102 advisories (the ALSA-2025:7457..19772 range + ALSA-2025:A003/A006)
    • e64c5ca88 (raw, 2026-05-27): -143 advisories, ~376 CVEs losing detection coverage — the event that forced the current alma-errata pin in db-main.mk / db-nightly.mk
    • Upstream inquiry about which source is authoritative: https://bugs.almalinux.org/view.php?id=644 (no response yet)
  • Split the alma-errata fetch out of fetch-main into its own workflow following the fetch-paloalto-json-or-csaf.yml pattern: after the fetch rewrites the tree from the current feed, restore exactly the 245 explicitly listed advisories, each from the pinned pre-purge snapshot its list block declares (RESTORE_SNAPSHOT_N / RESTORE_PATHS_N pairs: 143 from 8255896a, 102 from 593d3bca — the parents of the two purge commits). Nothing unlisted is ever restored, per-file provenance is explicit in the diff, and a misassigned or duplicated entry fails the job.
  • Every disappearance is arbitrated against the upstream HTML directory index (one GET per version; zero requests when nothing dropped; the Fetch step already depends on the same host):
    • unlisted drop whose HTML page is still published → feed re-curation → job fails; human appends to a RESTORE_PATHS_N block
    • unlisted drop whose HTML page is gone → genuine upstream retirement → deletion propagates with a ::warning::
    • listed entry about to be restored whose HTML page is gone → job fails until the entry is removed (explicit acceptance), so a restore can never resurrect something upstream fully retired (entries the feed itself carries again are the feed's business, not the restore logic's — they just emit a prune-the-list warning)
    • unreachable / zero-entry index → job fails (indeterminate is never treated as retired)
  • A gc/truncate guard hard-fails the job if a pinned snapshot ever vanishes from history; an entry the feed carries again emits a ::warning:: prompting list pruning.

Verification

  • actionlint clean on the new/changed workflows (the two pre-existing SC2086 infos in fetch-all.yml's check job are untouched).
  • Restore step simulated against the real vuls-data-raw-alma-errata dotgit and the live HTML index (511 pages parsed):
    • normal run: 0 unexpected drops, 245 files restored (143 from 8255896a, 102 from 593d3bca); resulting AlmaLinux 10 set (511) matches both the osv.dev export and the HTML index exactly
    • unlisted drop with a live HTML page → fails listing the path
    • listed entry without an HTML page → fails demanding list removal
    • drop without an HTML page → warning + deletion propagates while the rest restore
    • entry declared under a snapshot that does not carry it → fails pointing at the misassignment
    • entry listed in more than one RESTORE_PATHS_N block → fails as a duplicate
  • Snapshot layouts verified identical to the current fetcher layout (<version>/ALSA/<year>/<ID>.json), so restored files stay under fetch management.

Follow-up (separate PR)

Once this has run and extract alma-errata has picked the restored advisories up, unpin alma-errata in db-main.mk / db-nightly.mk. The first unpinned run will trip diff-guard on alma_10/alma:10 by design (baseline jump) and needs the usual promote.

🤖 Generated with Claude Code

…ed re-curations

AlmaLinux re-curated the AlmaLinux 10 errata.full.json feed twice
(2025-11-26: -102 advisories, 2026-05-27: -143 advisories / ~376 CVEs),
dropping published advisories from the feed while their HTML pages and
the official OSV export still carry them (asked upstream which side is
authoritative: https://bugs.almalinux.org/view.php?id=644).

Split the alma-errata fetch out of fetch-main into its own workflow,
following the fetch-paloalto-json-or-csaf pattern: after the fetch, any
file still carried by a restore source (pre-fetch HEAD + the parents of
the two purge commits) but missing from the fresh fetch is restored, so
the raw repository keeps the union of everything upstream ever
published, matching the HTML/OSV semantics. Verified locally: restoring
143+102 files on top of the current feed yields exactly the 511-advisory
set the OSV export carries for AlmaLinux 10.

Unlike paloalto-json there is no upstream list to validate against, so
there is no allowlist and upstream deletions never propagate on their
own; the step emits a warning whenever it restores anything so new
re-curations stay visible.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 6, 2026 01:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the CI fetching pipeline to make AlmaLinux Errata ingestion resilient to upstream feed “re-curations” that silently drop already-published advisories, by introducing a dedicated fetch-alma-errata workflow that restores missing advisory JSON files from pinned historical snapshots.

Changes:

  • Removed alma-errata from the generic fetch-main workflow dispatch options and from the fetch-all matrix.
  • Added a new reusable workflow fetch-alma-errata.yml that fetches the current feed and then restores any dropped .json advisories from HEAD and two pinned snapshot commits, failing hard if those snapshots are missing from history.
  • Wired fetch-all.yml to run the new Alma errata fetch as a separate job and include it in the overall check gating.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
.github/workflows/fetch-main.yml Removes alma-errata from the workflow_dispatch target choice list so it’s no longer run via the generic fetch workflow.
.github/workflows/fetch-alma-errata.yml New dedicated workflow that fetches Alma errata and restores advisories dropped by upstream from pinned history sources before committing/pushing.
.github/workflows/fetch-all.yml Removes alma-errata from the main fetch matrix and adds a standalone fetch-alma-errata job included in downstream needs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…t path list

Replace the loose restore-everything-missing behavior with an explicit
245-path RESTORE_PATHS list (the exact union the two re-curations
dropped; current feed + these = the 511-advisory OSV set, verified) and
turn every other disappearance into a hard failure: a file carried by
the pre-fetch HEAD but missing from the fresh fetch, and in neither
RESTORE_PATHS nor ACCEPTED_REMOVAL_PATHS, fails the job for human
triage, mirroring the paloalto-json allowlist flow. Entries the feed
carries again emit a warning to prune the list.

Simulated against the real dotgit: 0 unexpected drops, 245 restored,
resulting AlmaLinux 10 set diff-equal to the osv.dev export.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@shino shino requested a review from Copilot July 6, 2026 01:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

Comment thread .github/workflows/fetch-alma-errata.yml Outdated
Comment thread .github/workflows/fetch-alma-errata.yml
Comment thread .github/workflows/fetch-alma-errata.yml
Comment thread .github/workflows/fetch-alma-errata.yml
Comment thread .github/workflows/fetch-alma-errata.yml

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread .github/workflows/fetch-alma-errata.yml
Comment thread .github/workflows/fetch-alma-errata.yml Outdated
Comment thread .github/workflows/fetch-alma-errata.yml
@shino shino requested a review from Copilot July 6, 2026 02:48
shino and others added 2 commits July 6, 2026 11:59
…L index

Replace the manual ACCEPTED_REMOVAL_PATHS escape hatch with an automatic
oracle: the per-version HTML directory index on errata.almalinux.org
(one GET per version, zero requests when nothing dropped). A feed drop
whose HTML page is still published is a re-curation and fails the job
for RESTORE_PATHS triage as before; a drop whose HTML page is gone is a
genuine upstream retirement and propagates with a warning. RESTORE_PATHS
entries are held to the same standard: an entry about to be restored
whose HTML page has vanished fails the job until a human removes it,
so the pinned list can never resurrect something upstream fully
retired. An unreachable or zero-entry index fails the job rather than
guessing; the Fetch step already depends on the same host, so this adds
no new availability dependency.

Simulated against the real dotgit and live index (511 pages parsed):
normal run restores 245; an unlisted drop with a live HTML page fails;
a listed entry without an HTML page fails; a drop without an HTML page
propagates with a warning while the remaining 245 restore.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replace the ordered RESTORE_SNAPSHOTS search (first snapshot carrying a
file wins) with explicit RESTORE_SNAPSHOT_N / RESTORE_PATHS_N pairs:
each of the 245 paths now declares the exact commit it is restored from
(143 from 8255896a, 102 from 593d3bca), so provenance is auditable in
the diff and future re-curations append a self-contained pair instead
of relying on iteration order. A path listed under a snapshot that does
not carry it, or listed in more than one block, fails the job.

Simulated against the real dotgit and live index: normal run restores
245 (143+102); a misassigned entry and a duplicate entry each fail; the
HTML-index arbitration scenarios behave unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Comment thread .github/workflows/fetch-alma-errata.yml Outdated
Comment thread .github/workflows/fetch-alma-errata.yml
Comment thread .github/workflows/fetch-alma-errata.yml Outdated
Copilot AI review requested due to automatic review settings July 6, 2026 03:05
@shino shino changed the title feat(ci/fetch): restore alma-errata advisories dropped by upstream feed re-curations fix(fetch/alma-errata): restore advisories dropped by upstream Jul 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread .github/workflows/fetch-alma-errata.yml
Comment thread .github/workflows/fetch-alma-errata.yml
Comment thread .github/workflows/fetch-alma-errata.yml
@shino shino requested a review from Copilot July 6, 2026 03:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread .github/workflows/fetch-alma-errata.yml
Comment thread .github/workflows/fetch-alma-errata.yml
Comment thread .github/workflows/fetch-alma-errata.yml

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread .github/workflows/fetch-alma-errata.yml
Comment thread .github/workflows/fetch-alma-errata.yml
Comment thread .github/workflows/fetch-alma-errata.yml
@shino shino requested a review from Copilot July 6, 2026 04:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread .github/workflows/fetch-alma-errata.yml
Comment thread .github/workflows/fetch-alma-errata.yml
Comment thread .github/workflows/fetch-alma-errata.yml

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@shino shino requested a review from MaineK00n July 6, 2026 05:12
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.

2 participants