Skip to content

Introduce RefitterAutoScan option in MSBuild package#1098

Merged
christianhelle merged 10 commits into
mainfrom
msbuild-optional-autoscan
May 30, 2026
Merged

Introduce RefitterAutoScan option in MSBuild package#1098
christianhelle merged 10 commits into
mainfrom
msbuild-optional-autoscan

Conversation

@christianhelle

@christianhelle christianhelle commented May 30, 2026

Copy link
Copy Markdown
Owner

Implements #1094

Summary by CodeRabbit

  • New Features

    • Added RefitterAutoScan (enabled by default) to control automatic code generation and kept explicit generation via dotnet build -t:RefitterGenerate.
  • Documentation

    • Updated MSBuild integration docs and README to explain RefitterAutoScan, disabling automatic scanning, explicit generation, and telemetry opt-out.
  • Chores

    • Restricted CI workflow triggers to relevant paths, updated .NET SDK version, and added/updated squad history, decisions, and commit-grouping guidance.

Review Change Stack

christianhelle and others added 8 commits May 29, 2026 13:29
Archive decisions older than 7 days and summarize Lambert history.

- Archived all decisions from 2026-04 and 2026-05-01 to decisions-archive.md
- Created fresh decisions.md with 2026-05-29 issue #1094 and user directive entries
- Summarized Lambert's history.md (16KB) to separate historical context
- Created history-archive.md with pre-2026-05-29 summary
- Created history-full.md with complete historical reference

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Merged 2 decision inbox entries to decisions.md
- Recorded Dallas and Lambert orchestration logs
- Wrote session log for issue-1094-real-implementation
- Updated agent histories with team work summary

Scribe: logged session completion for RefitterAutoScan MSBuild implementation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Merged 1 inbox decision into decisions.md (commit grouping for issue #1094)
- Deleted stale inbox file (dallas-commit-grouping.md)
- Updated cross-agent histories for Dallas, Bishop, Lambert
- No archiving required (decisions.md = 3378 bytes)
Copilot AI review requested due to automatic review settings May 30, 2026 13:42
@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cf0bb81b-7956-4097-a029-b4459c0613c0

📥 Commits

Reviewing files that changed from the base of the PR and between 2a979e2 and f9a8c14.

📒 Files selected for processing (1)
  • .github/workflows/msbuild.yml

📝 Walkthrough

Walkthrough

This PR adds a RefitterAutoScan MSBuild property (default true) and a conditional _RefitterGenerateOnBuild target that invokes RefitterGenerate before CoreCompile only when auto-scan is enabled; it updates docs, CI to verify enabled/explicit/disabled scenarios, and squad history/decision records.

Changes

RefitterAutoScan MSBuild Gating Feature

Layer / File(s) Summary
MSBuild RefitterAutoScan Property and Conditional Target
src/Refitter.MSBuild/Refitter.MSBuild.targets
Adds RefitterAutoScan (default true) and a _RefitterGenerateOnBuild target with BeforeTargets="CoreCompile", DependsOnTargets="RefitterGenerate", and Condition="'$(RefitterAutoScan)' != 'false'".
Public and Package Documentation Updates
docs/docfx_project/articles/msbuild.md, src/Refitter.MSBuild/README.md
Doc updates show RefitterAutoScan default, conditional _RefitterGenerateOnBuild wiring, disabling auto-scan, and how to run dotnet build -t:RefitterGenerate explicitly.
CI Workflow Test Scenarios
.github/workflows/msbuild.yml
Workflow triggers changed to paths filters and build steps replaced with three PowerShell scenarios: auto-scan enabled, explicit RefitterGenerate invocation (asserts task start in logs), and auto-scan disabled; each emits MSBuild diagnostics as artifacts.
Squad Session Records and Decisions
.squad/agents/*, .squad/decisions.md, .squad/decisions-archive.md
Add and update history/decision entries documenting Issue #1094 implementation, validation, commit-grouping decisions, and archival logs.
Commit-Grouping Hygiene Skill and SDK Update
.squad/skills/commit-grouping-hygiene/SKILL.md, global.json
Add commit-grouping-hygiene skill document and adjust global.json SDK version setting.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

enhancement, .NET, CI/CD

Poem

🐰 A gate upon the builder's way,
Let DevOps choose: scan or delay.
When RefitterAutoScan says nay,
Generation waits for explicit day.
Clean commits and docs in place— Issue #1094 hops into grace.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Introduce RefitterAutoScan option in MSBuild package' accurately describes the primary change: adding the RefitterAutoScan property and related MSBuild target infrastructure to control automatic code generation scanning.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch msbuild-optional-autoscan

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 introduces an opt-out switch for Refitter.MSBuild’s automatic “scan and generate on every build” behavior, addressing issue #1094 by keeping RefitterGenerate available for explicit/on-demand generation while allowing normal builds to skip the hook.

Changes:

  • Add RefitterAutoScan (default true) and gate the on-build hook via a new _RefitterGenerateOnBuild wrapper target.
  • Update MSBuild documentation (package README + docfx article) to describe disabling auto-scan while still invoking dotnet build -t:RefitterGenerate.
  • Extend the msbuild.yml workflow to validate all three flows: auto-scan enabled, explicit generation with auto-scan disabled, and normal build with auto-scan disabled.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Refitter.MSBuild/Refitter.MSBuild.targets Adds RefitterAutoScan defaulting and a wrapper target to gate on-build execution.
src/Refitter.MSBuild/README.md Documents RefitterAutoScan and the explicit RefitterGenerate workflow.
docs/docfx_project/articles/msbuild.md Mirrors README guidance for docfx documentation.
.github/workflows/msbuild.yml Adds CI checks covering enabled/disabled auto-scan and explicit generation.
global.json Changes pinned SDK version (review flagged as potentially problematic).
.squad/skills/commit-grouping-hygiene/SKILL.md Adds Squad skill guidance for commit grouping.
.squad/decisions.md Collapses/updates decisions to current entries and records the RefitterAutoScan decision.
.squad/decisions-archive.md Archives older decision entries.
.squad/commit-msg.txt Removes stale automation artifact.
.squad/agents/lambert/history.md Updates Lambert history for issue #1094 (review flagged a typo).
.squad/agents/lambert/history-full.md Adds Lambert full history archive file.
.squad/agents/lambert/history-archive.md Adds Lambert history archive file.
.squad/agents/dallas/history.md Updates Dallas history with issue #1094 and commit-grouping notes.
.squad/agents/bishop/history.md Updates Bishop history with issue #1094 cross-agent update.

Comment thread .squad/agents/lambert/history.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 8

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/msbuild.yml:
- Around line 43-79: The dotnet build steps (the three invocations that produce
msbuild.log, msbuild-explicit.log, and msbuild-disabled.log) aren't checking the
native exit code so a failed build can be masked; after each dotnet build call
(both the auto-scan build, the explicit -t:RefitterGenerate build, and the
auto-scan disabled build) add an explicit check of $LASTEXITCODE and throw a
descriptive error if it's non-zero (e.g., if ($LASTEXITCODE -ne 0) { throw
"dotnet build failed (exit code $LASTEXITCODE)" }) so failures in
RefitterAutoScan/RefitterGenerate runs are propagated.

In @.squad/agents/lambert/history-archive.md:
- Around line 66-72: Add a short "Last verified" line for every runnable command
block in history-archive.md using the compact pattern "Last verified:
YYYY-MM-DD, OS/shell, outcome (pass/fail, brief evidence)", and update the
command entries referenced in the comment (the command blocks around the 66-72,
108-117, 128-139, and 1018-1023 areas) to include that line; ensure each command
block shows platform/shell, date, and a one-line outcome/evidence string so
every documented command has an explicit verification status.

In @.squad/agents/lambert/history-full.md:
- Around line 66-72: The history entries like "2026-04-25 CLI help repro",
"2026-04-25 Linux help-test follow-up", and the other dated command paragraphs
lack a standardized validation footer; update each command paragraph referenced
(including the blocks around lines 108-117, 128-139, and 1018-1023) to append a
one-line validation footer in the format "Verified: YYYY-MM-DD | Environment:
<OS/CI> | Result: <pass/fail/notes>" so every command record includes date,
environment, and outcome; apply this consistently to the entries named in the
diff (e.g., the CLI help repro, Linux help-test follow-up, PR `#1064/`#1057
testing pattern, baseline scan, coverage baseline, low-risk coverage targets,
environment-sensitive tests) to make verification explicit and repeatable.

In @.squad/agents/lambert/history.md:
- Line 14: Fix the typo in the history entry referring to RefitterAutoScan:
replace the malformed "	rue" (contains a stray tab) with the correct "true" so
the line reads "RefitterAutoScan to true" for the validation note about
src\Refitter.MSBuild\Refitter.MSBuild.targets; ensure no extra whitespace or
tabs remain around the token.

In @.squad/decisions-archive.md:
- Line 1001: Change the inconsistent heading style around the block containing
"timestamp: 2026-05-01T14:34:56.630+02:00" to match the repo's markdownlint
heading convention (use ATX "#" headers if MD003 requires that) and rename or
de-duplicate the repeated heading text that appears later (the duplicate near
the second occurrence) so it no longer matches the earlier heading (MD024);
update only the heading markers/text to a consistent format and a unique title
while keeping the surrounding content intact.

In @.squad/decisions.md:
- Line 3: The section title contains a duplicated word "Refitter
RefitterAutoScan MSBuild Implementation"; update the heading to remove the
duplicate so it reads e.g. "RefitterAutoScan MSBuild Implementation" (or
"Refitter AutoScan MSBuild Implementation") by editing the heading string in the
decision entry to delete the extra "Refitter".

In @.squad/skills/commit-grouping-hygiene/SKILL.md:
- Line 20: Replace the placeholder commands `git add <paths>` and `git commit -m
"<message>"` with concrete, validated examples (e.g., `git add README.md src/`
and `git commit -m "Add README and source files"`) or explicitly label them as
pseudocode and provide a verified runnable variant; update the SKILL.md sentence
referencing these commands so it either shows the runnable examples or notes
"replace paths and message with your actual files/commit message" and ensure the
examples have been tested locally for correctness.

In `@global.json`:
- Line 3: The global.json currently pins the SDK "version" to an invalid value
"10.0.0"; update the "version" field in global.json to a full major.minor.patch
SDK feature-band (patch must be a three-digit feature band), for example
"10.0.100" or whichever full SDK feature-band you intend to target so dotnet
restore/build can resolve the SDK correctly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 54699a24-f0af-4484-8dd7-8ac7cfb228d3

📥 Commits

Reviewing files that changed from the base of the PR and between e55cdd3 and 1756f3c.

📒 Files selected for processing (14)
  • .github/workflows/msbuild.yml
  • .squad/agents/bishop/history.md
  • .squad/agents/dallas/history.md
  • .squad/agents/lambert/history-archive.md
  • .squad/agents/lambert/history-full.md
  • .squad/agents/lambert/history.md
  • .squad/commit-msg.txt
  • .squad/decisions-archive.md
  • .squad/decisions.md
  • .squad/skills/commit-grouping-hygiene/SKILL.md
  • docs/docfx_project/articles/msbuild.md
  • global.json
  • src/Refitter.MSBuild/README.md
  • src/Refitter.MSBuild/Refitter.MSBuild.targets
💤 Files with no reviewable changes (1)
  • .squad/commit-msg.txt

Comment thread .github/workflows/msbuild.yml
Comment thread .squad/agents/lambert/history-archive.md
Comment thread .squad/agents/lambert/history-full.md
Comment thread .squad/agents/lambert/history.md
Comment thread .squad/decisions-archive.md
Comment thread .squad/decisions.md
Comment thread .squad/skills/commit-grouping-hygiene/SKILL.md
Comment thread global.json Outdated
@christianhelle
christianhelle enabled auto-merge May 30, 2026 14:33
@christianhelle
christianhelle merged commit dc19780 into main May 30, 2026
6 of 7 checks passed
@christianhelle
christianhelle deleted the msbuild-optional-autoscan branch May 30, 2026 15:01
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature, bug fix, or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants