Skip to content

Add support for importantSettings to override lower priority settings#2293

Open
ChrisBlankDe wants to merge 6 commits into
microsoft:mainfrom
ChrisBlankDe:importantSettings
Open

Add support for importantSettings to override lower priority settings#2293
ChrisBlankDe wants to merge 6 commits into
microsoft:mainfrom
ChrisBlankDe:importantSettings

Conversation

@ChrisBlankDe

@ChrisBlankDe ChrisBlankDe commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

❔What, Why & How

This pull request introduces a new importantSettings mechanism that allows you to protect specific settings from being overridden by lower-priority sources in the AL-Go settings hierarchy. The implementation ensures that settings marked as important can only be overridden by lower-priority sources if those sources also explicitly mark the same setting as important. This applies to both standard and conditional settings, and integrates with the existing overwriteSettings mechanism. Documentation and schema files are updated to reflect this new feature.

Important settings protection:

  • Added support for an importantSettings array in settings files, enabling top-level settings to be protected from non-important overrides by lower-priority sources. The merging logic in MergeCustomObjectIntoOrderedDictionary was updated to enforce this rule for both direct and conditional settings, and to ensure that array settings are always merged. [1] [2] [3] [4]

Schema and documentation updates:

  • Updated settings.schema.json to add the importantSettings property and clarified the behavior of overwriteSettings when important settings are involved. [1] [2] [3] [4]
  • Added detailed explanations, examples, and usage notes for importantSettings in RELEASENOTES.md and Scenarios/settings.md. [1] [2]

Other improvements:

  • Added importantSettings to the default settings returned by GetDefaultSettings.
  • Minor parameter and comment cleanups for consistency in PowerShell scripts. [1] [2] [3] [4]

These changes make it easier to enforce organization- or repository-level settings and prevent accidental overrides from lower-priority sources, while maintaining flexibility for advanced scenarios.

Related to issue: #

✅ Checklist

  • Add tests (E2E, unit tests)
  • Update RELEASENOTES.md
  • Update documentation (e.g. for new settings or scenarios)
  • Add telemetry

@ChrisBlankDe ChrisBlankDe marked this pull request as ready for review June 26, 2026 13:53
@ChrisBlankDe ChrisBlankDe requested a review from a team as a code owner June 26, 2026 13:53
Copilot AI review requested due to automatic review settings June 26, 2026 13:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 an importantSettings mechanism to AL-Go’s settings merge logic so selected settings can be “protected” during multi-source settings resolution, and documents the new behavior across schema + docs + release notes with accompanying Pester tests.

Changes:

  • Extend settings merge logic to recognize an importantSettings list and prevent overriding of protected (non-array) settings.
  • Add Pester tests covering important setting protection, interaction with arrays/overwriteSettings, and conditional settings.
  • Update schema and documentation (settings.md, RELEASENOTES.md) to describe the new setting and expected behavior.

Reviewed changes

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

Show a summary per file
File Description
Actions/.Modules/ReadSettings.psm1 Implements important-setting tracking in the merge pipeline.
Actions/.Modules/settings.schema.json Adds importantSettings to the settings schema with defaults/description.
Tests/ReadSettings.Test.ps1 Adds test coverage for the important-setting merge semantics.
Scenarios/settings.md Documents importantSettings behavior and examples.
RELEASENOTES.md Adds release note entry describing the new capability.

Comment thread Actions/.Modules/ReadSettings.psm1 Outdated
Comment thread Actions/.Modules/ReadSettings.psm1 Outdated
Comment thread Tests/ReadSettings.Test.ps1 Outdated
Comment thread Tests/ReadSettings.Test.ps1 Outdated
Comment thread Scenarios/settings.md Outdated
Comment thread RELEASENOTES.md
Comment thread Actions/.Modules/settings.schema.json Outdated
@ChrisBlankDe ChrisBlankDe marked this pull request as draft June 26, 2026 14:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 5 out of 5 changed files in this pull request and generated 6 comments.

Comment thread Actions/.Modules/ReadSettings.psm1
Comment thread Actions/.Modules/ReadSettings.psm1
Comment thread Actions/.Modules/ReadSettings.psm1
Comment thread Actions/.Modules/ReadSettings.psm1
Comment thread Tests/ReadSettings.Test.ps1 Outdated
Comment thread Tests/ReadSettings.Test.ps1
@ChrisBlankDe ChrisBlankDe marked this pull request as ready for review June 29, 2026 13:34
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