chore: re-organize labels for better triage results

This commit is contained in:
mingholy.lmh
2025-10-15 21:44:49 +08:00
parent 40810945e0
commit 0d0fd68e63
8 changed files with 611 additions and 111 deletions

View File

@@ -1,6 +1,6 @@
name: 'Bug Report'
description: 'Report a bug to help us improve Qwen Code'
labels: ['kind/bug', 'status/need-triage']
labels: ['type/bug', 'status/needs-triage']
body:
- type: 'markdown'
attributes:

View File

@@ -1,8 +1,8 @@
name: 'Feature Request'
description: 'Suggest an idea for this project'
labels:
- 'kind/enhancement'
- 'status/need-triage'
- 'type/feature-request'
- 'status/needs-triage'
body:
- type: 'markdown'
attributes:

View File

@@ -40,21 +40,13 @@ process_pr() {
fi
if [[ -z "${ISSUE_NUMBER}" ]]; then
echo " No linked issue found for PR #${PR_NUMBER}, adding status/need-issue label"
if ! gh pr edit "${PR_NUMBER}" --repo "${GITHUB_REPOSITORY}" --add-label "status/need-issue" 2>/dev/null; then
echo " ⚠️ Failed to add label (may already exist or have permission issues)"
fi
# Add PR number to the list
if [[ -z "${PRS_NEEDING_COMMENT}" ]]; then
PRS_NEEDING_COMMENT="${PR_NUMBER}"
else
PRS_NEEDING_COMMENT="${PRS_NEEDING_COMMENT},${PR_NUMBER}"
fi
echo "needs_comment=true" >> "${GITHUB_OUTPUT}"
echo " No linked issue found for PR #${PR_NUMBER} - this is acceptable for independent contributions"
# We no longer require PRs to have linked issues
# Independent valuable contributions are encouraged
else
echo "🔗 Found linked issue #${ISSUE_NUMBER}"
# Remove status/need-issue label if present
# Remove status/need-issue label if present (legacy cleanup)
if ! gh pr edit "${PR_NUMBER}" --repo "${GITHUB_REPOSITORY}" --remove-label "status/need-issue" 2>/dev/null; then
echo " status/need-issue label not present or could not be removed"
fi
@@ -99,7 +91,7 @@ process_pr() {
local LABELS_TO_REMOVE=""
for label in "${PR_LABEL_ARRAY[@]}"; do
if [[ -n "${label}" ]] && [[ " ${ISSUE_LABEL_ARRAY[*]} " != *" ${label} "* ]]; then
# Don't remove status/need-issue since we already handled it
# Don't remove status/need-issue since we already handled it (legacy cleanup)
if [[ "${label}" != "status/need-issue" ]]; then
if [[ -z "${LABELS_TO_REMOVE}" ]]; then
LABELS_TO_REMOVE="${label}"

View File

@@ -0,0 +1,201 @@
name: 'Check Issue Completeness'
on:
issues:
types:
- 'opened'
- 'edited'
permissions:
contents: 'read'
issues: 'write'
jobs:
check-issue-info:
timeout-minutes: 2
if: |-
${{ github.repository == 'QwenLM/qwen-code' && contains(github.event.issue.labels.*.name, 'type/bug') }}
runs-on: 'ubuntu-latest'
steps:
- name: 'Check for Client Information'
id: 'check_info'
env:
ISSUE_BODY: '${{ github.event.issue.body }}'
run: |-
echo "Checking issue body for required information..."
# Convert issue body to lowercase for case-insensitive matching
ISSUE_BODY_LOWER=$(echo "$ISSUE_BODY" | tr '[:upper:]' '[:lower:]')
# Initialize flags
HAS_VERSION=false
HAS_OS_INFO=false
HAS_AUTH_METHOD=false
HAS_ABOUT_OUTPUT=false
MISSING_INFO=()
# Check for /about command output by looking for its characteristic fields
# The /about output contains: CLI Version, Git Commit, Model, Sandbox, OS, Auth Method
if echo "$ISSUE_BODY_LOWER" | grep -qE 'cli version.*[0-9]+\.[0-9]+\.[0-9]+'; then
HAS_ABOUT_OUTPUT=true
HAS_VERSION=true
fi
# If full /about output is not detected, check individual components
if [ "$HAS_ABOUT_OUTPUT" = false ]; then
# Check for version information (various formats)
if echo "$ISSUE_BODY_LOWER" | grep -qE '(cli version|version|v)[[:space:]]*[0-9]+\.[0-9]+\.[0-9]+'; then
HAS_VERSION=true
fi
# Check for OS information
if echo "$ISSUE_BODY_LOWER" | grep -qE '(^os[[:space:]]|macos|windows|linux|ubuntu|debian|fedora|arch|darwin|win32|platform)'; then
HAS_OS_INFO=true
fi
# Check for Auth Method information
if echo "$ISSUE_BODY_LOWER" | grep -qE '(auth method|authentication|login|qwen-oauth|api.?config|oauth)'; then
HAS_AUTH_METHOD=true
fi
else
# If /about output is present, assume it contains OS and auth info
HAS_OS_INFO=true
HAS_AUTH_METHOD=true
fi
# Determine what's missing
if [ "$HAS_ABOUT_OUTPUT" = false ]; then
if [ "$HAS_VERSION" = false ]; then
MISSING_INFO+=("Qwen Code version")
fi
if [ "$HAS_OS_INFO" = false ]; then
MISSING_INFO+=("operating system information")
fi
if [ "$HAS_AUTH_METHOD" = false ]; then
MISSING_INFO+=("authentication/login method")
fi
# Suggest providing /about output for completeness
if [ "$HAS_VERSION" = false ] || [ "$HAS_OS_INFO" = false ] || [ "$HAS_AUTH_METHOD" = false ]; then
MISSING_INFO+=("full output of the \`/about\` command (recommended)")
fi
fi
# Set output variables
if [ ${#MISSING_INFO[@]} -eq 0 ]; then
echo "info_complete=true" >> "$GITHUB_OUTPUT"
echo "All required information is present."
else
echo "info_complete=false" >> "$GITHUB_OUTPUT"
# Join array elements with comma
MISSING_LIST=$(IFS=','; echo "${MISSING_INFO[*]}")
echo "missing_info=$MISSING_LIST" >> "$GITHUB_OUTPUT"
echo "Missing information: $MISSING_LIST"
fi
- name: 'Comment on Issue if Information is Missing'
if: |-
${{ steps.check_info.outputs.info_complete == 'false' }}
uses: 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea' # ratchet:actions/github-script@v7
env:
MISSING_INFO: '${{ steps.check_info.outputs.missing_info }}'
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
script: |
const missingInfo = process.env.MISSING_INFO.split(',');
const missingList = missingInfo.map(item => `- ${item}`).join('\n');
const comments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});
const botComment = comments.data.find(comment =>
comment.user.type === 'Bot' &&
comment.body.includes('Missing Required Information')
);
const commentBody = `## ⚠️ Missing Required Information
Thank you for reporting this issue! To help us investigate and resolve this problem more effectively, we need some additional information:
${missingList}
### How to provide this information:
Please run the following command and paste the complete output:
\`\`\`bash
qwen
# Then in the interactive CLI, run:
/about
\`\`\`
The output should look like:
\`\`\`
CLI Version 0.0.14
Git Commit 9a0cb64a
Model coder-model
Sandbox no sandbox
OS darwin
Auth Method qwen-oauth
\`\`\`
Once you provide this information, we'll be able to assist you better. Thank you! 🙏`;
if (botComment) {
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: botComment.id,
body: commentBody
});
console.log('Updated existing comment about missing information.');
} else {
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: commentBody
});
console.log('Created new comment about missing information.');
}
- name: 'Add status/need-information Label'
if: |-
${{ steps.check_info.outputs.info_complete == 'false' }}
uses: 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea' # ratchet:actions/github-script@v7
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
script: |
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['status/need-information']
});
console.log('Added status/need-information label.');
- name: 'Remove status/need-information Label if Complete'
if: |-
${{ steps.check_info.outputs.info_complete == 'true' }}
uses: 'actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea' # ratchet:actions/github-script@v7
continue-on-error: true
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
script: |
try {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'status/need-information'
});
console.log('Removed status/need-information label as information is now complete.');
} catch (error) {
if (error.status === 404) {
console.log('Label not found on issue, nothing to remove.');
} else {
throw error;
}
}

View File

@@ -71,20 +71,20 @@ jobs:
1. Run: `gh label list --repo ${{ github.repository }} --limit 100` to get all available labels.
2. Use shell command `echo` to check the issue title and body provided in the environment variables: "${ISSUE_TITLE}" and "${ISSUE_BODY}".
3. Ignore any existing priorities or tags on the issue. Just report your findings.
4. Select the most relevant labels from the existing labels, focusing on kind/*, area/*, sub-area/* and priority/*. For area/* and kind/* limit yourself to only the single most applicable label in each case.
4. Select the most relevant labels from the existing labels, focusing on type/*, category/*, scope/*, status/* and priority/*. For category/* and type/* limit yourself to only the single most applicable label in each case.
6. Apply the selected labels to this issue using: `gh issue edit ${{ github.event.issue.number }} --repo ${{ github.repository }} --add-label "label1,label2"`.
7. For each issue please check if CLI version is present, this is usually in the output of the /about command and will look like 0.1.5 for anything more than 6 versions older than the most recent should add the status/need-retesting label.
8. If you see that the issue doesn't look like it has sufficient information recommend the status/need-information label.
9. Use Area definitions mentioned below to help you narrow down issues.
9. Use Category and Scope definitions mentioned below to help you narrow down issues.
## Guidelines
- Only use labels that already exist in the repository
- Do not add comments or modify the issue content
- Triage only the current issue
- Identify only one area/ label
- Identify only one kind/ label
- Identify all applicable sub-area/* and priority/* labels based on the issue content. It's ok to have multiple of these
- Identify only one category/ label
- Identify only one type/ label
- Identify all applicable scope/*, status/* and priority/* labels based on the issue content. It's ok to have multiple of these
- Once you categorize the issue if it needs information bump down the priority by 1 eg.. a p0 would become a p1 a p1 would become a p2. P2 and P3 can stay as is in this scenario
- Reference all shell variables as "${VAR}" (with quotes and braces)
- Output only valid JSON format
@@ -127,45 +127,55 @@ jobs:
Things you should know:
- If users are talking about issues where the model gets downgraded from pro to flash then i want you to categorize that as a performance issue
- This product is designed to use different models eg.. using pro, downgrading to flash etc. when users report that they dont expect the model to change those would be categorized as feature requests.
Definition of Areas
area/ux:
- Issues concerning user-facing elements like command usability, interactive features, help docs, and perceived performance.
- I am seeing my screen flicker when using Gemini CLI
- I am seeing the output malformed
- Theme changes aren't taking effect
- My keyboard inputs arent' being recognzied
area/platform:
- Issues related to installation, packaging, OS compatibility (Windows, macOS, Linux), and the underlying CLI framework.
area/background: Issues related to long-running background tasks, daemons, and autonomous or proactive agent features.
area/models:
- i am not getting a response that is reasonable or expected. this can include things like
- I am calling a tool and the tool is not performing as expected.
- i am expecting a tool to be called and it is not getting called ,
- Including experience when using
- built-in tools (e.g., web search, code interpreter, read file, writefile, etc..),
- Function calling issues should be under this area
- i am getting responses from the model that are malformed.
- Issues concerning Gemini quality of response and inference,
- Issues talking about unnecessary token consumption.
- Issues talking about Model getting stuck in a loop be watchful as this could be the root cause for issues that otherwise seem like model performance issues.
- Memory compression
- unexpected responses,
- poor quality of generated code
area/tools:
- These are primarily issues related to Model Context Protocol
- These are issues that mention MCP support
- feature requests asking for support for new tools.
area/core: Issues with fundamental components like command parsing, configuration management, session state, and the main API client logic. Introducing multi-modality
area/contribution: Issues related to improving the developer contribution experience, such as CI/CD pipelines, build scripts, and test automation infrastructure.
area/authentication: Issues related to user identity, login flows, API key handling, credential storage, and access token management, unable to sign in selecting wrong authentication path etc..
area/security-privacy: Issues concerning vulnerability patching, dependency security, data sanitization, privacy controls, and preventing unauthorized data access.
area/extensibility: Issues related to the plugin system, extension APIs, or making the CLI's functionality available in other applications, github actions, ide support etc..
area/performance: Issues focused on model performance
- Issues with running out of capacity,
- 429 errors etc..
- could also pertain to latency,
- other general software performance like, memory usage, CPU consumption, and algorithmic efficiency.
- Switching models from one to the other unexpectedly.
Definition of Categories and Scopes
category/cli: Command line interface and interaction
- Issues with interactive CLI features, command parsing, keyboard shortcuts
- Related scopes: scope/commands, scope/interactive, scope/non-interactive, scope/keybindings
category/core: Core engine and logic
- Issues with fundamental components, content generation, session management
- Related scopes: scope/content-generation, scope/token-management, scope/session-management, scope/model-switching
category/ui: User interface and display
- Issues with themes, UI components, rendering, markdown display
- Related scopes: scope/themes, scope/components, scope/rendering, scope/markdown
category/authentication: Authentication and authorization
- Issues with login flows, API keys, OAuth, credential storage
- Related scopes: scope/oauth, scope/api-keys, scope/token-storage, scope/google-auth
category/tools: Tool integration and execution
- Issues with MCP, shell execution, file operations, web search, memory, git integration
- Related scopes: scope/mcp, scope/shell, scope/file-operations, scope/web-search, scope/memory, scope/git
category/configuration: Configuration management
- Issues with settings, extensions, trusted folders, sandbox configuration
- Related scopes: scope/settings, scope/extensions, scope/trusted-folders, scope/sandbox
category/integration: External integrations
- Issues with IDE integration, VSCode extension, Zed integration, GitHub Actions
- Related scopes: scope/ide, scope/vscode, scope/zed, scope/github-actions
category/platform: Platform compatibility
- Issues with installation, OS compatibility, packaging
- Related scopes: scope/installation, scope/macos, scope/windows, scope/linux, scope/packaging
category/performance: Performance and optimization
- Issues with latency, memory usage, model performance, caching
- Related scopes: scope/latency, scope/memory-usage, scope/model-performance, scope/caching
category/security: Security and privacy
- Issues with data privacy, credential security, vulnerabilities
- Related scopes: scope/data-privacy, scope/credential-security, scope/vulnerability
category/telemetry: Telemetry and analytics
- Issues with metrics collection, logging, analytics
- Related scopes: scope/metrics, scope/logging, scope/analytics
category/development: Development experience
- Issues with build system, testing, CI/CD, documentation
- Related scopes: scope/build-system, scope/testing, scope/ci-cd, scope/documentation
- name: 'Post Issue Analysis Failure Comment'
if: |-

View File

@@ -84,16 +84,16 @@ jobs:
2. Use shell command `echo` to check environment variable for issues to triage: $ISSUES_TO_TRIAGE (JSON array of issues)
3. Review the issue title, body and any comments provided in the environment variables.
4. Ignore any existing priorities or tags on the issue.
5. Select the most relevant labels from the existing labels, focusing on kind/*, area/*, sub-area/* and priority/*.
5. Select the most relevant labels from the existing labels, focusing on type/*, category/*, scope/*, status/* and priority/*.
6. Get the list of labels already on the issue using `gh issue view ISSUE_NUMBER --repo ${{ github.repository }} --json labels -t '{{range .labels}}{{.name}}{{"\n"}}{{end}}'
7. For area/* and kind/* limit yourself to only the single most applicable label in each case.
7. For category/* and type/* limit yourself to only the single most applicable label in each case.
8. Give me a single short paragraph about why you are selecting each label in the process. use the format Issue ID: , Title, Label applied:, Label removed, ovearll explanation
9. Parse the JSON array from step 2 and for EACH INDIVIDUAL issue, apply appropriate labels using separate commands:
- `gh issue edit ISSUE_NUMBER --repo ${{ github.repository }} --add-label "label1"`
- `gh issue edit ISSUE_NUMBER --repo ${{ github.repository }} --add-label "label2"`
- Continue for each label separately
- IMPORTANT: Label each issue individually, one command per issue, one label at a time if needed.
- Make sure after you apply labels there is only one area/* and one kind/* label per issue.
- Make sure after you apply labels there is only one category/* and one type/* label per issue.
- To do this look for labels found in step 6 that no longer apply remove them one at a time using
- `gh issue edit ISSUE_NUMBER --repo ${{ github.repository }} --remove-label "label-name1"`
- `gh issue edit ISSUE_NUMBER --repo ${{ github.repository }} --remove-label "label-name2"`
@@ -113,9 +113,9 @@ jobs:
- Do not add comments or modify the issue content.
- Do not remove labels titled help wanted or good first issue.
- Triage only the current issue.
- Identify only one area/ label
- Identify only one kind/ label (Do not apply kind/duplicate or kind/parent-issue)
- Identify all applicable sub-area/* and priority/* labels based on the issue content. It's ok to have multiple of these.
- Identify only one category/ label
- Identify only one type/ label (Do not apply type/duplicate or type/parent-issue)
- Identify all applicable scope/*, status/* and priority/* labels based on the issue content. It's ok to have multiple of these.
- Once you categorize the issue if it needs information bump down the priority by 1 eg.. a p0 would become a p1 a p1 would become a p2. P2 and P3 can stay as is in this scenario.
Categorization Guidelines:
P0: Critical / Blocker
@@ -157,48 +157,52 @@ jobs:
- If users are talking about issues where the model gets downgraded from pro to flash then i want you to categorize that as a performance issue
- This product is designed to use different models eg.. using pro, downgrading to flash etc.
- When users report that they dont expect the model to change those would be categorized as feature requests.
Definition of Areas
area/ux:
- Issues concerning user-facing elements like command usability, interactive features, help docs, and perceived performance.
- I am seeing my screen flicker when using Gemini CLI
- I am seeing the output malformed
- Theme changes aren't taking effect
- My keyboard inputs arent' being recognzied
area/platform:
- Issues related to installation, packaging, OS compatibility (Windows, macOS, Linux), and the underlying CLI framework.
area/background: Issues related to long-running background tasks, daemons, and autonomous or proactive agent features.
area/models:
- i am not getting a response that is reasonable or expected. this can include things like
- I am calling a tool and the tool is not performing as expected.
- i am expecting a tool to be called and it is not getting called ,
- Including experience when using
- built-in tools (e.g., web search, code interpreter, read file, writefile, etc..),
- Function calling issues should be under this area
- i am getting responses from the model that are malformed.
- Issues concerning Gemini quality of response and inference,
- Issues talking about unnecessary token consumption.
- Issues talking about Model getting stuck in a loop be watchful as this could be the root cause for issues that otherwise seem like model performance issues.
- Memory compression
- unexpected responses,
- poor quality of generated code
area/tools:
- These are primarily issues related to Model Context Protocol
- These are issues that mention MCP support
- feature requests asking for support for new tools.
area/core:
- Issues with fundamental components like command parsing, configuration management, session state, and the main API client logic. Introducing multi-modality
area/contribution:
- Issues related to improving the developer contribution experience, such as CI/CD pipelines, build scripts, and test automation infrastructure.
area/authentication:
- Issues related to user identity, login flows, API key handling, credential storage, and access token management, unable to sign in selecting wrong authentication path etc..
area/security-privacy:
- Issues concerning vulnerability patching, dependency security, data sanitization, privacy controls, and preventing unauthorized data access.
area/extensibility:
- Issues related to the plugin system, extension APIs, or making the CLI's functionality available in other applications, github actions, ide support etc..
area/performance:
- Issues focused on model performance
- Issues with running out of capacity,
- 429 errors etc..
- could also pertain to latency,
- other general software performance like, memory usage, CPU consumption, and algorithmic efficiency.
- Switching models from one to the other unexpectedly.
Definition of Categories and Scopes
category/cli: Command line interface and interaction
- Issues with interactive CLI features, command parsing, keyboard shortcuts
- Related scopes: scope/commands, scope/interactive, scope/non-interactive, scope/keybindings
category/core: Core engine and logic
- Issues with fundamental components, content generation, session management
- Related scopes: scope/content-generation, scope/token-management, scope/session-management, scope/model-switching
category/ui: User interface and display
- Issues with themes, UI components, rendering, markdown display
- Related scopes: scope/themes, scope/components, scope/rendering, scope/markdown
category/authentication: Authentication and authorization
- Issues with login flows, API keys, OAuth, credential storage
- Related scopes: scope/oauth, scope/api-keys, scope/token-storage, scope/google-auth
category/tools: Tool integration and execution
- Issues with MCP, shell execution, file operations, web search, memory, git integration
- Related scopes: scope/mcp, scope/shell, scope/file-operations, scope/web-search, scope/memory, scope/git
category/configuration: Configuration management
- Issues with settings, extensions, trusted folders, sandbox configuration
- Related scopes: scope/settings, scope/extensions, scope/trusted-folders, scope/sandbox
category/integration: External integrations
- Issues with IDE integration, VSCode extension, Zed integration, GitHub Actions
- Related scopes: scope/ide, scope/vscode, scope/zed, scope/github-actions
category/platform: Platform compatibility
- Issues with installation, OS compatibility, packaging
- Related scopes: scope/installation, scope/macos, scope/windows, scope/linux, scope/packaging
category/performance: Performance and optimization
- Issues with latency, memory usage, model performance, caching
- Related scopes: scope/latency, scope/memory-usage, scope/model-performance, scope/caching
category/security: Security and privacy
- Issues with data privacy, credential security, vulnerabilities
- Related scopes: scope/data-privacy, scope/credential-security, scope/vulnerability
category/telemetry: Telemetry and analytics
- Issues with metrics collection, logging, analytics
- Related scopes: scope/metrics, scope/logging, scope/analytics
category/development: Development experience
- Issues with build system, testing, CI/CD, documentation
- Related scopes: scope/build-system, scope/testing, scope/ci-cd, scope/documentation

181
scripts/create-labels.sh Executable file
View File

@@ -0,0 +1,181 @@
#!/usr/bin/env bash
set -euo pipefail
# GitHub Label Management Script
# This script creates all labels for the new label system
# WARNING: Only run this after updating all workflows!
REPO="${GITHUB_REPOSITORY:-QwenLM/qwen-code}"
# Color definitions - organized by category
# Status colors (orange tones)
COLOR_STATUS_NEEDS_TRIAGE="ff9500"
COLOR_STATUS_IN_PROGRESS="ff7b00"
COLOR_STATUS_IN_REVIEW="e6a23c"
COLOR_STATUS_BLOCKED="d73a49"
COLOR_STATUS_WAITING="f0ad4e"
COLOR_STATUS_NEED_INFO="ff8c42"
COLOR_STATUS_NEED_RETEST="ff6b35"
COLOR_STATUS_STALE="cccccc"
COLOR_STATUS_READY="28a745"
COLOR_STATUS_ON_HOLD="6c757d"
# Type colors (multi-color)
COLOR_TYPE_BUG="d73a49"
COLOR_TYPE_FEATURE="0366d6"
COLOR_TYPE_DOCS="7057ff"
COLOR_TYPE_QUESTION="d876e3"
COLOR_TYPE_SUPPORT="28a745"
# Priority colors (red gradient)
COLOR_PRIORITY_P0="b60205"
COLOR_PRIORITY_P1="d93f0b"
COLOR_PRIORITY_P2="fbca04"
COLOR_PRIORITY_P3="0e8a16"
# Category colors (blue)
COLOR_CATEGORY="0052cc"
# Scope colors (dark blue)
COLOR_SCOPE="003d99"
echo "🏷️ Creating labels for repository: ${REPO}"
# Function to create a label if it doesn't exist
create_label() {
local name="$1"
local description="$2"
local color="$3"
echo "Creating label: ${name}"
if gh label create "${name}" --description "${description}" --color "${color}" --repo "${REPO}" 2>/dev/null; then
echo "✅ Created: ${name}"
else
echo " Label already exists or failed to create: ${name}"
fi
}
echo "📋 Creating Status labels (orange tones)..."
create_label "status/needs-triage" "Needs to be triaged and labeled" "${COLOR_STATUS_NEEDS_TRIAGE}"
create_label "status/in-progress" "Currently being worked on" "${COLOR_STATUS_IN_PROGRESS}"
create_label "status/in-review" "Under review or discussion" "${COLOR_STATUS_IN_REVIEW}"
create_label "status/blocked" "Blocked by external dependency" "${COLOR_STATUS_BLOCKED}"
create_label "status/waiting-for-feedback" "Waiting for user/maintainer feedback" "${COLOR_STATUS_WAITING}"
create_label "status/need-information" "More information needed" "${COLOR_STATUS_NEED_INFO}"
create_label "status/need-retesting" "Needs retesting on latest version" "${COLOR_STATUS_NEED_RETEST}"
create_label "status/stale" "No activity for extended period" "${COLOR_STATUS_STALE}"
create_label "status/ready-for-merge" "Ready to be merged" "${COLOR_STATUS_READY}"
create_label "status/on-hold" "Temporarily paused" "${COLOR_STATUS_ON_HOLD}"
echo "🔍 Creating Type labels (multi-color)..."
create_label "type/bug" "Something isn't working as expected" "${COLOR_TYPE_BUG}"
create_label "type/feature-request" "New feature or enhancement request" "${COLOR_TYPE_FEATURE}"
create_label "type/documentation" "Documentation improvements or additions" "${COLOR_TYPE_DOCS}"
create_label "type/question" "Further information is requested" "${COLOR_TYPE_QUESTION}"
create_label "type/support" "User support and help requests" "${COLOR_TYPE_SUPPORT}"
echo "🔥 Creating Priority labels (red gradient)..."
create_label "priority/P0" "Critical/Blocker - Catastrophic failure requiring immediate attention" "${COLOR_PRIORITY_P0}"
create_label "priority/P1" "High Priority - Serious issue with significant user impact" "${COLOR_PRIORITY_P1}"
create_label "priority/P2" "Medium Priority - Moderate impact with available workaround" "${COLOR_PRIORITY_P2}"
create_label "priority/P3" "Low Priority - Minor issue, cosmetic, nice-to-fix" "${COLOR_PRIORITY_P3}"
echo "🔵 Creating Category labels (blue)..."
create_label "category/cli" "Command line interface and interaction" "${COLOR_CATEGORY}"
create_label "category/core" "Core engine and logic" "${COLOR_CATEGORY}"
create_label "category/ui" "User interface and display" "${COLOR_CATEGORY}"
create_label "category/authentication" "Authentication and authorization" "${COLOR_CATEGORY}"
create_label "category/tools" "Tool integration and execution" "${COLOR_CATEGORY}"
create_label "category/configuration" "Configuration management" "${COLOR_CATEGORY}"
create_label "category/integration" "External integrations" "${COLOR_CATEGORY}"
create_label "category/platform" "Platform compatibility" "${COLOR_CATEGORY}"
create_label "category/performance" "Performance and optimization" "${COLOR_CATEGORY}"
create_label "category/security" "Security and privacy" "${COLOR_CATEGORY}"
create_label "category/telemetry" "Telemetry and analytics" "${COLOR_CATEGORY}"
create_label "category/development" "Development experience" "${COLOR_CATEGORY}"
echo "🔷 Creating Scope labels (dark blue)..."
# CLI related scopes
create_label "scope/commands" "Command implementation" "${COLOR_SCOPE}"
create_label "scope/interactive" "Interactive CLI features" "${COLOR_SCOPE}"
create_label "scope/non-interactive" "Non-interactive mode" "${COLOR_SCOPE}"
create_label "scope/keybindings" "Keyboard shortcuts and bindings" "${COLOR_SCOPE}"
# Core related scopes
create_label "scope/content-generation" "AI content generation" "${COLOR_SCOPE}"
create_label "scope/token-management" "Token handling and limits" "${COLOR_SCOPE}"
create_label "scope/session-management" "Session state and persistence" "${COLOR_SCOPE}"
create_label "scope/model-switching" "Model selection and switching" "${COLOR_SCOPE}"
# UI related scopes
create_label "scope/themes" "Theme system and customization" "${COLOR_SCOPE}"
create_label "scope/components" "UI components and widgets" "${COLOR_SCOPE}"
create_label "scope/rendering" "Display and rendering logic" "${COLOR_SCOPE}"
create_label "scope/markdown" "Markdown parsing and display" "${COLOR_SCOPE}"
# Authentication related scopes
create_label "scope/oauth" "OAuth authentication flows" "${COLOR_SCOPE}"
create_label "scope/api-keys" "API key management" "${COLOR_SCOPE}"
create_label "scope/token-storage" "Token storage and retrieval" "${COLOR_SCOPE}"
create_label "scope/google-auth" "Google-specific authentication" "${COLOR_SCOPE}"
# Tools related scopes
create_label "scope/mcp" "Model Context Protocol" "${COLOR_SCOPE}"
create_label "scope/shell" "Shell command execution" "${COLOR_SCOPE}"
create_label "scope/file-operations" "File system operations" "${COLOR_SCOPE}"
create_label "scope/web-search" "Web search functionality" "${COLOR_SCOPE}"
create_label "scope/memory" "Memory and context management" "${COLOR_SCOPE}"
create_label "scope/git" "Git integration features" "${COLOR_SCOPE}"
# Configuration related scopes
create_label "scope/settings" "Settings and preferences" "${COLOR_SCOPE}"
create_label "scope/extensions" "Extension configuration" "${COLOR_SCOPE}"
create_label "scope/trusted-folders" "Trusted folder management" "${COLOR_SCOPE}"
create_label "scope/sandbox" "Sandbox configuration" "${COLOR_SCOPE}"
# Integration related scopes
create_label "scope/ide" "IDE integration general" "${COLOR_SCOPE}"
create_label "scope/vscode" "VSCode extension specific" "${COLOR_SCOPE}"
create_label "scope/zed" "Zed editor integration" "${COLOR_SCOPE}"
create_label "scope/github-actions" "GitHub Actions integration" "${COLOR_SCOPE}"
# Platform related scopes
create_label "scope/installation" "Installation process" "${COLOR_SCOPE}"
create_label "scope/macos" "macOS specific issues" "${COLOR_SCOPE}"
create_label "scope/windows" "Windows specific issues" "${COLOR_SCOPE}"
create_label "scope/linux" "Linux specific issues" "${COLOR_SCOPE}"
create_label "scope/packaging" "Package distribution" "${COLOR_SCOPE}"
# Performance related scopes
create_label "scope/latency" "Response time optimization" "${COLOR_SCOPE}"
create_label "scope/memory-usage" "Memory consumption" "${COLOR_SCOPE}"
create_label "scope/model-performance" "AI model performance" "${COLOR_SCOPE}"
create_label "scope/caching" "Caching mechanisms" "${COLOR_SCOPE}"
# Security related scopes
create_label "scope/data-privacy" "Data privacy concerns" "${COLOR_SCOPE}"
create_label "scope/credential-security" "Credential security" "${COLOR_SCOPE}"
create_label "scope/vulnerability" "Security vulnerabilities" "${COLOR_SCOPE}"
# Telemetry related scopes
create_label "scope/metrics" "Metrics collection" "${COLOR_SCOPE}"
create_label "scope/logging" "Logging systems" "${COLOR_SCOPE}"
create_label "scope/analytics" "Usage analytics" "${COLOR_SCOPE}"
# Development related scopes
create_label "scope/build-system" "Build and compilation" "${COLOR_SCOPE}"
create_label "scope/testing" "Test frameworks and cases" "${COLOR_SCOPE}"
create_label "scope/ci-cd" "Continuous integration/deployment" "${COLOR_SCOPE}"
create_label "scope/documentation" "Documentation tooling" "${COLOR_SCOPE}"
echo "✅ Label creation completed!"
echo ""
echo "⚠️ IMPORTANT: Before running this script, make sure:"
echo " 1. All GitHub Actions workflows have been updated"
echo " 2. Issue templates have been updated"
echo " 3. You have reviewed the label migration plan"
echo ""
echo "🔄 Next steps:"
echo " 1. Run migrate-labels.sh to update existing issues"
echo " 2. Verify all labels are correctly applied"

112
scripts/migrate-labels.sh Executable file
View File

@@ -0,0 +1,112 @@
#!/usr/bin/env bash
set -euo pipefail
# GitHub Label Migration Script
# This script migrates existing labels to the new label system
# WARNING: Only run this after creating new labels!
REPO="${GITHUB_REPOSITORY:-QwenLM/qwen-code}"
# Color definitions - must match create-labels.sh
# Status colors (orange tones)
COLOR_STATUS_NEEDS_TRIAGE="ff9500"
# Type colors (multi-color)
COLOR_TYPE_BUG="d73a49"
COLOR_TYPE_FEATURE="0366d6"
COLOR_TYPE_DOCS="7057ff"
COLOR_TYPE_QUESTION="d876e3"
COLOR_TYPE_SUPPORT="28a745"
# Category colors (blue)
COLOR_CATEGORY="0052cc"
# Scope colors (dark blue)
COLOR_SCOPE="003d99"
echo "🔄 Migrating labels for repository: ${REPO}"
# Function to migrate a label (rename existing label)
migrate_label() {
local old_name="$1"
local new_name="$2"
local description="$3"
local color="$4"
echo "Migrating: ${old_name}${new_name}"
if gh label edit "${old_name}" --name "${new_name}" --description "${description}" --color "${color}" --repo "${REPO}" 2>/dev/null; then
echo "✅ Migrated: ${old_name}${new_name}"
else
echo "⚠️ Failed to migrate or label doesn't exist: ${old_name}"
fi
}
# Function to delete a label
delete_label() {
local name="$1"
echo "Deleting obsolete label: ${name}"
if gh label delete "${name}" --yes --repo "${REPO}" 2>/dev/null; then
echo "🗑️ Deleted: ${name}"
else
echo " Label doesn't exist or failed to delete: ${name}"
fi
}
echo "📋 Migrating existing labels..."
# Migrate kind/* to type/*
migrate_label "kind/bug" "type/bug" "Something isn't working as expected" "${COLOR_TYPE_BUG}"
migrate_label "kind/feature-request" "type/feature-request" "New feature or enhancement request" "${COLOR_TYPE_FEATURE}"
migrate_label "kind/documentation" "type/documentation" "Documentation improvements or additions" "${COLOR_TYPE_DOCS}"
migrate_label "kind/question" "type/question" "Further information is requested" "${COLOR_TYPE_QUESTION}"
migrate_label "kind/support" "type/support" "User support and help requests" "${COLOR_TYPE_SUPPORT}"
# Migrate area/* to category/*
migrate_label "area/ux" "category/ui" "User interface and display" "${COLOR_CATEGORY}"
migrate_label "area/platform" "category/platform" "Platform compatibility" "${COLOR_CATEGORY}"
migrate_label "area/background" "category/core" "Core engine and logic" "${COLOR_CATEGORY}"
migrate_label "area/models" "category/core" "Core engine and logic" "${COLOR_CATEGORY}"
migrate_label "area/tools" "category/tools" "Tool integration and execution" "${COLOR_CATEGORY}"
migrate_label "area/core" "category/core" "Core engine and logic" "${COLOR_CATEGORY}"
migrate_label "area/contribution" "category/development" "Development experience" "${COLOR_CATEGORY}"
migrate_label "area/authentication" "category/authentication" "Authentication and authorization" "${COLOR_CATEGORY}"
migrate_label "area/security-privacy" "category/security" "Security and privacy" "${COLOR_CATEGORY}"
migrate_label "area/extensibility" "category/integration" "External integrations" "${COLOR_CATEGORY}"
migrate_label "area/performance" "category/performance" "Performance and optimization" "${COLOR_CATEGORY}"
# Migrate sub-area/* to scope/*
migrate_label "sub-area/cli" "scope/commands" "Command implementation" "${COLOR_SCOPE}"
migrate_label "sub-area/api" "scope/api-keys" "API key management" "${COLOR_SCOPE}"
migrate_label "sub-area/ui" "scope/components" "UI components and widgets" "${COLOR_SCOPE}"
migrate_label "sub-area/config" "scope/settings" "Settings and preferences" "${COLOR_SCOPE}"
# Update status labels to match new naming
migrate_label "status/need-triage" "status/needs-triage" "Needs to be triaged and labeled" "${COLOR_STATUS_NEEDS_TRIAGE}"
echo "🗑️ Cleaning up obsolete labels..."
# Delete legacy labels that have been replaced
delete_label "bug"
delete_label "enhancement"
delete_label "documentation"
delete_label "question"
# Delete duplicate labels
delete_label "duplicate"
delete_label "invalid"
delete_label "wontfix"
echo "✅ Label migration completed!"
echo ""
echo "📊 Summary:"
echo " - Migrated kind/* → type/*"
echo " - Migrated area/* → category/*"
echo " - Migrated sub-area/* → scope/*"
echo " - Updated status label naming"
echo " - Cleaned up obsolete legacy labels"
echo ""
echo "🔍 Next steps:"
echo " 1. Verify all labels are correctly applied"
echo " 2. Test the updated workflows"
echo " 3. Monitor issue triage effectiveness"