perf(website): the progress feed lists pull requests through the issues API, which runs no git, and only closed items from the last 90 days #2376

Merged
HumanBean merged 1 commit from HumanBean/Longshot:perf/progress-feed-issues-api into main 2026-11-23 20:40:54 +00:00
Owner

Summary

The website's progress feed (website/src/lib/progress-feed.ts) runs on every website build: hourly, on docs pushes,
and in pull requests' "Website build and checks". It listed pull requests through Forgejo's /repos/{repo}/pulls,
which runs git for every pull request on a page (diff stats and mergeability). Fork PRs whose branch is gone make
that git call fail, which is the ~40k GetShortStat ... ambiguous argument '' errors a day. The feed paged it back
through 90 days of closed PRs, 21+ pages a build. On 2026-11-23, 54 of the forge's 59 slow requests in 3 minutes
were these listings
, from the runners on two addresses, while the forge was already short of CPU.

The feed now lists pull requests through /issues?type=pulls, which runs no git. It takes merged_at and draft from
the issue's pull_request field, so statuses and /pulls/N links don't change. The closed lists of issues and pull
requests pass since= the start of the 90-day window, and the client still checks the dates. A page asks for 50
items, Forgejo's MAX_RESPONSE_ITEMS; the old limit=100 was clamped to that anyway. A pull request without a
pull_request object fails the whole collection, so a partial feed is never published.

Read first: website/src/lib/progress-feed.ts, list() and the loop under it.

Testing

Tested: checked the request shapes against git.magicbean.dev (Forgejo 17.0.2):

  • issues?type=pulls returns pull_request {merged, merged_at, draft, html_url}. Closed-unmerged PRs have
    merged_at: null, and WIP: PRs have draft: true.
  • sort=recentupdate orders by updated_at.
  • since= with a toISOString() timestamp narrows the result (48 against 1048 for a 5-hour window).
  • /settings/api gives max_response_items: 50.

website/tests/progress.test.ts is updated: PRs come through the issues endpoint with merged and draft mapped,
since= is on the closed lists only, no request goes to /pulls, and a PR without pull_request fails the build.
Nothing runs in the game, and nothing was run on this PC. CI's "Website build and checks" passed on the head: it
builds the site, with the feed collected live from the forge through the new requests, and runs these tests.

Still to test: None

Measurements

Verdict: the feed no longer calls /pulls, so the forge runs no git for the PRs it lists. It used to page about
22 /pulls pages a build. Wall-clock timings of single pages on the live forge were too noisy to compare: 0.5 to 22 s
for both endpoints while the forge was loaded. The count of slow requests above is the measurement.

Before: main @ d02cac0f After: this PR @ f6a32f7c
/pulls pages per feed build ~22 (closed and open) 0
git per listed PR diff shortstat and mergeability none
Closed items the server returns all, filtered on the client the last 90 days (since=)

Risks

If a later Forgejo dropped pull_request from issue objects, the collection would fail as a whole and the deployed
snapshot would stay; it would not publish wrong statuses. A revert is enough. Players see nothing different.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named). (The website's tests, in CI's "Website build and checks", passed. "Guide screenshots" fails on main too, from menu source changes elsewhere: runs 53673, 53679 and 53687.)
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A check under tests/ that reads changed source is updated, not weakened. (website/tests/progress.test.ts.)
  • Docs updated. (website/PROGRESS.md.)
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary The website's progress feed (`website/src/lib/progress-feed.ts`) runs on every website build: hourly, on docs pushes, and in pull requests' "Website build and checks". It listed pull requests through Forgejo's `/repos/{repo}/pulls`, which runs git for every pull request on a page (diff stats and mergeability). Fork PRs whose branch is gone make that git call fail, which is the ~40k `GetShortStat ... ambiguous argument ''` errors a day. The feed paged it back through 90 days of closed PRs, 21+ pages a build. On 2026-11-23, **54 of the forge's 59 slow requests in 3 minutes were these listings**, from the runners on two addresses, while the forge was already short of CPU. The feed now lists pull requests through `/issues?type=pulls`, which runs no git. It takes `merged_at` and `draft` from the issue's `pull_request` field, so statuses and `/pulls/N` links don't change. The closed lists of issues and pull requests pass `since=` the start of the 90-day window, and the client still checks the dates. A page asks for 50 items, Forgejo's `MAX_RESPONSE_ITEMS`; the old `limit=100` was clamped to that anyway. A pull request without a `pull_request` object fails the whole collection, so a partial feed is never published. Read first: `website/src/lib/progress-feed.ts`, `list()` and the loop under it. ## Testing **Tested:** checked the request shapes against git.magicbean.dev (Forgejo 17.0.2): - `issues?type=pulls` returns `pull_request {merged, merged_at, draft, html_url}`. Closed-unmerged PRs have `merged_at: null`, and `WIP:` PRs have `draft: true`. - `sort=recentupdate` orders by `updated_at`. - `since=` with a `toISOString()` timestamp narrows the result (48 against 1048 for a 5-hour window). - `/settings/api` gives `max_response_items: 50`. `website/tests/progress.test.ts` is updated: PRs come through the issues endpoint with merged and draft mapped, `since=` is on the closed lists only, no request goes to `/pulls`, and a PR without `pull_request` fails the build. Nothing runs in the game, and nothing was run on this PC. CI's "Website build and checks" passed on the head: it builds the site, with the feed collected live from the forge through the new requests, and runs these tests. **Still to test:** None ## Measurements **Verdict:** the feed no longer calls `/pulls`, so the forge runs no git for the PRs it lists. It used to page about 22 `/pulls` pages a build. Wall-clock timings of single pages on the live forge were too noisy to compare: 0.5 to 22 s for both endpoints while the forge was loaded. The count of slow requests above is the measurement. | | Before: main @ d02cac0f | After: this PR @ f6a32f7c | |---|---|---| | `/pulls` pages per feed build | ~22 (closed and open) | 0 | | git per listed PR | diff shortstat and mergeability | none | | Closed items the server returns | all, filtered on the client | the last 90 days (`since=`) | ## Risks If a later Forgejo dropped `pull_request` from issue objects, the collection would fail as a whole and the deployed snapshot would stay; it would not publish wrong statuses. A revert is enough. Players see nothing different. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). (The website's tests, in CI's "Website build and checks", passed. "Guide screenshots" fails on `main` too, from menu source changes elsewhere: runs 53673, 53679 and 53687.) - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A check under `tests/` that reads changed source is updated, not weakened. (`website/tests/progress.test.ts`.) - [x] Docs updated. (`website/PROGRESS.md`.) - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [x] Everything in Still to test has run, its results in Tested. - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
perf(website): the progress feed lists pull requests through the issues API, which runs no git, and only closed items from the last 90 days
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
Website / Website on Cloudflare (pull_request_target) Has been skipped
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 12s
Third-party parts / As their notes say (pull_request) Successful in 14s
CI / Website build and checks (pull_request) Successful in 1m15s
PR description / Description follows the template (pull_request_target) Successful in 5s
f6a32f7c59
Forgejo's /pulls runs git for every pull request in a page (diff stats,
mergeability; ~40k GetShortStat errors a day for fork PRs whose branch is
gone). The feed paged it through 90 days of closed PRs, 21+ pages, on every
website build: hourly, on docs pushes and in PR CI. On 2026-11-23, 54 of the
forge's 59 slow requests in 3 minutes were these listings. The feed now uses
issues?type=pulls, taking merged_at and draft from the issue's pull_request
field, and passes since= on the closed lists. 50 a page: Forgejo's
MAX_RESPONSE_ITEMS, which the old limit=100 was clamped to anyway.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member

Possibly related, for context:

  • PR #2034 fix(website): the progress feed's requests allow 120 s, so a busy forge's pull request list no longer stops the deploy — Earlier fix raised timeout for slow progress-feed PR listings; this removes their git-heavy API path.
  • PR #258 fix(website): recover progress collection and reject broken deployments — Prior progress-feed recovery and publication safeguards; this changes the collection strategy.
Possibly related, for context: - PR #2034 fix(website): the progress feed's requests allow 120 s, so a busy forge's pull request list no longer stops the deploy — Earlier fix raised timeout for slow progress-feed PR listings; this removes their git-heavy API path. - PR #258 fix(website): recover progress collection and reject broken deployments — Prior progress-feed recovery and publication safeguards; this changes the collection strategy.
HumanBean changed title from WIP: perf(website): the progress feed lists pull requests through the issues API, which runs no git, and only closed items from the last 90 days to perf(website): the progress feed lists pull requests through the issues API, which runs no git, and only closed items from the last 90 days 2026-11-23 17:15:20 +00:00
HumanBean deleted branch perf/progress-feed-issues-api 2026-11-23 20:40:55 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2376
No description provided.