Skip to content

fix(rules): Detect include/exclude pattern changes#7

Merged
fbosch merged 2 commits intomasterfrom
fix/handle-include-exclude-changes
Jan 31, 2026
Merged

fix(rules): Detect include/exclude pattern changes#7
fbosch merged 2 commits intomasterfrom
fix/handle-include-exclude-changes

Conversation

@fbosch
Copy link
Copy Markdown
Owner

@fbosch fbosch commented Jan 31, 2026

Summary

Detect when include/exclude rules change and trigger re-sync.

Changes

  • Add rulesSha256 field to track include/exclude patterns
  • Compute hash of normalized include/exclude patterns
  • Trigger "changed" status when rules differ from lock
  • Display "rules changed" message for rules-only updates

Copilot AI review requested due to automatic review settings January 31, 2026 17:26
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jan 31, 2026

Open in StackBlitz

npx https://pkg.pr.new/fbosch/docs-cache@7

commit: 63aaf2f

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 rulesSha256 optional 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.

Comment thread src/sync.ts Outdated
Comment thread src/sync.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@fbosch fbosch merged commit d3e599a into master Jan 31, 2026
3 checks passed
@fbosch fbosch deleted the fix/handle-include-exclude-changes branch January 31, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants