mirror of
https://github.com/tiennm99/litellm.git
synced 2026-06-18 03:31:23 +00:00
e34e8b4650
* Fix component label automation to prevent false positives
The GitHub Actions workflow was applying component labels (SDK, Proxy, UI Dashboard, Docs) too broadly by only checking if the component name appeared anywhere in the issue body. This caused issues to be mislabeled when users mentioned these terms in their descriptions.
Changes:
- Add more specific condition that checks for both the dropdown field header "What part of LiteLLM is this about?" AND the component name
- Applied to all 4 component labels: SDK, Proxy, UI Dashboard, and Docs
- Labels will now only be applied when users actually select the option from the dropdown
Fixes issues being incorrectly labeled with 'docs' and other component labels.
* Use more specific pattern to match dropdown selection exactly
Updated the label conditions to use a more precise pattern that matches
the dropdown header immediately followed by the selected value. This
prevents false positives when users mention component names in their
descriptions but select a different component.
Before: Checked for header AND component name anywhere in body
After: Checks for exact pattern "header\n\ncomponent"
This ensures labels are only applied when the component is actually
selected from the dropdown, not just mentioned in the issue text.
* Fix component label automation and require explicit user selection
This PR fixes two issues with component labeling:
1. **Improved label accuracy**: Updated the workflow to use exact pattern
matching ("### What part of LiteLLM is this about?\n\nDocs") instead of
broad substring matching. This prevents false positives where issues were
mislabeled when users mentioned component names in their descriptions.
2. **Require explicit component selection**: Added empty string ('') as the
first dropdown option to prevent GitHub from auto-selecting "SDK" as the
default. Users must now consciously select which component their issue
relates to.
Changes:
- Updated all component label conditions in label-component.yml workflow
- Added empty string as first option in bug_report.yml dropdown
- Added empty string as first option in feature_request.yml dropdown
- Labels only apply when users actually select a component from the dropdown
This ensures accurate labeling and prevents the default SDK label from
being applied to all new issues.
145 lines
4.8 KiB
YAML
145 lines
4.8 KiB
YAML
name: Label Component Issues
|
|
|
|
on:
|
|
issues:
|
|
types:
|
|
- opened
|
|
|
|
jobs:
|
|
add-component-label:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
issues: write
|
|
steps:
|
|
- name: Add SDK label
|
|
if: contains(github.event.issue.body, 'What part of LiteLLM is this about?\n\nSDK (litellm Python package)')
|
|
uses: actions/github-script@v7
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
script: |
|
|
const labelName = 'sdk';
|
|
try {
|
|
await github.rest.issues.getLabel({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
name: labelName
|
|
});
|
|
} catch (error) {
|
|
if (error.status === 404) {
|
|
await github.rest.issues.createLabel({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
name: labelName,
|
|
color: '0E7C86',
|
|
description: 'Issues related to the litellm Python SDK'
|
|
});
|
|
} else {
|
|
throw error;
|
|
}
|
|
}
|
|
await github.rest.issues.addLabels({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.issue.number,
|
|
labels: [labelName]
|
|
});
|
|
|
|
- name: Add Proxy label
|
|
if: contains(github.event.issue.body, 'What part of LiteLLM is this about?\n\nProxy')
|
|
uses: actions/github-script@v7
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
script: |
|
|
const labelName = 'proxy';
|
|
try {
|
|
await github.rest.issues.getLabel({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
name: labelName
|
|
});
|
|
} catch (error) {
|
|
if (error.status === 404) {
|
|
await github.rest.issues.createLabel({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
name: labelName,
|
|
color: '5319E7',
|
|
description: 'Issues related to the LiteLLM Proxy'
|
|
});
|
|
} else {
|
|
throw error;
|
|
}
|
|
}
|
|
await github.rest.issues.addLabels({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.issue.number,
|
|
labels: [labelName]
|
|
});
|
|
|
|
- name: Add UI Dashboard label
|
|
if: contains(github.event.issue.body, 'What part of LiteLLM is this about?\n\nUI Dashboard')
|
|
uses: actions/github-script@v7
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
script: |
|
|
const labelName = 'ui-dashboard';
|
|
try {
|
|
await github.rest.issues.getLabel({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
name: labelName
|
|
});
|
|
} catch (error) {
|
|
if (error.status === 404) {
|
|
await github.rest.issues.createLabel({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
name: labelName,
|
|
color: 'D876E3',
|
|
description: 'Issues related to the LiteLLM UI Dashboard'
|
|
});
|
|
} else {
|
|
throw error;
|
|
}
|
|
}
|
|
await github.rest.issues.addLabels({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.issue.number,
|
|
labels: [labelName]
|
|
});
|
|
|
|
- name: Add Docs label
|
|
if: contains(github.event.issue.body, 'What part of LiteLLM is this about?\n\nDocs')
|
|
uses: actions/github-script@v7
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
script: |
|
|
const labelName = 'docs';
|
|
try {
|
|
await github.rest.issues.getLabel({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
name: labelName
|
|
});
|
|
} catch (error) {
|
|
if (error.status === 404) {
|
|
await github.rest.issues.createLabel({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
name: labelName,
|
|
color: 'FBCA04',
|
|
description: 'Issues related to LiteLLM documentation'
|
|
});
|
|
} else {
|
|
throw error;
|
|
}
|
|
}
|
|
await github.rest.issues.addLabels({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
issue_number: context.issue.number,
|
|
labels: [labelName]
|
|
});
|