Uh oh!
There was an error while loading. Please reload this page.
Use native GitHub Issue Type field for Bug/Feature/Task instead of type/* labels - #8859
Conversation
The 'type/bug' and 'type/feature' labels still account for almost all categorization on new issues even though the microsoft org enabled native GitHub Issue Types (Bug, Feature, Task). This change: * Adds a 'GitHub issue creation guidelines' section to .github/copilot-instructions.md telling humans and agentic workflows to set the native Issue Type (Bug/Feature/Task) instead of the deprecated 'type/bug' / 'type/feature' labels. Other 'type/*' labels stay because they have no native equivalent. * Removes 'type/bug' and 'type/feature' from the target taxonomy in eng/migrate-labels.ps1 and marks them (plus the legacy 'bug', 'enhancement', 'feature-request' aliases) for deletion. * Adds a Phase 3.5 to migrate-labels.ps1 that converts every issue still carrying one of those labels to the matching native Issue Type before Phase 4 deletes the labels, so we do not lose categorization. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates repository guidance and tooling to use GitHub’s native Issue Type field (Bug / Feature / Task) for primary categorization, instead of the legacy type/bug / type/feature labels, and adds a migration step to preserve that categorization during label cleanup.
Changes:
- Document new issue-creation policy in
.github/copilot-instructions.md(prefer native Issue Type; deprecatetype/bug+type/feature; keep othertype/*labels). - Update
eng/migrate-labels.ps1taxonomy/mapping to removetype/bug+type/featureand delete legacy aliases (bug,enhancement,feature-request, etc.). - Add Phase 3.5 to convert legacy labels into native Issue Types via GitHub GraphQL before label deletion.
Show a summary per file
| File | Description |
|---|---|
eng/migrate-labels.ps1 | Removes type/bug/type/feature from target taxonomy, maps legacy labels to deletion, and adds Phase 3.5 to set native Issue Types before deleting labels. |
.github/copilot-instructions.md | Adds “GitHub issue creation guidelines” documenting how to set Issue Type across templates/UI/CLI/workflows and deprecating type/bug/type/feature. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 1
Uh oh!
There was an error while loading. Please reload this page.
…lint * eng/migrate-labels.ps1: route the issue 'remove-label' call in Convert-LabelToIssueType through Invoke-Gh, matching the surrounding PR-edit path and the rest of the script (centralized dry-run logging and exit-code handling). * .github/copilot-instructions.md: surround the bash fenced code block with blank lines so markdownlint MD031 passes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Amaury Levé (Evangelink)
left a comment
There was a problem hiding this comment.
Algorithmic Correctness — ISSUE (1 BLOCKING)
One bug found; everything else (dry-run guards, pagination, $existing lifetime) is correct.
| Severity | BLOCKING |
| File | eng/migrate-labels.ps1 |
| Lines | 457–473 |
$name variable shadows the $Name parameter in Get-IssueTypeId
PowerShell variable names are case-insensitive: $name and $Name refer to the same variable. On the first call (cache is $null), line 457 executes:
$owner,$name=$Repo-split'/',2# silently overwrites $NameThis replaces the caller-supplied type name (e.g. "Bug") with the repository's short name (e.g. "testfx"). Lines 470–473 then consult $Name for the cache lookup — using "testfx" instead of "Bug" — and always throw:
Issue type 'testfx' is not configured on microsoft/testfx. Available: Bug, Feature, Task
Subsequent calls (warm cache, if block skipped) are fine, but the script never reaches them.
Fix: use a non-clashing local name, e.g.:
$repoOwner,$repoName=$Repo-split'/',2$json=& gh api graphql -f query=$query-F owner=$repoOwner-F name=$repoNameApply the same rename at line 481 in Get-IssuesWithLabel for consistency (no parameter clash there, but it avoids confusion).
Generated by Expert Code Review (on open) for issue #8859 · sonnet46 6.8M
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
… prefix - Get-IssueTypeId: rename $owner/$name to $repoOwner/$repoName so the destructure no longer clobbers the $Name parameter (case-insensitive PowerShell vars made every first call throw). - Get-IssuesWithLabel: same rename for consistency; consolidate the two gh graphql call sites into a single $ghArgs splat; accumulate paged results in a List[object] to avoid O(n^2) array concatenation. - Phase-3 log line: replace the ad-hoc 'c ' prefix with '> ' to match the symbol-based legend used elsewhere in the script. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…00-limit truncation - Convert-LabelToIssueType now wraps each issue and each PR edit in try/catch, collects failures into a per-call list, keeps processing the remaining items, and throws a single aggregated summary at the end (mirrors Merge-LabelInto's failure-collection pattern). Phase 3 still aborts overall on any failure, so Phase 4 deletions never run against a half-migrated state. - Added the same >=5000 truncation guard as Merge-LabelInto on the PR-list call, so the script refuses to silently drop the tail instead of deleting the label with leftover PRs still carrying it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Azat Mukhametshin (azat-msft)
left a comment
There was a problem hiding this comment.
I'm not proficient with powershell scripts by any means, but I reviewed the logic anyways and it seems correct to me. Also, dry run output exactly what it should based on the verification steps, so I approve.
Uh oh!
There was an error while loading. Please reload this page.
Problem
Newly created issues are almost always tagged with the legacy
type/featurelabel (and sometimestype/bug) while the native GitHub Issue Type field stays empty. Example: #8828 hastype/featurebutissueType: null. The native types (Bug, Feature, Task) were enabled on themicrosoftorg but never wired in.Changes
.github/copilot-instructions.md- new section "GitHub issue creation guidelines":type/bug/type/featurelabels.type/*labels (type/tech-debt,type/test-gap,type/automation,type/regression,type/flaky-test, ...) stay because they have no native equivalent.gh issue create, the GraphQLupdateIssueIssueTypemutation, andgh-awsafe-outputs.create-issue.type.eng/migrate-labels.ps1:type/bugandtype/featurefrom the target taxonomy.bug,enhancement,feature-request,type/bug,type/featurelabels to deletion in$Migration.$IssueTypeReplacementand helper functions (Get-IssueTypeId,Get-IssuesWithLabel,Set-IssueType,Convert-LabelToIssueType).Verification
Dry-run (
pwsh -NoProfile -File .\eng\migrate-labels.ps1 -DryRun -Force) shows Phase 3.5 picks up the 5 opentype/featureissues (#8793, #8825, #8826, #8827, #8828) and would set them to nativeFeature, then Phase 4 deletes the now-emptytype/bugandtype/featurelabels. PRs lose the label without any Issue Type change (PRs do not have one).After this PR merges, run the script once without
-DryRunto perform the actual conversion + deletion.