Repository navigation
GitHub: the approval rule and blockers - #44
Merged
Merged
Conversation
Issue: #13 Red: domain/approval.ts and the new github.ts exports do not exist yet.
…arser out of github.ts Issue: #13 Addresses maintainability-1.
…ll blocks Issue: #13 Pins the rule testing-1 found untested: openBlockers resolves a row only on REST's exact lowercase `closed`, as softfac does. Passes at this tip.
rawphp
marked this pull request as ready for review
October 15, 2026 21:51
Author
|
Factory gate: passed (attempt 1, run by the factory in a fresh checkout of the pull request's head
|
…val in pure code - textBlockers resolves a named issue only on the exact REST state `closed`, as openBlockers does. - textBlockers refuses a Depends on section naming more than MAX_DEPENDS_ON (100) issues before reading any of them, so an issue body cannot fan out into thousands of gh calls. - dependsOn skips an owner or repo made only of dots, which would step out of the API path. - The approval judgement and textEditedSince's decision move into pure judgeApproval and editedSince in approvalHistory.ts, with unit tests; github.ts only reads the history. - The approval query's page sizes come from HISTORY_PAGE, and the two cut-off checks share isCutOff.
Author
|
Factory gate: passed again (attempt 2, run by the factory in a fresh checkout of the pull request's head
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #13
Contract
makeGitHubgainsapproval,textCheck,textEditedSince,openBlockersandtextBlockers, reading label events, renames and the body's edit history with softfac's approval GraphQL query byte for byte and the sameghargv; a puredependsOnparser for the## Depends onsection;domain/approval.tsholds theApproval,RefusalandTextChecktypes and the purerefusalReasonandunapprovedCommentwith softfac's exact wording. softfac's tracker-level tests are ported.activity_since,mover,ready_by,pr_feedback; Linear; every upstream file.src/github.rsinstead of the runner "start:" sections;textCheckandtextEditedSinceship here; the refusal comment is a pure domain function.vp test run apps/server/src/factory/tracker apps/server/src/factory/domain→ pass (279 tests, 7 files)Acceptance criteria
factory:ready, then every body edit and title rename at or after that moment; same second counts as after; onlyUseractors; logins match without regard to case; approved or one of the four fixed refusals —tracker/github.test.ts"approval reads the real shapes and sends one call", "an edit in the same second as the label counts as after it", "a rename in the same second as the label counts as after it", "a label applied by an actor that is not a user is refused whatever its login", "the instructor comparison ignores case", "a hundred events of a longer history without the label is incomplete"; wording indomain/approval.test.ts"is softfac's literal comment for an edit after the label" and "for a history that is too long".tracker/approvalHistory.test.ts"the approval query is softfac's, byte for byte"; argv in the ported delegation tests ("makeGitHub approval sends one graphql call", "makeGitHub text check sends one graphql call per check").blockedBylinks; otherwise each#nandowner/repo#nunder## Depends onup to the next heading that is still open; an unreadable blocker is an error —tracker/github.test.ts"open blockers keep the repo they are in", "text blockers are the named issues that are not closed", "a named issue that cannot be read is an error, not a resolved blocker", "an open blocker whose repo is unknown is an error, not a guess";domain/dependsOn.test.ts(the 13depends_on_*cases).approval_*and the rest of softfac's approval section,text_check_*,text_edited_since_*, theopen_blockersblock,text_blockers_*,depends_on_*, and the two "Issues impl for GitHub" delegation tests forapprovalandtext_check. Not ported:unchanged_since_is_the_text_check_said_unchanged(its subject,unchanged_since, is not shipped); the otherunchanged_since_*cases were ported astextCheckcases because they pin shared cut-off rules.Gate
factory/scripts/check.sh→ exit 0 (.factory/gate-1.log: seams clean;vp test run apps/server/src/factory670 passed in 24 files;vp run --filter t3 typecheck0 errors;vp run --filter @t3tools/web typecheck0 errors)Models
modelsblock in.dw/config.yml; Tom's roster)Review
docs/issues.mdprose asks nothing the code does differently; security approved; maintainability-1 (pure logic left ingithub.ts, file over 1k lines) →refactor:commit splittingtracker/approvalHistory.tsanddomain/dependsOn.ts.openBlockershad no test for a state that is neitheropennorclosed) →test:commit pinning softfac's exact rule (only the lowercaseclosedresolves a blocker).approvalHistory.tsare covered only throughmakeGitHub; all 11 kills came from those tests.github.tsis 1170 lines after the split; the remaining size is pre-existingghcalls this issue did not touch.Notes
The worktree the factory launched was cut from a stale
main; it was fast-forwarded toorigin/main(465a1e5) at Isolate, clean tree.No labels created: all seven
factory:*labels exist on the repo.Red phase verified: with the product files at the
test:commit, 90 of the ported tests fail; all pass at thefeat:tip.Two differences from the Rust that the tests cannot see: an issue number above 2^53 in
## Depends onis skipped (JS safe integers), and the## Depends onheading match usestoLowerCase(), which differs fromeq_ignore_ascii_caseonly for non-ASCII headings.The first
gh pr createwithout--repoopened the draft on the fork's parent, GitHub: the approval rule and blockers pingdotgg/t3code#20040; it was closed within a minute with a comment and recreated here. Nothing else was written to the upstream repo.Lessons
timeoutin a reviewer packet on macOS. Symptom: the mutating reviewer reportstimeoutis not installed and bounds each run by the tool's own limit instead. Cause: the packet's example command used GNU coreutils'timeout, which macOS lacks. Default: say "bounded by the tool's timeout" or give a portable form (perl -e 'alarm 120; exec @ARGV' -- …), and keep one mutant per command so a hang costs one call.gh pr createneeds--repoand--head. Symptom: the draft pull request opens on the upstream repository the fork was made from, not on the fork. Cause:ghresolves a fork's parent as the default repository for pull requests. Default: at Ship, always pass--repo <owner/repo from the issue>and--head <branch>, and read the URL back before linking or reporting it; if it names another repo, close it with a comment at once and recreate.Commits
34cd4d6c1test(factory): port softfac's approval, text check and blocker tests— Make slice (red)f82bda835feat(factory): the approval rule, text checks and blockers over gh— Make slice (green; also a two-line lint fix in the ported tests)072e64cb0refactor(factory): split the pure approval judgement and Depends on parser out of github.ts— Check cycle 1f96097b2etest(factory): a blocker in a state other than the exact \closed` still blocks` — Check cycle 2Files
gh-calling methods andBlockerApproval,Refusal,TextCheck,refusalReason,unapprovedComment## Depends onparser