Repository navigation
Support repository custom properties in conditional settings - #2467
Open
Alex Richter (AlexanderRichter) wants to merge 7 commits into
Open
Alex Richter (AlexanderRichter) wants to merge 7 commits into
Alex Richter (AlexanderRichter) wants to merge 7 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Provide the workflow token to actions that re-read settings internally, preserving explicit GITHUB_TOKEN overrides. Cover project analysis, build matrix resolution, and action token wiring. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Provide a step-scoped token for telemetry settings reads and preserve explicit overrides. Cover authenticated custom-property evaluation and all action wrapper steps. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Capture the step-scoped token in the telemetry module before invoking action code and verify that it is removed from the process environment. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Alex Richter (AlexanderRichter)
requested a review
from a team
as a code owner
November 19, 2026 12:18
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The unconditional parent-directory helper import breaks both development-environment scripts in the flattened download layout, and custom-property lookups can succeed without valid authentication.
2 open issues
What changed in this PR
Adds repository custom-property conditions to AL-Go settings, allowing centrally managed GitHub metadata to select build, test, and deployment behavior.
Changes:
- Adds property matching, on-demand API retrieval, caching, and condition validation.
- Provides step-scoped authentication for settings reads and telemetry.
- Updates the schema, documentation, release notes, and regression tests.
| File | Description |
|---|---|
| Tests/TestActionsHelper.psm1 | Supports token wiring assertions. |
| Tests/TelemetryHelper.Test.ps1 | Covers telemetry token isolation and authenticated settings reads. |
| Tests/RunPipeline.Action.Test.ps1 | Checks nested-settings token wiring. |
| Tests/ReadSettings.Test.ps1 | Covers property matching, validation, caching, and failures. |
| Tests/ReadSettings.Action.Test.ps1 | Checks token input fallback. |
| Tests/IncrementVersionNumber.Action.Test.ps1 | Checks nested-settings token wiring. |
| Tests/DetermineProjectsToBuild.Test.ps1 | Covers authenticated project analysis and build matrices. |
| Tests/DetermineDeliveryTargets.Test.ps1 | Checks nested-settings token wiring. |
| Tests/DetermineArtifactsForRelease.Test.ps1 | Checks nested-settings token wiring. |
| Tests/Deliver.Action.Test.ps1 | Checks nested-settings token wiring. |
| Tests/CreateApp.Action.Test.ps1 | Checks nested-settings token wiring. |
| Tests/CheckForUpdates.Action.Test.ps1 | Checks nested-settings token wiring. |
| Scenarios/settings.md | Documents matching, authentication, caching, and upgrade requirements. |
| RELEASENOTES.md | Announces custom-property conditions and compatibility changes. |
| Actions/WorkflowPostProcess/action.yaml | Supplies a telemetry token. |
| Actions/WorkflowInitialize/action.yaml | Supplies a telemetry token. |
| Actions/VerifyPRChanges/action.yaml | Supplies a telemetry token. |
| Actions/ValidateWorkflowInput/action.yaml | Supplies a telemetry token. |
| Actions/Troubleshooting/action.yaml | Supplies a telemetry token. |
| Actions/TelemetryHelper.psm1 | Captures the scoped token for telemetry settings reads. |
| Actions/Sign/action.yaml | Supplies a telemetry token. |
| Actions/SetupBCQuality/action.yaml | Supplies a telemetry token. |
| Actions/RunTests/action.yaml | Supplies a telemetry token. |
| Actions/RunPipeline/action.yaml | Supplies a token for nested settings reads. |
| Actions/RunHook/action.yaml | Supplies a telemetry token. |
| Actions/ReviewAgent/action.yaml | Supplies a telemetry token. |
| Actions/ReadSettings/ReadSettings.ps1 | Passes the token to the settings resolver. |
| Actions/ReadSettings/README.md | Documents token inputs and property retrieval. |
| Actions/ReadSettings/action.yaml | Adds token input and fallback wiring. |
| Actions/ReadSecrets/action.yaml | Supplies a telemetry token. |
| Actions/ReadPowerPlatformSettings/action.yaml | Supplies a telemetry token. |
| Actions/PullRequestStatusCheck/action.yaml | Supplies a telemetry token. |
| Actions/PullPowerPlatformChanges/action.yaml | Supplies scoped tokens to action steps. |
| Actions/ProcessALCodeAnalysisLogs/action.yaml | Supplies a telemetry token. |
| Actions/PipelineCleanup/action.yaml | Supplies a telemetry token. |
| Actions/IncrementVersionNumber/action.yaml | Supplies a token for nested settings reads. |
| Actions/GetWorkflowMultiRunBranches/action.yaml | Supplies a telemetry token. |
| Actions/GetArtifactsForDeployment/action.yaml | Supplies a telemetry token. |
| Actions/DumpWorkflowInfo/action.yaml | Supplies a telemetry token. |
| Actions/DownloadProjectDependencies/action.yaml | Supplies tokens for telemetry and nested settings reads. |
| Actions/DownloadPreviousRelease/action.yaml | Supplies a telemetry token. |
| Actions/DetermineProjectsToBuild/action.yaml | Authenticates nested project settings reads. |
| Actions/DetermineDeploymentEnvironments/action.yaml | Supplies a telemetry token. |
| Actions/DetermineDeliveryTargets/action.yaml | Supplies a token for nested settings reads. |
| Actions/DetermineBuildProject/action.yaml | Supplies a telemetry token. |
| Actions/DetermineArtifactUrl/action.yaml | Supplies a telemetry token. |
| Actions/DetermineArtifactsForRelease/action.yaml | Supplies a token for nested settings reads. |
| Actions/DeployPowerPlatform/action.yaml | Supplies scoped tokens to action steps. |
| Actions/Deploy/action.yaml | Supplies a telemetry token. |
| Actions/Deliver/action.yaml | Supplies a token for nested settings reads. |
| Actions/CreateReleaseNotes/action.yaml | Supplies a telemetry token. |
| Actions/CreateDevelopmentEnvironment/action.yaml | Supplies a telemetry token. |
| Actions/CreateApp/action.yaml | Supplies a token for nested settings reads. |
| Actions/CompileApps/action.yaml | Supplies a token for nested settings reads. |
| Actions/CheckForUpdates/action.yaml | Authenticates settings reads during system-file updates. |
| Actions/CalculateArtifactNames/action.yaml | Supplies a telemetry token. |
| Actions/BuildReferenceDocumentation/action.yaml | Supplies a telemetry token. |
| Actions/BuildPowerPlatform/action.yaml | Supplies a telemetry token. |
| Actions/Authenticate/action.yaml | Supplies a telemetry token. |
| Actions/AnalyzeTests/action.yaml | Supplies a telemetry token. |
| Actions/AddExistingApp/action.yaml | Supplies a telemetry token. |
| Actions/.Modules/settings.schema.json | Defines conditional-setting structures and property allowlists. |
| Actions/.Modules/ReadSettings.psm1 | Implements property retrieval, caching, matching, and validation. |
Review effort: Balanced
Alex Richter (AlexanderRichter)
marked this pull request as draft
November 19, 2026 12:33
Support flattened development-script downloads and disable anonymous fallback for authenticated property requests. Add regression tests for both layouts and authentication failure paths. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Alex Richter (AlexanderRichter)
marked this pull request as ready for review
November 19, 2026 13:49
Alex Richter (AlexanderRichter)
marked this pull request as draft
November 19, 2026 13:50
Alex Richter (AlexanderRichter)
marked this pull request as ready for review
November 19, 2026 13:58
Author
|
@microsoft-github-policy-service agree company="MODUS Consult GmbH" |
This branch has not been deployed
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.


❔What, Why & How
Allow AL-Go conditional settings to match GitHub repository custom properties. This lets organizations use centrally managed repository metadata to select settings without maintaining lists of repository names.
Motivation and use cases
Organizations can classify repositories centrally by build profile, business unit, or product area using GitHub Custom Properties. AL-Go should be able to use that classification directly in organization-wide settings (
ALGoOrgSettings), instead of depending on repository naming conventions or duplicating configuration across repositories.GitHub manages the property definitions and allows organizations to delegate maintenance of repository values. This feature only reads that metadata; it does not create or modify properties or require organization-administration permissions solely for this functionality.
Configuration examples
For example, enable analyzers only for repositories with the
al-go-profileproperty set tostrict, and only on the specified branches:{ "ConditionalSettings": [ { "customProperties": { "al-go-profile": ["strict"] }, "branches": ["main", "release/*"], "settings": { "enableCodeCop": true, "enableUICop": true } } ] }An organization can also select a versioning strategy by business unit, while retaining its normal default for repositories that match neither rule:
{ "ConditionalSettings": [ { "customProperties": { "BusinessUnit": ["INDUSTRY"] }, "settings": { "versioningStrategy": 0 } }, { "customProperties": { "BusinessUnit": ["FOOD"] }, "settings": { "versioningStrategy": 3 } } ] }These are ordinary conditional settings overrides; existing merge order and
overwriteSettings/protectedSettingsbehavior are retained. The versioning example applies to normal CI/CD runs; pull-request builds enforce their own versioning strategy.Matching and implementation
The
customPropertiescondition maps property names to arrays of allowed values. All properties and other conditions in a block must match; values for one property are alternatives. Matching is case-insensitive, supports wildcard patterns and multi-select values, and does not match missing or null values.Property values are fetched on demand from the repository identified by
GITHUB_REPOSITORY, using the GitHub API URL and an authenticated, read-only token. Results are cached per API host and repository for the PowerShell process. API and authentication failures are surfaced rather than silently treated as missing values. Action and telemetry settings reads receive a step-scoped token; local callers may also provide a property map.The implementation extends the shared
ReadSettingspath and the settings schema, with corresponding action/token integration, unit tests, scenario documentation, and release notes. Repositories without applicable property conditions do not incur a property API request. Full owner/repository identity is retained for API requests while existing repository-name conditions continue using the short name.Scope and governance
There is no general expression language, script evaluation, property-writing capability, or automatic workflow trigger when a property changes. The cache is process-scoped, not a workflow-wide snapshot: separate processes and reruns may see updated values.
Changing repository metadata can change pipeline behavior without changing a commit. Organizations should therefore control who can edit these values according to the importance of the affected settings. Custom Properties are not secrets and do not replace environment approvals, rulesets, or token permissions. Enterprise API availability and fork-PR permission combinations are not claimed as live-validated by the reported PTE test.
Compatibility: Older AL-Go versions ignore unknown conditions. Upgrade all repositories consuming central conditional settings before adding
customProperties, otherwise those repositories may apply rules without the property restriction. This change also rejects unknown conditional keys rather than silently ignoring them; previously tolerated misspellings or unrecognized keys will now fail settings resolution. Property changes do not automatically regenerate materialized workflow settings such as schedules or concurrency.Related to issue: MODUS-TestALGO#1
✅ Checklist
The existing action telemetry is preserved and authenticated when its settings depend on custom properties. No custom-property values or new telemetry dimensions are added.
Validation
pwsh -NoLogo -NoProfile -Command 'Import-Module Pester -RequiredVersion 5.7.1 -ErrorAction Stop; & .\Tests\runtests.ps1 -Path Tests': 1,098 passed, 0 failed on Windows/PowerShell 7 (started before the final token-isolation change).TelemetryHelper.Test.ps1andReadSettings.Action.Test.ps1: 56 passed on each of Windows PowerShell 5.1 and PowerShell 7.409e05ceee340a452e17cd1ee249ca606d704c25: Windows PowerShell 5 and Linux PowerShell 7 unit tests passed; PSScriptAnalyzer passed.pre-commit run --all-filesin GitHub Codespaces: all applicable hooks passed, including Detect hardcoded secrets;sort simple yaml fileshad no files to check. Run output supplied by the contributor.startup_failurebefore any job started; its cause has not been confirmed.