Skip to content

feat: prepare opt-in shared Sonar analysis for core - #25

Merged
andregoepel merged 2 commits into
mainfrom
feature/sonar-onboarding-wave1
Oct 22, 2026
Merged

andregoepel merged 2 commits into
mainfrom
feature/sonar-onboarding-wave1

Conversation

@andregoepel

@andregoepel andregoepel commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Problem and result

Core has no Sonar analysis or exact-main readiness. This PR adds a complete library analysis contract, a Windows/Linux local entry point and a new opt-in main caller using the shared C# runner from andregoepel/workflows#28 at immutable commit 64b791bc90feadfd21a8cc3cf73b14456172334b.

Core's root global.json selects SDK 10.0.402 with roll-forward disabled, matching the analysis contract and retaining Microsoft.Testing.Platform. This addresses the SDK-selection review finding: installing a newer SDK cannot silently change the scanner's build/test SDK. The runbook documents installation and coordinated upgrades.
Review and merge the shared PR first. The tool pin appears in the caller, input and policy; all three must move together if that PR changes. The runner is built outside the Core solution. Core source, tests, package dependencies, existing CI/tag publisher and every existing Action file remain unchanged.

Validation

Core PR CI passed on attempt 1 at exact head 9ee2134999684305f397e1518c00dc41a63716e8. The tag publisher was correctly skipped.

  • Complete local Windows analysis and Linux recovery: both projects, all six tests pass, 100% coverage, zero issues/hotspots, gate OK.
  • Isolated uncovered probe: tests still pass but unchanged gate fails at 13.9% coverage, scanner exits 1; clean Linux scan recovers with exit 0. Probe and raw diagnostics are ignored local artifacts, not committed.
  • After the SDK fix, the actual PowerShell wrapper fetched the pinned shared commit and completed full Windows and Linux scans: six passing tests, 100% coverage, zero issues/hotspots and gate OK on both. Temporary credentials were removed and the local prototype stopped.
  • Shared tool: 259 tests pass on Windows/Linux; legacy workflow suite passes all 80 tests. Shared PR's five hosted checks pass.
  • SDK resolver regression: an installed exact pin was selected despite a newer installed SDK; an unavailable exact pin failed without roll-forward. Root resolution selects 10.0.402 and preserves Microsoft.Testing.Platform.
  • Formatting, build, locked restore, dependency audit, PowerShell syntax, actionlint, existing-CI content fingerprint and immutable pin agreement verified.
  • E2E/staging deployment: not applicable to this library, not recorded as passed.

Standby and remaining rollout work

SONAR_MAIN_ENABLED is absent and the new workflow remains inactive. profiles: [] and baselineAnalysisId: null intentionally reject central readiness until separate project/profile/token/environment provisioning and actual main-baseline review. The runbook gives the ordered activation and rollback steps; no central readiness run or acceptance is fabricated.

After review/merge: capture the dedicated frozen profiles, provision scoped credentials in a main-only protected environment, obtain/review the initial main analysis and baseline, then collect two exact-main CI/Sonar successes and staging capacity evidence. No main failure drill is authorized by this PR.

Publishing is not activated or modified. Core's existing tag publisher remains in place and is not Sonar-protected by this analysis-only addition. Readiness explicitly has releaseEligible: false. No other repository is changed.

Refs #24 and andregoepel/app-foundation#238. Keep #24 open until post-merge rollout evidence is accepted. Do not merge automatically.

@andregoepel andregoepel left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Reviewed against shared workflows commit 64b791bc90feadfd21a8cc3cf73b14456172334b. The caller, input and policy pins agree, and the incomplete central policy correctly keeps readiness disabled. One SDK-selection issue is recorded inline. Shared runner tests passed locally (259/259); the existing Core PR CI is green. No central scan or activation was performed.

@@ -0,0 +1,10 @@
{
"sdk": "10.0.402",

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

[P2] Select the exact SDK required by the analysis contract

The runner compares dotnet --version in the Core checkout against this exact value, but Core's global.json contains only the test-runner setting. The SDK pin under the downloaded shared tool applies only inside that tool directory; neither the local wrapper nor setup-dotnet makes it the selected SDK for commands run from Core's root. Consequently, a developer machine or hosted image with an SDK newer than 10.0.402 selects that newer SDK and fails with SDK version differs from the contract, even when 10.0.402 is installed. I verified the selection behavior using the installed 10.0.302/10.0.402 SDKs: Core's global.json selects 10.0.402, while an explicit 10.0.302 pin selects 10.0.302. Pin Core's SDK to 10.0.402 with roll-forward disabled (preserving its test-runner setting), or explicitly isolate/select that SDK for all consumer-side analysis commands.

@andregoepel
andregoepel merged commit e553968 into main Oct 22, 2026
3 checks passed
@andregoepel
andregoepel deleted the feature/sonar-onboarding-wave1 branch October 22, 2026 14:28
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.

1 participant