mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-15 08:39:49 +00:00
fix(ci): better heuristic + issue type template fix (#2672)
* fix(ci): better heuristic + issue type template fix * chore(ci): remove keywords in performance tag
This commit is contained in:
@@ -32,64 +32,48 @@ jobs:
|
||||
- uses: actions/github-script@v8
|
||||
with:
|
||||
script: |
|
||||
// Setup Input Text (Unified Title + Body)
|
||||
// Setup Input Text
|
||||
const body = (context.payload.issue.body || '');
|
||||
const title = (context.payload.issue.title || '');
|
||||
|
||||
// We keep a lowercased version for keyword matching
|
||||
const text = `${title}\n${body}`.toLowerCase();
|
||||
|
||||
const cleanBody = body.replace(/```[\s\S]*?```/g, '');
|
||||
const text = `${title}\n${cleanBody}`.toLowerCase();
|
||||
const labelsToAdd = new Set();
|
||||
|
||||
// Helper: Simple regex test
|
||||
const matches = (re) => re.test(text);
|
||||
|
||||
// Issue Type Detection (Dropdowns & Explicit Headers)
|
||||
if (text.includes('bug report') || /\bissue type:.*bug/.test(text)) {
|
||||
labelsToAdd.add('bug');
|
||||
}
|
||||
if (text.includes('feature request') || /\bissue type:.*feature/.test(text)) {
|
||||
labelsToAdd.add('enhancement');
|
||||
}
|
||||
if (text.includes('technical question') || /\bissue type:.*question/.test(text)) {
|
||||
labelsToAdd.add('question');
|
||||
}
|
||||
if (text.includes('maintenance') || /\bissue type:.*maintenance/.test(text)) {
|
||||
labelsToAdd.add('documentation');
|
||||
}
|
||||
|
||||
// Keyword Heuristic
|
||||
// Keyword Heuristics
|
||||
|
||||
// Domain Specific
|
||||
if (matches(/example(s)?\b|script(s)?\b|sample(s)?\b|demo(s)?\b|notebook(s)?\b/i)) labelsToAdd.add('examples');
|
||||
if (matches(/dataset(s)?\b|data loader|data augmentation|data preprocessing/i)) labelsToAdd.add('dataset');
|
||||
if (matches(/mujoco|isaac|\bsimulation\b|\bsim /i)) labelsToAdd.add('simulation');
|
||||
if (matches(/train|loss|optimizer|backward|gradient|wandb|sac\b/i)) labelsToAdd.add('training');
|
||||
if (matches(/rerun|plot|video|render|visualiz|gif/i)) labelsToAdd.add('visualization');
|
||||
if (matches(/camera|realsense|lidar|depth|sensor|imu|microphone|rgbd/i)) labelsToAdd.add('sensors');
|
||||
if (matches(/aloha|koch|so-100|so100|mobile|teleop|manipulator|robot(s)?\b/i)) labelsToAdd.add('robots');
|
||||
if (matches(/teleop|teleoperator|controller|leader|follower|joystick|gamepad/i)) labelsToAdd.add('teleoperators');
|
||||
if (matches(/policy|policies|p0licy/i)) labelsToAdd.add('policies');
|
||||
if (matches(/processor(s)?\b|implement.*processor|processor pipeline/i)) labelsToAdd.add('processor');
|
||||
if (matches(/eval|evaluate|evaluation|metric(s)?\b|score|benchmark/i)) labelsToAdd.add('evaluation');
|
||||
if (matches(/\b(bug|error|issue|fault|crash|exception|\b/i)) labelsToAdd.add('bug');
|
||||
if (matches(/\b(feature|enhancement|improvement|support|implement|proposal)\b/i)) labelsToAdd.add('enhancement');
|
||||
if (matches(/\b(question|help|how to||clarify|explain|unclear)\b/i)) labelsToAdd.add('question');
|
||||
if (matches(/\b(maintenance|documentation|docs|readme|tutorial|guide|wiki)\b/i)) labelsToAdd.add('documentation');
|
||||
if (matches(/\b(example|script|sample|demo|notebook)s?\b/i)) labelsToAdd.add('examples');
|
||||
if (matches(/\b(datasets?|data loader|data augmentation|data preprocessing)\b/i)) labelsToAdd.add('dataset');
|
||||
if (matches(/\b(mujoco|isaac|simulation|sim)\b/i)) labelsToAdd.add('simulation');
|
||||
if (matches(/\b(train|training|loss|optimizer|backward|gradient|wandb|sac)\b/i)) labelsToAdd.add('training');
|
||||
if (matches(/\b(rerun|plot|video|render|visualiz|gif)/i)) labelsToAdd.add('visualization');
|
||||
if (matches(/\b(camera|realsense|lidar|depth|sensor|imu|microphone|rgbd)\b/i)) labelsToAdd.add('sensors');
|
||||
if (matches(/\b(aloha|koch|so-100|so100|mobile|teleop|manipulator|robots?)\b/i)) labelsToAdd.add('robots');
|
||||
if (matches(/\b(teleop|teleoperator|controller|leader|follower|joystick|gamepad)\b/i)) labelsToAdd.add('teleoperators');
|
||||
if (matches(/\b(policy|policies|p0licy)\b/i)) labelsToAdd.add('policies');
|
||||
if (matches(/\b(processors?|pipeline)\b/i)) labelsToAdd.add('processor');
|
||||
if (matches(/\b(eval|evaluate|evaluation|metrics?|score|benchmark)\b/i)) labelsToAdd.add('evaluation');
|
||||
|
||||
// Infrastructure & Code Quality
|
||||
if (matches(/test|pytest|unittest|failing test/i)) labelsToAdd.add('tests');
|
||||
if (matches(/ci|github actions|workflow|gha|action(s)?\b|pipeline/i)) {
|
||||
if (matches(/\b(tests?|pytest|unittest|failing test)\b/i)) labelsToAdd.add('tests');
|
||||
if (matches(/\b(ci|github actions|workflow|gha|actions?|pipeline)\b/i)) {
|
||||
labelsToAdd.add('CI');
|
||||
labelsToAdd.add('github_actions');
|
||||
}
|
||||
if (matches(/perf|latency|benchmark|throughput|fps|speed|performance|benchmarking/i)) labelsToAdd.add('performance');
|
||||
if (matches(/dependency|requirements|pip|conda|install error|importerror|package not found/i)) labelsToAdd.add('dependencies');
|
||||
if (matches(/python\b|pyproject|requirements(\.txt)?|pip install|typing error/i)) labelsToAdd.add('python');
|
||||
if (matches(/\b(perf|latency|throughput|fps|speed|performance)\b/i)) labelsToAdd.add('performance');
|
||||
if (matches(/\b(dependency|requirements|pip|conda|install error|importerror|package not found)\b/i)) labelsToAdd.add('dependencies');
|
||||
if (matches(/\b(python|pyproject|requirements(\.txt)?|pip install|typing error)\b/i)) labelsToAdd.add('python');
|
||||
|
||||
// Documentation & Meta
|
||||
if (matches(/doc|documentation|docs|readme|typo|how to/i)) labelsToAdd.add('documentation');
|
||||
if (matches(/refactor|cleanup|restructure|rename|modernize code/i)) labelsToAdd.add('refactor');
|
||||
if (matches(/release|changelog|version bump|cut a release|tag v/i)) labelsToAdd.add('release');
|
||||
|
||||
// Fixed: "BREAKING CHANGE" must be lowercase in regex because 'text' is lowercase
|
||||
if (matches(/breaking change|breaking:|major change/i)) labelsToAdd.add('breaking change');
|
||||
if (matches(/\b(doc|documentation|docs|readme|typo|how to)\b/i)) labelsToAdd.add('documentation');
|
||||
if (matches(/\b(refactor|cleanup|restructure|rename|modernize code)\b/i)) labelsToAdd.add('refactor');
|
||||
if (matches(/\b(release|changelog|version bump|cut a release|tag v)\b/i)) labelsToAdd.add('release');
|
||||
if (matches(/\b(breaking change|major change)\b/i)) labelsToAdd.add('breaking change');
|
||||
|
||||
// Apply Labels
|
||||
const labels = Array.from(labelsToAdd).filter(Boolean);
|
||||
|
||||
Reference in New Issue
Block a user