Skip to content

Simplify test pipeline flag plumbing with a generic properties bag#16056

Open
Copilot wants to merge 5 commits intomainfrom
copilot/support-arbitrary-property-pass-through
Open

Simplify test pipeline flag plumbing with a generic properties bag#16056
Copilot wants to merge 5 commits intomainfrom
copilot/support-arbitrary-property-pass-through

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 11, 2026

Description

Adding a new boolean flag (e.g. requiresFoo) to the test pipeline currently requires coordinated changes across ~7 files — MSBuild targets, PowerShell scripts, and workflow YAML — just to pass a single value through. This makes the pipeline brittle and discourages adding new per-project test flags.

This replaces the four individual boolean inputs (requiresNugets, requiresTestSdk, requiresCliArchive, enablePlaywrightInstall) with a single properties dictionary that flows generically through the entire pipeline. Adding a new flag now only requires: (1) define the MSBuild property, (2) add it to the properties bag in targets, (3) check it where needed in workflows. No transport-layer changes.

# Before (run-tests.yml) — 4 individual inputs
requiresNugets: ${{ matrix.requiresNugets }}
requiresTestSdk: ${{ matrix.requiresTestSdk }}
requiresCliArchive: true

# After — single properties bag
properties: ${{ toJson(matrix.properties) }}

# Consumed via fromJson
if: ${{ fromJson(inputs.properties).requiresNugets == true }}

Validation

  • Existing Infrastructure.Tests updated to use the new properties bag format (BuildTestMatrixTests, ExpandTestMatrixGitHubTests, SplitTestMatrixByDepsTests, TestDataBuilder)
  • All tests continue to verify the same flag semantics — just through the dictionary instead of individual fields
  • CI pipeline run on this PR will exercise the updated tests.ymlrun-tests.yml flow end-to-end

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
    • No
  • Does the change require an update in our Aspire docs?
    • Yes
    • No

Replace individual boolean flag inputs (requiresNugets, requiresTestSdk,
requiresCliArchive, enablePlaywrightInstall) with a single 'properties'
bag that passes through the entire CI pipeline:

- MSBuild targets: nest boolean flags inside a 'properties' JSON object
- build-test-matrix.ps1: read/write properties sub-object, handle both
  new and legacy metadata formats
- split-test-matrix-by-deps.ps1: read flags from properties sub-object
- run-tests.yml: replace 4 boolean inputs with single properties string,
  use fromJson(inputs.properties) for all flag checks
- tests.yml: pass properties bag via toJson(matrix.properties)
- specialized-test-runner.yml: inject enablePlaywrightInstall into
  properties bag after runsheet generation
- TestDataBuilder.cs/CanonicalMatrixEntry: use Dictionary<string,bool>
  Properties instead of individual bool properties
- Update docs and test assertions

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: radical <1472+radical@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for arbitrary property pass-through in GitHub workflows Replace per-flag boolean inputs with generic properties bag in test pipeline Apr 11, 2026
Copilot AI requested a review from radical April 11, 2026 04:34
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 11, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 16056

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 16056"

radical and others added 3 commits April 11, 2026 01:30
Introduce eng/testing/CITestsProperties.props as the single source of truth
for CI test property names, MSBuild property mappings, and default values.

MSBuild targets now dynamically resolve properties via ItemGroup iteration
using $(%(CITestsProperty.MSBuildProp)) instead of hardcoding each property.

PowerShell scripts read the .props XML for defaults and use a generic
Copy-CITestProperties helper instead of per-property copy blocks.

Adding a new boolean test property now requires:
1. One line in CITestsProperties.props
2. Behavioral logic in the GitHub Actions workflow YAML

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Document the property registry in docs/ci/TestingOnCI.md:
  - New 'CI Test Property Registry' section explaining CITestsProperties.props
  - How-to for adding new boolean test properties (1 line + YAML)
  - Updated file artifacts and scripts reference tables
  - Cross-reference from metadata format to the registry

- Add 4 new tests in BuildTestMatrixTests.cs:
  - AllCITestsPropertiesAppearInOutputWithDefaults: verifies all
    registry properties flow through PS1 to canonical matrix output
  - DefaultsAreAppliedWhenPropertiesAreMissingFromMetadata: verifies
    partial input metadata gets defaults filled from the registry
  - CITestsPropertiesPropsFileIsValidAndComplete: validates XML
    structure, required attributes, and naming conventions
  - SplitTestEntriesInheritAllCITestsProperties: verifies split/
    partition entries also get all registry properties

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…rBase.targets

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@radical radical changed the title Replace per-flag boolean inputs with generic properties bag in test pipeline Simplify test pipeline flag plumbing with a generic properties bag Apr 11, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🎬 CLI E2E Test Recordings — 58 recordings uploaded (commit 126c393)

View recordings
Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View Recording
AddPackageWhileAppHostRunningDetached ▶️ View Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_DefaultSelection_InstallsSkillOnly ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
AllPublishMethodsBuildDockerImages ▶️ View Recording
AspireAddPackageVersionToDirectoryPackagesProps ▶️ View Recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
Banner_NotDisplayedWithNoLogoFlag ▶️ View Recording
CertificatesClean_RemovesCertificates ▶️ View Recording
CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate ▶️ View Recording
CertificatesTrust_WithUntrustedCert_TrustsCertificate ▶️ View Recording
ConfigSetGet_CreatesNestedJsonFormat ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunEmptyAppHostProject ▶️ View Recording
CreateAndRunJavaEmptyAppHostProject ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateAndRunTypeScriptEmptyAppHostProject ▶️ View Recording
CreateAndRunTypeScriptStarterProject ▶️ View Recording
CreateJavaAppHostWithViteApp ▶️ View Recording
CreateStartAndStopAspireProject ▶️ View Recording
CreateTypeScriptAppHostWithViteApp ▶️ View Recording
DashboardRunWithOtelTracesReturnsNoTraces ▶️ View Recording
DescribeCommandResolvesReplicaNames ▶️ View Recording
DescribeCommandShowsRunningResources ▶️ View Recording
DetachFormatJsonProducesValidJson ▶️ View Recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View Recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
GlobalMigration_HandlesCommentsAndTrailingCommas ▶️ View Recording
GlobalMigration_HandlesMalformedLegacyJson ▶️ View Recording
GlobalMigration_PreservesAllValueTypes ▶️ View Recording
GlobalMigration_SkipsWhenNewConfigExists ▶️ View Recording
GlobalSettings_MigratedFromLegacyFormat ▶️ View Recording
InitTypeScriptAppHost_AugmentsExistingViteRepoAtRoot ▶️ View Recording
InvalidAppHostPathWithComments_IsHealedOnRun ▶️ View Recording
LegacySettingsMigration_AdjustsRelativeAppHostPath ▶️ View Recording
LogsCommandShowsResourceLogs ▶️ View Recording
PsCommandListsRunningAppHost ▶️ View Recording
PsFormatJsonOutputsOnlyJsonToStdout ▶️ View Recording
PublishWithDockerComposeServiceCallbackSucceeds ▶️ View Recording
RestoreGeneratesSdkFiles ▶️ View Recording
RestoreSupportsConfigOnlyHelperPackageAndCrossPackageTypes ▶️ View Recording
RunFromParentDirectory_UsesExistingConfigNearAppHost ▶️ View Recording
SecretCrudOnDotNetAppHost ▶️ View Recording
SecretCrudOnTypeScriptAppHost ▶️ View Recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View Recording
StartAndWaitForTypeScriptSqlServerAppHostWithNativeAssets ▶️ View Recording
StopAllAppHostsFromAppHostDirectory ▶️ View Recording
StopAllAppHostsFromUnrelatedDirectory ▶️ View Recording
StopNonInteractiveMultipleAppHostsShowsError ▶️ View Recording
StopNonInteractiveSingleAppHost ▶️ View Recording
StopWithNoRunningAppHostExitsSuccessfully ▶️ View Recording
UnAwaitedChainsCompileWithAutoResolvePromises ▶️ View Recording

📹 Recordings uploaded automatically from CI run #24276454765

@radical radical marked this pull request as ready for review April 11, 2026 07:15
Copilot AI review requested due to automatic review settings April 11, 2026 07:15
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 PR refactors CI test-flag propagation to use a single properties dictionary (sourced from eng/testing/CITestsProperties.props) instead of multiple dedicated boolean fields, reducing cross-file plumbing when adding new flags.

Changes:

  • Introduces eng/testing/CITestsProperties.props as a registry for CI test boolean flags (JSON key, MSBuild property name, default).
  • Updates MSBuild targets, PowerShell scripts, GitHub workflows, and Infrastructure.Tests to emit/consume a properties object end-to-end.
  • Expands Infra tests to validate property defaults and inheritance behavior in the generated canonical matrix.

Reviewed changes

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

Show a summary per file
File Description
tests/Infrastructure.Tests/Shared/TestDataBuilder.cs Updates test metadata and canonical matrix test helpers to emit/consume properties.
tests/Infrastructure.Tests/PowerShellScripts/SplitTestMatrixByDepsTests.cs Adapts split-matrix tests to the nested properties format.
tests/Infrastructure.Tests/PowerShellScripts/ExpandTestMatrixGitHubTests.cs Updates assertions to read flags via Properties[...].
tests/Infrastructure.Tests/PowerShellScripts/BuildTestMatrixTests.cs Adds coverage for default property population from CITestsProperties.props.
eng/testing/CITestsProperties.props Adds centralized CI test property registry (keys, MSBuild prop mapping, defaults).
eng/TestEnumerationRunsheetBuilder/TestEnumerationRunsheetBuilder.targets Switches metadata emission to a properties JSON object driven by CITestsProperties.props.
eng/SpecializedTestRunsheetBuilderBase.targets Switches specialized runsheet emission to include a properties JSON object.
eng/scripts/split-test-matrix-by-deps.ps1 Updates dependency bucketing logic to read flags from entry.properties.
eng/scripts/build-test-matrix.ps1 Updates canonical matrix generation to normalize and default-fill properties.
docs/ci/TestingOnCI.md Documents the new properties object and the property registry file/flow.
.github/workflows/tests.yml Passes properties through to run-tests.yml instead of individual booleans.
.github/workflows/specialized-test-runner.yml Injects enablePlaywrightInstall into .properties and updates jq checks to .properties.*.
.github/workflows/run-tests.yml Replaces boolean workflow inputs with a single JSON-string properties input and consumes via fromJson.

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.

Support arbitrary property pass-through from MSBuild test projects to GitHub workflows via runsheets

3 participants