Skip to content

Make it possible for a rule to override back to default#46

Merged
eiriksm merged 9 commits into
mainfrom
fix/override-back
Apr 7, 2026
Merged

Make it possible for a rule to override back to default#46
eiriksm merged 9 commits into
mainfrom
fix/override-back

Conversation

@eiriksm

@eiriksm eiriksm commented Apr 1, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Enables later package-matching rules to override earlier rules back to the default value, while still preventing rules from overriding globally configured (non-default) settings.

Changes:

  • Updated Config::getConfigForPackage() to apply matching rule config keys in-order, allowing later rules to override earlier ones except for keys set globally to non-default values.
  • Added PHPUnit coverage to verify rule ordering behavior and to ensure rules cannot override global security_updates_only or bundled_packages.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
tests/RuleObjectConfigTest.php Adds tests for rule precedence and ensuring global config is not overridden by rules.
src/Config.php Changes per-package rule application logic to allow “reset to default” via later rules while protecting global non-default keys.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Config.php Outdated
Comment thread src/Config.php Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Config.php
Comment thread src/Config.php Outdated
Comment thread src/Config.php

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Config.php Outdated
Comment thread src/Config.php

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Config.php
Comment thread src/Config.php
@eiriksm eiriksm merged commit 99a0133 into main Apr 7, 2026
18 checks passed
@eiriksm eiriksm deleted the fix/override-back branch April 7, 2026 20:07
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