Repository navigation
Update branching instructions to be version-agnostic - #35066
Conversation
Replace hardcoded 'net10.0' references with a dynamic pattern that automatically applies as new netN.0 branches are created. The instructions now describe the convention (highest netN.0 branch is the feature branch) and include a command to discover it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 35066Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 35066" |
There was a problem hiding this comment.
Pull request overview
Updates .github/copilot-instructions.md branching guidance to avoid hardcoding a specific netN.0 feature branch, keeping the instructions accurate as new netN.0 branches are created.
Changes:
- Removed the explicit
net10.0branch callout from the “Key Technologies” section. - Documented the convention that the highest
netN.0branch is the current feature/API-development branch. - Added a command intended to discover the current highest
netN.0branch from Git remotes.
| ### Branching | ||
| - `main` - For bug fixes without API changes | ||
| - `net10.0` - For new features and API changes | ||
| - The highest `netN.0` branch (e.g., `net11.0`, `net12.0`) - For new features and API changes. To find the current feature branch, run: `git branch -r | grep -oE 'origin/net[0-9]+\.0$' | sort -t. -k1 -V | tail -1` |
There was a problem hiding this comment.
The discovery command relies on grep, sort, and tail, which won’t work in a default Windows PowerShell/Command Prompt environment (and may not be available in minimal shells). Since this doc targets cross-platform MAUI development, consider using a Git-only command (e.g., git for-each-ref with --sort=-version:refname and --count=1) to pick the highest netN.0 remote branch without external Unix tools.
| - The highest `netN.0` branch (e.g., `net11.0`, `net12.0`) - For new features and API changes. To find the current feature branch, run: `git branch -r | grep -oE 'origin/net[0-9]+\.0$' | sort -t. -k1 -V | tail -1` | |
| - The highest `netN.0` branch (e.g., `net11.0`, `net12.0`) - For new features and API changes. To find the current feature branch, run: `git for-each-ref --sort=-version:refname --count=1 --format='%(refname:short)' refs/remotes/origin/net*.0` |
🔍 Multi-Model Code Review — PR #35066PR: Update branching instructions to be version-agnostic CI Status: ✅ Passing (maui-pr skipping — expected for docs-only changes)Prior Review CommentsNo prior substantive review comments on this PR. Findings🟡 MODERATE — Discovery command output includes
|
| Finding | Details |
|---|---|
Other files hardcode net10.0 TFMs |
helix-device-tests.instructions.md (/p:_MauiDotNetTfm=net10.0), write-ui-tests/SKILL.md (net10.0-android), Run-DeviceTests.ps1 (net10.0-* literals). Same staleness class but TFMs, not branches — worth a follow-up PR. |
sort -V portability |
Empirically verified working on macOS (BSD sort). Not an issue. |
Test Coverage Assessment
N/A — documentation-only change, no code paths to test.
⚠️ Recommended Action: Request Changes
The direction is correct and the core problem (hardcoded net10.0) is solved. However, the discovery command has usability issues that should be fixed before merge:
- Strip
origin/prefix from command output (or adjust the grep) — agents will misuse the raw output - Simplify sort to just
sort -V - Remove or genericize the
(e.g., net11.0, net12.0)examples to avoid re-introducing staleness - Add fetch prerequisite — note that
git fetch originis needed first
A revised command might look like:
git fetch origin --quiet && git branch -r | grep -oE \bnet[0-9]+\.0 | sort -V | tail -1🔄 Re-Review — After Fixes (commit 52d0ccc)
Fixes addressed the Copilot inline suggestion and the majority of findings from the initial review. Re-reviewed with 3 independent reviewers.
Previous Findings Status
| # | Previous Finding | Status | Notes |
|---|---|---|---|
| 1 | origin/ prefix in command output |
✅ FIXED | %(refname:lstrip=3) correctly strips to net11.0 |
| 2 | Stale (e.g., net11.0, net12.0) examples |
✅ FIXED | Replaced with generic netN.0 notation |
| 3 | Command requires prior git fetch |
❌ STILL PRESENT | git for-each-ref refs/remotes/… still reads local remote-tracking refs which can be stale. Easy fix: add "after running git fetch" to the sentence. |
| 4 | "Highest netN.0" heuristic is assumption | ❌ STILL PRESENT | Stated as fact ("is the current development branch") with no qualification. Minor wording change: "is typically" or "is (by convention)" would suffice. |
| 5 | Redundant sort -t. -k1 flags |
➖ N/A | Old command entirely replaced by git for-each-ref |
| 6 | Inline command is complex | ❌ STILL PRESENT | 🟢 The git for-each-ref command is cleaner than the old pipeline but still ~95 chars in a bullet point. Acceptable trade-off. |
| 7 | Lost concrete naming example | ✅ FIXED | "Each netN.0 branch targets the .NET N SDK" is self-documenting |
New Issues
None found by any reviewer. Two single-reviewer findings were discarded after analysis:
net*.0glob could match hypotheticalnet-preview.0— no such branches exist or are expected- Hardcoded
originremote name — standard git convention, universal for this repo
✅ Recommended Action: Approve
4 of 7 original findings are fixed, 1 is N/A, and the 2 remaining items (#3 fetch prerequisite, #4 heuristic wording) are minor documentation nits that don't affect correctness for the primary use case. The PR achieves its goal: branching instructions that won't go stale when new netN.0 branches are created.
The remaining items can be addressed in a follow-up if desired:
- Add "after running
git fetch origin" caveat - Soften "is" → "is (by convention)" for the heuristic
…le examples - Replace grep/sort/tail pipeline with git for-each-ref (works on all platforms without Unix tools) - Strip origin/ prefix from output via refname:lstrip=3 - Remove version-specific examples (net11.0, net12.0) that would go stale - Add concrete naming convention: each netN.0 branch targets .NET N SDK Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add 'git fetch origin' prerequisite before discovery command - Soften 'is the current' to 'by convention' in both locations Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description
The branching instructions in
.github/copilot-instructions.mdhardcodednet10.0as the feature branch for new APIs. This becomes stale every time a newnetN.0branch is created (e.g.,net11.0,net12.0).This PR replaces the hardcoded version with a dynamic convention: the highest
netN.0branch is the current feature branch for new features and API changes. It also includes a discovery command so agents can programmatically find the right branch.Changes
net10.0 branchline from Key Technologies sectionnet10.0in Branching section with version-agnostic pattern and discovery commandWhy
This caused a real issue: during a multi-model code review of PR #34230, the reviewer incorrectly recommended targeting
net10.0instead ofnet11.0because the instructions saidnet10.0. With this change, the instructions will remain correct as branches evolve.