Skip to content

Make allowlisted late file-access warnings configurable - #161

Open
David Federman (dfederm) wants to merge 1 commit into
mainfrom
dfederm/msbuildcache-coded-late-access-warning
Open

Make allowlisted late file-access warnings configurable#161
David Federman (dfederm) wants to merge 1 commit into
mainfrom
dfederm/msbuildcache-coded-late-access-warning

Conversation

@dfederm

Copy link
Copy Markdown
Member

Summary

MSBuild's supported project-cache PluginLoggerBase API cannot attach warning codes, so this adds issue #158's permitted severity-setting fallback. The new opt-in MSBuildCacheLogAllowFileAccessAfterProjectFinishMatchesAsMessages property logs late accesses matching either the process-pattern or file-pattern allowlist as high-importance messages. The default remains warning-level, and other warnings are unchanged.

Why this is safe

  • The setting defaults to false, preserving existing behavior.
  • The change only selects the logging severity; allowlist matching, cache decisions, and cache identity are unchanged.
  • Both allowlisted late-access paths use the same setting, while unrelated warning paths remain untouched.

Validation

Test / build Result
Full Common test suite (net472 and net9.0) 288/288 passed
Actual MSBuild warning-policy coverage Default diagnostic remained a warning, /warnaserror rendered it as an error, and opt-in message mode remained visible without escalation
Unrelated warning coverage An unrelated warning still failed the build under /warnaserror

Out of scope

MSBuild's existing project-cache host can report Build FAILED for a plugin-only /warnaserror diagnostic while returning exit code 0; this change does not alter that host behavior.

Linked issues / todos

Fixes #158

Add a focused setting that logs allowlisted late file accesses as high-importance messages while preserving warning behavior by default. Cover the production repository path and MSBuild warn-as-error policy.

Copilot-Session: e30d7b9b-de7d-4db4-a221-cc1312fa09ff
@dfederm

Copy link
Copy Markdown
Member Author

FYI Amaury Levé (@Evangelink)

@Evangelink Amaury Levé (Evangelink) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed the property plumbing, logger severity fallback, cache-fingerprint exclusion, default behavior, and /warnaserror coverage. The opt-in remains narrowly scoped to allowlisted late file accesses, while unrelated warnings retain their existing behavior. I found no blocking issues.

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.

Allow selective suppression of allowlisted late file-access warnings

2 participants