Repository navigation
feat: prepare opt-in shared Sonar analysis for core - #25
Conversation
andregoepel
left a comment
There was a problem hiding this comment.
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", | |||
There was a problem hiding this comment.
[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.
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.jsonselects 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.Standby and remaining rollout work
SONAR_MAIN_ENABLEDis absent and the new workflow remains inactive.profiles: []andbaselineAnalysisId: nullintentionally 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.