Repository navigation
refactor(ci): extract pr-approval-timeline domain module - #753
Merged
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the incremental approval script by modularizing its components into separate files (approval-policy.js, git-range-diff.js, pr-approval-timeline.js, and range-diff-parser.js) and introduces a helper function verifyCodeOwnership. The reviewer identified two critical safety improvements: adding a pagination limit to the timeline event fetching to prevent infinite loops and ensuring that failures in calculating commit line deltas throw an error rather than silently returning a zero delta, which prevents potentially unsafe auto-reapprovals.
VLukiantsev
force-pushed
the
refactor/decompose-incremental-approval-modules
branch
from
September 3, 2026 10:49
3a31df7 to
7c262fc
Compare
VLukiantsev
changed the base branch from
main
to
refactor/ci-extract-approval-policy
September 3, 2026 10:49
VLukiantsev
marked this pull request as ready for review
September 3, 2026 11:13
VLukiantsev
force-pushed
the
refactor/decompose-incremental-approval-modules
branch
from
September 3, 2026 11:22
7c262fc to
70d2682
Compare
VLukiantsev
force-pushed
the
refactor/decompose-incremental-approval-modules
branch
from
September 3, 2026 12:55
70d2682 to
e43e8ba
Compare
VLukiantsev
force-pushed
the
refactor/decompose-incremental-approval-modules
branch
from
September 3, 2026 13:01
e43e8ba to
7e7e666
Compare
janzak-dev
previously approved these changes
Sep 3, 2026
VLukiantsev
force-pushed
the
refactor/decompose-incremental-approval-modules
branch
from
September 3, 2026 14:05
7e7e666 to
e43e8ba
Compare
VLukiantsev
disabled stacked auto-merge
September 3, 2026 14:22
janzak-dev
previously approved these changes
Sep 4, 2026
Base automatically changed from
refactor/ci-extract-approval-policy
to
refactor/ci-extract-git-range-diff
September 4, 2026 08:23
github-merge-queue
Bot
removed this pull request from the merge queue due to a manual request
Sep 4, 2026
VLukiantsev
changed the base branch from
refactor/ci-extract-git-range-diff
to
main
September 4, 2026 08:31
VLukiantsev
dismissed
janzak-dev’s stale review
September 4, 2026 08:31
The base branch was changed.
Extracts timeline event parsing, review dismissal tracking, GraphQL/REST timeline queries, and approval state resolution into .github/scripts/pr-approval-timeline.js with companion unit tests in pr-approval-timeline.test.js. Transforms .github/scripts/incremental-approval.js into a thin, focused orchestrator while preserving 100% backward compatibility via symbol re-exports. TAG=agy CONV=ced76c7b-e554-4b82-8631-a07a1a2f203d
VLukiantsev
force-pushed
the
refactor/decompose-incremental-approval-modules
branch
from
September 4, 2026 08:37
e43e8ba to
1c464df
Compare
janzak-dev
approved these changes
Sep 4, 2026
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.
Summary
Extracts GitHub review and timeline reconstruction logic from
.github/scripts/incremental-approval.jsinto.github/scripts/pr-approval-timeline.jswith comprehensive companion unit tests inpr-approval-timeline.test.js.Concludes the mechanical SRP modularization by transforming
.github/scripts/incremental-approval.jsinto a thin orchestrator while maintaining 100% backward compatibility by re-exporting all symbols.Motivation & Context
Decomposing the monolithic incremental approval script into focused domain modules isolates GitHub review timeline parsing from Git range-diff execution and approval policies.
Architectural Contract Compliance
incremental-approval.js.run().Key Changes
.github/scripts/pr-approval-timeline.jsexporting timeline event querying, event normalization, and approval state tracking..github/scripts/pr-approval-timeline.test.jscovering GraphQL/REST timeline parsing, manual vs automatic dismissal detection, and blocking change requests..github/scripts/incremental-approval.jsinto a lightweight orchestrator delegating to domain modules and re-exporting all interfaces.run()inincremental-approval.test.js.Assumptions
None — requirements were fully specified.
Verification & Testing
node --test .github/scripts/*.test.js(76/76 passing on this layer).Related Issues / Bugs
Part of Stack #782 (Layer 1 of 4). Builds on top of
main(following merged PRs #758, #759, #760). Follow-up Layer 2 is PR #768.TAG=agy
CONV=ced76c7b-e554-4b82-8631-a07a1a2f203d
Stack created with GitHub Stacks CLI • Give Feedback 💬