Skip to content

feat(ci): surface archive-sync failures in PR body#275

Open
ronaldtse wants to merge 1 commit into
v5from
fix/archive-sync-reporting
Open

feat(ci): surface archive-sync failures in PR body#275
ronaldtse wants to merge 1 commit into
v5from
fix/archive-sync-reporting

Conversation

@ronaldtse

Copy link
Copy Markdown
Contributor

Problem

The archive-sync workflow runs weekly (Wed 2am UTC) and creates automated PRs when it adds archive.org mirrors to formulas. The PR body previously said only:

Automated archive.org mirror sync.

  • Chunks processed: N
  • Registry: process/archive_registry.yml
  • Formula updates: archive mirrors added/replaced

No detail about WHICH URLs succeeded or failed. Same failure mode as issue #225 had with formula-health.

Solution

Applies the same 3-layer pattern from PR #270 (formula-health reports):

Layer 1 — CHECKER (archive_fonts.rb)
  archive subcommand gains --json-output (appends JSONL records per URL)
  Each record: { url, formula, started_at, status, archive_url, error, completed_at }

Layer 2 — AGGREGATOR (new: archive_fonts.rb report subcommand)
  Reads all chunk-*.jsonl files
  Maps URLs back to formula paths
  Produces results/archive.json in render_report-compatible schema

Layer 3 — PUBLISHER (archive-sync.yml collect job)
  Runs render_report.rb on results/
  Embeds reports/pr-comment.md in the PR body via create-pull-request

Before / After

Before — PR body:

Automated archive.org mirror sync.
- Chunks processed: 12
- Registry: process/archive_registry.yml
- Formula updates: archive mirrors added/replaced

After — PR body includes the formatted report:

## ❯ Fontist formula checks: FAIL

| Check | Scope | Result |
|-------|-------|--------|
| archive | full · 150 items | ❌ 3 failed |

URLs — 3 failures
| Formula | Detail |
|---------|--------|
| `font_X` | https://...broken-url... · archive.org timeout |
| `font_Y` | https://...other-url... · submission returned no URL |
...

---

Automated archive.org mirror sync.
- Chunks processed: 12
...

Files

Modified:

  • process/archive_fonts.rbarchive subcommand gains --json-output; new report subcommand aggregates JSONL
  • .github/workflows/archive-sync.yml — each chunk writes JSONL, collect job runs report + render_report.rb, PR body includes formatted output

Test coverage

Smoke-tested locally with 3-record JSONL fixture:

  • 1 newly archived URL → counted as passed
  • 1 already-archived URL → counted as warning (skipped submission)
  • 1 failed URL → counted as failure, rendered in failure section

Output verified: render_report.rb consumes the JSON and produces correct pr-comment.md with summary table + failure details.

Depends on

PR #270 (merged) — render_report.rb in .github/scripts/ and the unified JSON schema.

The archive-sync workflow creates automated PRs when it adds
archive.org mirrors to formulas. Previously the PR body said only
'Chunks processed: N' with no detail about WHICH URLs succeeded
or failed.

Same pattern as the formula-health reporting fix (PR #270):
  Layer 1: archive_fonts.rb archive subcommand gains --json-output
           (appends JSONL records per URL)
  Layer 2: new archive_fonts.rb report subcommand aggregates JSONL
           into the unified results schema
  Layer 3: collect job in archive-sync.yml runs render_report.rb
           and embeds the formatted markdown in the PR body

The PR body now shows a summary table (total/passed/failed/skipped)
and a failure section listing each broken URL + its formula + the
error message — same quality as the formula-health issue body.

Smoke-tested locally with sample JSONL: 3 URLs (1 newly archived,
1 already archived as warning, 1 failed) produces correct summary
and rendered markdown.
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.

1 participant