fix(rules): Detect include/exclude pattern changes#7
Merged
Conversation
commit: |
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds functionality to detect when include/exclude pattern rules change in the configuration and trigger a re-sync accordingly. The implementation adds a rulesSha256 field to track a hash of normalized include/exclude patterns, compares this hash against the lock file, and displays appropriate status messages when only rules have changed.
Changes:
- Added
rulesSha256optional field to lock source entries for tracking include/exclude pattern changes - Implemented hash computation of normalized (trimmed, deduplicated, sorted) include/exclude patterns
- Modified sync status logic to detect rule changes and mark sources as "changed" when rules differ
- Updated output formatting to display "rules changed" message when only rules change without commit updates
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lock.ts | Added optional rulesSha256 field to lock source interface and validation logic |
| src/sync.ts | Implemented rules hash computation, integrated into sync plan status checks, and updated lock building and output printing |
| tests/sync-include-exclude.test.js | Added test verifying re-materialization when include patterns change |
| tests/sync-output.test.js | Added test case for rules-changed output formatting |
| tests/lock.test.js | Added assertion to verify rulesSha256 field in lock fixture |
| tests/fixtures/docs.lock | Added rulesSha256 field to test fixture |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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
Detect when include/exclude rules change and trigger re-sync.
Changes
rulesSha256field to track include/exclude patterns