Skip to content

Commit 27357ca

Browse files
fix: update plot request templates and validation checks
- Modify title format to include spec ID in plot update requests - Update documentation for title formatting and dropdown descriptions - Refine validation checks to skip update requests with existing spec IDs
1 parent 27a19b7 commit 27357ca

File tree

3 files changed

+26
-33
lines changed

3 files changed

+26
-33
lines changed

.github/ISSUE_TEMPLATE/plot-update.yml

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Plot Update
22
description: Request updates or regeneration of an existing plot
3-
title: "[update] "
3+
title: "[spec-id] [update] "
44
labels: ["plot-request", "update"]
55
body:
66
- type: markdown
@@ -11,25 +11,18 @@ body:
1111
Use this form to update or regenerate an existing plot.
1212
1313
**Title Format:**
14-
- `[update] scatter-basic` → Regenerate all 9 libraries
15-
- `[update:seaborn] scatter-basic` → Regenerate only seaborn
14+
- `[scatter-basic] [update] Regenerate` → Regenerate all 9 libraries
15+
- `[scatter-basic] [update:seaborn] Fix colors` → Regenerate only seaborn
1616
17-
After submitting, a maintainer will add the `approved` label to trigger regeneration.
17+
Replace `[spec-id]` in the title with the actual spec ID (e.g., `scatter-basic`).
1818
19-
- type: input
20-
id: spec_id
21-
attributes:
22-
label: Spec ID
23-
description: "The spec ID of the plot to update (will be appended to title)"
24-
placeholder: "scatter-basic"
25-
validations:
26-
required: true
19+
After submitting, a maintainer will add the `approved` label to trigger regeneration.
2720
2821
- type: dropdown
2922
id: target_library
3023
attributes:
3124
label: Target Library (optional)
32-
description: Update only a specific library, or leave empty for all
25+
description: Update only a specific library, or leave empty for all. If you select a specific library, change [update] to [update:library] in the title.
3326
options:
3427
- All libraries
3528
- matplotlib
@@ -50,11 +43,10 @@ body:
5043
label: Type of Update
5144
description: What kind of change is this?
5245
options:
53-
- Regenerate (use current spec)
46+
- Regenerate (use current spec with new code style)
5447
- Spec Update (describe changes below)
5548
- Bug Fix (plot doesn't render correctly)
5649
- Visual Improvement (styling, colors, layout)
57-
- Feature Addition (new parameter, option)
5850
validations:
5951
required: true
6052

.github/workflows/bot-validate-request.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,24 @@ jobs:
4949
exit 0
5050
fi
5151
52-
# Check 2: Must not already have spec ID in title
53-
# Spec ID format: [lowercase-with-hyphens] at the beginning, NOT [update...]
54-
# Valid spec-id: [scatter-basic], [line-timeseries-multi]
55-
# NOT spec-id: [update], [update:matplotlib], [Update:...]
52+
# Check 2: Skip update requests (they already have spec-id)
53+
HAS_UPDATE="${{ contains(github.event.issue.labels.*.name, 'update') }}"
54+
if [[ "$HAS_UPDATE" == "true" ]]; then
55+
echo "::notice::Skipping: Update request (spec-id already in title)"
56+
echo "should_run=false" >> $GITHUB_OUTPUT
57+
exit 0
58+
fi
59+
60+
# Check 3: Must not already have spec ID in title
61+
# Spec ID format: [lowercase-with-hyphens] at the beginning
5662
if [[ "$ISSUE_TITLE" =~ ^\[[a-z0-9-]+\] ]]; then
5763
FIRST_BRACKET=$(echo "$ISSUE_TITLE" | grep -oP '^\[\K[a-z0-9-]+(?=\])' || echo "")
58-
# Skip only if it's a valid spec-id (not an update marker)
59-
if [[ -n "$FIRST_BRACKET" && ! "$FIRST_BRACKET" =~ ^update ]]; then
60-
echo "::notice::Skipping: Issue title already has spec ID: $FIRST_BRACKET"
61-
echo "should_run=false" >> $GITHUB_OUTPUT
62-
exit 0
63-
fi
64+
echo "::notice::Skipping: Issue title already has spec ID: $FIRST_BRACKET"
65+
echo "should_run=false" >> $GITHUB_OUTPUT
66+
exit 0
6467
fi
6568
66-
# Check 3: For labeled events, only trigger when plot-request label is added
69+
# Check 4: For labeled events, only trigger when plot-request label is added
6770
if [[ "$EVENT_ACTION" == "labeled" && "$LABEL_NAME" != "plot-request" ]]; then
6871
echo "::notice::Skipping: Labeled event but not plot-request label"
6972
echo "should_run=false" >> $GITHUB_OUTPUT

.github/workflows/gen-create-spec.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
echo "is_update=true" >> $GITHUB_OUTPUT
6161
echo "::notice::This is an update request"
6262
63-
# Extract target library from title [update:library] or empty for all
63+
# Extract target library from title [spec-id] [update:library] or empty for all
6464
if [[ "$ISSUE_TITLE" =~ \[update:([a-z]+)\] ]]; then
6565
TARGET_LIB="${BASH_REMATCH[1]}"
6666
echo "target_library=$TARGET_LIB" >> $GITHUB_OUTPUT
@@ -120,13 +120,11 @@ jobs:
120120
SPEC_ID=$(echo "$COMMENTS" | grep -oP '\*\*Existing Spec:\*\* `\K[a-z0-9-]+(?=`)' | tail -1 || echo "")
121121
fi
122122
123-
# Fallback: extract from title if in brackets [spec-id]
124-
# Must be at the beginning and NOT an update marker
123+
# Fallback: extract from title - spec-id is always first bracket
124+
# Format: [spec-id] ... or [spec-id] [update] ... or [spec-id] [update:lib] ...
125125
if [ -z "$SPEC_ID" ]; then
126-
FIRST_BRACKET=$(echo "$ISSUE_TITLE" | grep -oP '^\[\K[a-z0-9-]+(?=\])' || echo "")
127-
# Only use if it's not an update marker
128-
if [[ -n "$FIRST_BRACKET" && ! "$FIRST_BRACKET" =~ ^update ]]; then
129-
SPEC_ID="$FIRST_BRACKET"
126+
if [[ "$ISSUE_TITLE" =~ ^\[([a-z0-9-]+)\] ]]; then
127+
SPEC_ID="${BASH_REMATCH[1]}"
130128
fi
131129
fi
132130

0 commit comments

Comments
 (0)