feat(api): GET /api/v1/public/pulls, Longshot's open PRs with BigBean authors and approved heads #90
No reviewers
Labels
No labels
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
priority
critical
priority
high
priority
low
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Beanstalk!90
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/Beanstalk:feat/public-pulls"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Longshot Launcher is getting pull request builds and must warn more strongly about a PR that neither a BigBean wrote nor the farm approved, but it has no Forgejo token and Forgejo hides its teams from anonymous readers. This gives it a public, read-only answer from the coordinator, which already knows both.
What changed
GET /api/v1/public/pulls(newcoordinator/beanstalk/public.py, registered beside the other/api/v1routes): no token, no session,Cache-Control: public, max-age=60.pulls: the open PRs fromdashboard.open_prs(Forgejo's list, already kept a minute; 503 when Forgejo never answered), newestupdated_atfirst, heads that are not 40 lowercase hex left out.author_bigbean:farm.is_maintainer(author), once per distinct author, at most 4 checks at a time, kept 10 minutes per login (false too). A Forgejo error on a login is false for that answer and not kept.approved:commit_tier(live approvals of the head, commits.sensitive) != untrusted, read for every head in two queries (= ANY(%s)). A new push, a revoke or a head the farm never saw is false;approved_byis the distinct live approvers, sorted.Farm), so many launchers cost one computation./api/paths already skip the viewer middleware (auth.NO_SESSION) and answer errors as plain text; the security headers apply as on every response.docs/protocol.md, "Public".Testing
coordinator/tests/test_public_pulls.py(7 tests): the shape and headers, open PRs only and their order,author_bigbeanfrom the fake Forgejo's teams and its caching, a Forgejo error on one login, approved for an approved head and not after a new push or a revoke, a sensitive commit with one then two approvals, a head the farm never saw, and 503 when Forgejo is down. The client runs with sign-in set up and sends no token or cookie.pytest -qincoordinator/(Docker Postgres):564 passed, 1 skipped.Nothing shows on screen, so no screenshots.
🤖 Generated with Claude Code