Skip to content

build: unblock Scorecard's Central Package Management detection - #95

Merged
Reefact merged 1 commit into
mainfrom
claude/fuzzing-openssf-scorecard-uneno2
Jul 11, 2026
Merged

build: unblock Scorecard's Central Package Management detection#95
Reefact merged 1 commit into
mainfrom
claude/fuzzing-openssf-scorecard-uneno2

Conversation

@Reefact

@Reefact Reefact commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to the Central Package Management adoption (#94). The scorecard (v5.3.0) run on main after that change still scored Pinned-Dependencies at 7 ("0/2 nugetCommand dependencies pinned") with only the base remediation text — i.e. its NuGet check evaluated CPM as disabled (IsCPMEnabled=false) and never reached the fixed-version branch. The likely trip-up: the Directory.Packages.props header comment described FloorCheck's opt-out as the literal string ManagePackageVersionsCentrally=false, sitting above the real <ManagePackageVersionsCentrally>true</...> element — enough for a first-match parser to read false. This moves the property to the top of the file and removes that token from the comment so only the genuine true remains.

Note: confirmation can only come from the next scorecard run on main (Scorecard can't be run locally here). This is the most likely fix, not a guarantee.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Analyzer / diagnostic change
  • Tests
  • Documentation
  • Build / CI / tooling

Changes

  • Directory.Packages.props: moved <ManagePackageVersionsCentrally>true</...> to the top of the file, and reworded the header comment so the token ManagePackageVersionsCentrally now appears only in the genuine true element (FloorCheck's opt-out is described without spelling out the ...=false value).

Testing

  • dotnet build FirstClassErrors.sln (Release, with the CI warning ratchet — 0 warnings)
  • dotnet test FirstClassErrors.sln (Release — 598 passed, 0 failed)
  • Analyzer tests pass (FirstClassErrors.Analyzers.UnitTests)

Documentation

  • Public API / error documentation updated
  • README / doc/ updated
  • French translation (doc/README.fr.md) updated if user-facing behavior changed
  • No documentation change required — MSBuild behaviour is unchanged; this only reorders elements and rewords a comment.

Related issues

None.

🤖 Generated with Claude Code

https://claude.ai/code/session_014W1zrcBNy3jEs8ngAQKwZg


Generated by Claude Code

The v5.3.0 Scorecard run after enabling CPM still reported Pinned-Dependencies at
7 ("0/2 nugetCommand dependencies pinned") with only the base remediation text —
so its NuGet check evaluated CPM as disabled (IsCPMEnabled=false) and never
entered the fixed-version branch.

The likely trip-up: the Directory.Packages.props header comment spelled out
FloorCheck's opt-out as the literal string "ManagePackageVersionsCentrally=false"
above the real <ManagePackageVersionsCentrally>true</...> element, so a
first-match parser reads "false". Move the property to the top of the file and
drop that token from the comment, leaving the genuine "true" as the only
occurrence. MSBuild behaviour is unchanged (restore + build + 598 tests green).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014W1zrcBNy3jEs8ngAQKwZg
@Reefact
Reefact merged commit b4a4382 into main Jul 11, 2026
11 checks passed
@Reefact
Reefact deleted the claude/fuzzing-openssf-scorecard-uneno2 branch July 11, 2026 08:32
Reefact pushed a commit that referenced this pull request Aug 10, 2026
Enabling Central Package Management in Directory.Packages.props (#94, #95) did
not move Scorecard's Pinned-Dependencies check off 7: the v5.3.0 run still
reported "0/2 nugetCommand dependencies pinned" with only the base remediation
text, i.e. its NuGet check evaluated CPM as disabled.

Root cause (internal/dotnet/properties/properties.go): the check reads every
Directory.*.props file and keeps only the LAST one's config when deciding whether
CPM is enabled. This repo also has Directory.Build.props, which carries no
ManagePackageVersionsCentrally element; read after Directory.Packages.props, it
overwrites the "enabled" verdict with "disabled".

Declare ManagePackageVersionsCentrally=true in Directory.Build.props as well.
Since it has no <PackageVersion>, the empty version set trivially satisfies the
"all versions are fixed" rule, so the restore is credited as pinned. MSBuild
behaviour is unchanged (redundant true; FloorCheck still opts out in its csproj);
restore + build + 598 tests stay green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014W1zrcBNy3jEs8ngAQKwZg
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.

2 participants