Add DAG-based hook scheduling with group and after#1704
Draft
drichardson wants to merge 6 commits intoj178:masterfrom
Draft
Add DAG-based hook scheduling with group and after#1704drichardson wants to merge 6 commits intoj178:masterfrom
group and after#1704drichardson wants to merge 6 commits intoj178:masterfrom
Conversation
Introduce two new optional config fields — `group` and `after` — that let users express a DAG of hook dependencies. prek builds the DAG, schedules maximally parallel execution, and only serializes where explicit edges exist. - `group: string` labels a hook so others can depend on the entire group - `after: [hook-id]` or `after: [group:name]` creates dependency edges - `priority` and `group`/`after` are mutually exclusive on the same hook - Cycle detection via Kahn's algorithm with clear error messages - Backwards compatible: priority-based scheduling unchanged when no hooks use `group`/`after` Assisted by AI Co-Authored-By: Claude <noreply@anthropic.com>
Assisted by AI Co-Authored-By: Claude <noreply@anthropic.com>
Assisted by AI Co-Authored-By: Claude <noreply@anthropic.com>
Assisted by AI Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Author
|
oops, didn't mean to request a review on this yet |
Assisted by AI Co-Authored-By: Claude <noreply@anthropic.com>
Assisted by AI Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1704 +/- ##
==========================================
+ Coverage 91.43% 91.62% +0.18%
==========================================
Files 96 96
Lines 18892 19235 +343
==========================================
+ Hits 17274 17624 +350
+ Misses 1618 1611 -7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
📦 Cargo Bloat ComparisonBinary size change: +0.00% (23.9 MiB → 23.9 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
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
groupandafter— that let users express a DAG of hook dependenciesprioritycontinues to work unchanged;priorityandgroup/afterare mutually exclusive on the same hookdocs/proposals/dag-scheduling.mdfor the full designTest plan
cargo buildcompilesrun_in_non_git_repounrelated to this change)priority_fail_fast_stops_later_groups,priority_group_modified_files_is_group_failure_and_output_is_indented) pass unchangedcargo clippyandcargo fmtclean🤖 Assisted by Claude Code