Skip to content

fix(changelog): robust, visible PR-number resolution (0202) - #191

Merged
crs48 merged 6 commits into
mainfrom
claude/changelog-pr-robustness
Jun 18, 2026
Merged

fix(changelog): robust, visible PR-number resolution (0202)#191
crs48 merged 6 commits into
mainfrom
claude/changelog-pr-robustness

Conversation

@crs48

@crs48 crs48 commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Summary

Implements exploration 0202 — makes changelog PR-number resolution robust and visible without adding a second commit. (Supersedes the doc-only PR #190, which is folded in here.)

The investigation found PR linking wasn't actually broken — the deploy-time resolve-prs.mjs works — but it was fragile (regex over merge-commit subjects), silent on failure, and entries without screenshots looked bare. This hardens all three.

Robustness — resolve-prs.mjs + deploy

  • Authoritative API fallback: when the git-subject parse misses, resolve via the GitHub commits/{addSha}/pulls API (keyed by the fragment's adding commit) — merge-method-proof, so rebase-merges resolve too. Verified live: commits/4f413f61/pulls → #187.
  • Fail-loud: unresolved fragments now emit a ::warning annotation + summary line instead of silently shipping numberless. Never blocks the deploy (entries still render).
  • deploy-site.yml passes GITHUB_TOKEN to the step.

Authoring — new.mjs

  • --pr auto (default) bakes the PR number via gh pr view when the branch already has a PR — one commit, visible in the repo/previews/local. Omitted when no PR exists yet → the deploy resolves it. (--pr <N> / --pr none override.) This fragment was added that way.
  • Fixes the UTC-tomorrow date drift (stamps the local day).

UI — index.astro

Notably not done (a finding, not a gap)

  • The exploration suggested running resolve in the preview workflows. They build only apps/web, not the Astro site/, so the changelog page is never in previews — running resolve there would be dead code. Skipped to avoid useless pipeline surface.

Testing

  • resolve-prs.mjs resolves all current slug entries via git; API fallback verified live against the real endpoint.
  • new.mjs: local-date + graceful no-PR + bake-on---pr all smoke-tested.
  • site/ builds (70 pages); "View PR feat(cloud): metered AI through OpenRouter + spend cap (0201) #187" affordance present in the built changelog HTML.
  • Not eslint/prettier-gated (lint covers packages apps; format:check skips scripts/site), but formatted and syntax-checked anyway.

Exploration: docs/explorations/0202_..._CHANGELOG_PR_NUMBER_RESOLUTION_ROBUSTNESS.md (items checked off).

🤖 Generated with Claude Code

xNet Test and others added 4 commits June 17, 2026 22:16
resolve-prs.mjs now falls back to the GitHub 'commits → PRs' API (keyed by the
fragment's adding commit) when the git-subject parse misses — merge-method-proof,
so rebase-merges resolve too. Unresolved fragments emit a ::warning + summary line
instead of silently shipping bare. deploy-site passes GITHUB_TOKEN to the step.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…cal date

--pr auto (default) asks 'gh pr view' for the current branch's PR and writes it in
(one commit, visible in repo/previews/local); omitted when no PR exists yet → deploy
resolves it. Date now stamps the LOCAL day, fixing the UTC-tomorrow drift.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Server/docs PRs have no visual-capture gallery; render a clear 'View PR #N →' link
where the gallery would be so they don't read as broken. Refresh the stale
changelog.ts comment to describe the real author→deploy PR-number flow.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@crs48
crs48 temporarily deployed to pr-191 June 18, 2026 05:18 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

✓ Changelog fragment found — thanks!

…auto)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Preview removed for PR #191.

github-actions Bot added a commit that referenced this pull request Jun 18, 2026
Comment thread scripts/changelog/resolve-prs.mjs Fixed
new.mjs/resolve-prs.mjs are manually-run/deploy-time CLI scripts (not imported and
not unit-tested), so the unused-file + CRAP findings are noise — mirror the existing
examples/** and scripts/visuals/** exclusions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@crs48
crs48 temporarily deployed to pr-191 June 18, 2026 05:36 — with GitHub Actions Inactive
@crs48
crs48 merged commit f6fa2a4 into main Jun 18, 2026
11 checks passed
@crs48
crs48 deleted the claude/changelog-pr-robustness branch June 18, 2026 05:51
github-actions Bot added a commit that referenced this pull request Jun 18, 2026
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