Skip to content

Optional builds for PR validation - #2449

Open
Chris Blank (ChrisBlankDe) wants to merge 8 commits into
microsoft:mainfrom
ChrisBlankDe:optionalPatternForPrValidation
Open

Chris Blank (ChrisBlankDe) wants to merge 8 commits into
microsoft:mainfrom
ChrisBlankDe:optionalPatternForPrValidation

Conversation

@ChrisBlankDe

@ChrisBlankDe Chris Blank (ChrisBlankDe) commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

❔What, Why & How

The new optionalPatternsForPrValidation setting (default []) lets PTE and AppSource repositories make selected build-matrix failures non-blocking for the aggregate Pull Request Status Check, including merge-group runs.

Case-insensitive PowerShell wildcard patterns match full GitHub job names. Eligible names must also match Build * (*) / * (*); custom jobs following this convention also qualify. Optional failures emit warnings, while other failed jobs remain blocking. Individual optional jobs and the workflow run can still be red, so rulesets should require the aggregate check.

The StatusCheck job checks out the build ref and reads settings. The action consumes Settings directly and exposes failedOptionalJobs as a JSON array of failed optional job names ([] when none qualify). Later steps can consume it, or a job can expose it as a job output. The output is also written when required failures cause the check to fail.

Update AL-Go system files to use the new workflow wiring.

Related to issue: #2298

✅ Checklist

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

- Updated PullRequestHandler.yaml in both AppSource and Per Tenant Extension templates to include a checkout step with LFS support and read settings using the AL-Go-Actions.
- Modified PullRequestStatusCheck action to accept optional patterns for PR validation, improving flexibility in handling build failures.
- Expanded tests in PullRequestStatusCheck.Test.ps1 to cover scenarios for optional build failures and their handling.
- Enhanced ReadSettings.Action.Test.ps1 to include tests for optional patterns in settings, ensuring they are correctly processed and merged from various sources.
- Added new tests in ReadSettings.Test.ps1 to validate the default behavior of optional patterns and their merging logic from organization and repository settings.
microsoft#2298
@ChrisBlankDe
Chris Blank (ChrisBlankDe) marked this pull request as ready for review November 10, 2026 16:23
@ChrisBlankDe
Chris Blank (ChrisBlankDe) requested a review from a team as a code owner November 10, 2026 16:23
Copilot AI balanced review requested due to automatic review settings November 10, 2026 16:23

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.

🟢 Approval recommended

No active review issues block approval of the configurable optional PR build checks.

No open issues 🎉

What changed in this PR

Adds configurable optional build failures to AL-Go’s aggregate Pull Request Status Check for PTE and AppSource repositories, including merge-queue validation. All builds remain required by default.

Changes:

  • Adds optionalPatternForPrValidation with wildcard matching restricted to eligible build-job names.
  • Wires settings into both PR workflow templates and reports matching failures as non-blocking warnings.
  • Adds validation and settings tests, usage documentation, and release notes.
File Description
Tests/​ReadSettings.Test.ps1 Tests defaults, schema, merging, and empty-array overrides.
Tests/​ReadSettings.Action.Test.ps1 Tests optional-pattern exports through the settings action.
Tests/​PullRequestStatusCheck.Test.ps1 Tests optional failures, required jobs, matching, and invalid inputs.
Templates/​Per Tenant Extension/​.github/​workflows/​PullRequestHandler.yaml Reads settings and passes patterns to the aggregate check.
Templates/​AppSource App/​.github/​workflows/​PullRequestHandler.yaml Adds equivalent settings wiring for AppSource repositories.
Scenarios/​settings.md Documents configuration, matching rules, and branch-protection implications.
RELEASENOTES.md Announces optional PR builds and the required system-file update.
Actions/​PullRequestStatusCheck/​README.md Documents the new action input and behavior.
Actions/​PullRequestStatusCheck/​PullRequestStatusCheck.ps1 Validates patterns and separates optional from required failures.
Actions/​PullRequestStatusCheck/​action.yaml Declares and forwards the JSON patterns input.
Actions/​.Modules/​settings.schema.json Defines the setting as a string array with an empty default.
Actions/​.Modules/​ReadSettings.psm1 Adds the empty-array runtime default.

Review effort: Balanced

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.

🟡 Changes recommended

Making Settings mandatory breaks existing PullRequestHandler workflows because their StatusCheck jobs do not receive initialization settings, causing aggregate checks to fail even when optional builds are not enabled.

1 open issue

Review effort: Balanced

Comment thread RELEASENOTES.md Resolved

This branch has not been deployed

No deployments
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.

3 participants