2121 outputs :
2222 should_run : ${{ steps.check.outputs.should_run }}
2323 spec_id : ${{ steps.extract_spec.outputs.spec_id }}
24+ is_update : ${{ steps.extract_spec.outputs.is_update }}
25+ target_library : ${{ steps.extract_spec.outputs.target_library }}
2426
2527 steps :
2628 - name : Check conditions
6365 ISSUE_BODY : ${{ github.event.issue.body }}
6466 ISSUE_TITLE : ${{ github.event.issue.title }}
6567 run : |
68+ # Check for [update] or [update:library] prefix in title
69+ IS_UPDATE="false"
70+ TARGET_LIBRARY=""
71+
72+ if echo "$ISSUE_TITLE" | grep -qiP '^\[update(:[a-z]+)?\]'; then
73+ IS_UPDATE="true"
74+ # Extract target library if specified (e.g., [update:seaborn])
75+ TARGET_LIBRARY=$(echo "$ISSUE_TITLE" | grep -oiP '^\[update:\K[a-z]+(?=\])' | tr '[:upper:]' '[:lower:]' || echo "")
76+ # Remove [update...] prefix from title for spec ID extraction
77+ CLEAN_TITLE=$(echo "$ISSUE_TITLE" | sed 's/^\[update[^]]*\]\s*//')
78+ echo "::notice::Update mode detected. Target library: ${TARGET_LIBRARY:-all}"
79+ else
80+ CLEAN_TITLE="$ISSUE_TITLE"
81+ fi
82+
83+ # Validate TARGET_LIBRARY if specified
84+ if [ -n "$TARGET_LIBRARY" ]; then
85+ VALID_LIBS="matplotlib seaborn plotly bokeh altair plotnine pygal highcharts"
86+ if ! echo "$VALID_LIBS" | grep -qw "$TARGET_LIBRARY"; then
87+ echo "::error::Invalid library '$TARGET_LIBRARY'. Must be one of: $VALID_LIBS"
88+ exit 1
89+ fi
90+ fi
6691 # Check if issue was marked as duplicate
6792 COMMENTS=$(gh issue view ${{ github.event.issue.number }} --json comments -q '.comments[].body')
6893
7196 exit 1
7297 fi
7398
99+ # For updates, try to extract spec ID from cleaned title first
100+ if [ "$IS_UPDATE" == "true" ]; then
101+ SPEC_ID=$(echo "$CLEAN_TITLE" | grep -oiP '^[a-z]+-[a-z]+(-[a-z0-9]+)?' | tr '[:upper:]' '[:lower:]' || echo "")
102+ fi
103+
74104 # Extract spec ID from issue comments (assigned by validate-plot-request workflow)
75- SPEC_ID=$(echo "$COMMENTS" | grep -oP '\*\*Assigned ID:\*\* `\K[a-z0-9-]+(?=`)' | tail -1 || echo "")
105+ if [ -z "$SPEC_ID" ]; then
106+ SPEC_ID=$(echo "$COMMENTS" | grep -oP '\*\*Assigned ID:\*\* `\K[a-z0-9-]+(?=`)' | tail -1 || echo "")
107+ fi
76108
77109 if [ -z "$SPEC_ID" ]; then
78110 SPEC_ID=$(echo "$COMMENTS" | grep -oP '\*\*Existing Spec:\*\* `\K[a-z0-9-]+(?=`)' | tail -1 || echo "")
92124 fi
93125
94126 echo "spec_id=$SPEC_ID" >> $GITHUB_OUTPUT
95- echo "::notice::Extracted spec ID: $SPEC_ID"
127+ echo "is_update=$IS_UPDATE" >> $GITHUB_OUTPUT
128+ echo "target_library=$TARGET_LIBRARY" >> $GITHUB_OUTPUT
129+ echo "::notice::Extracted spec ID: $SPEC_ID (update=$IS_UPDATE, target=$TARGET_LIBRARY)"
96130
97131 # ============================================================================
98132 # Step 2: Create sub-issues for each library
@@ -169,7 +203,7 @@ jobs:
169203 SUB_ISSUE=$(gh issue create \
170204 --title "[$SPEC_ID] $LIBRARY implementation" \
171205 --body "$SUB_BODY" \
172- --label "library:$LIBRARY,sub-issue ,generating")
206+ --label "library:$LIBRARY,plot-request:impl ,generating")
173207
174208 SUB_NUM=$(echo "$SUB_ISSUE" | grep -oP '\d+$')
175209 SUB_NODE_ID=$(gh api repos/${{ github.repository }}/issues/$SUB_NUM --jq '.node_id')
@@ -191,7 +225,10 @@ jobs:
191225 # ============================================================================
192226 generate-matplotlib :
193227 needs : [check-conditions, create-sub-issues]
194- if : needs.check-conditions.outputs.should_run == 'true'
228+ if : |
229+ needs.check-conditions.outputs.should_run == 'true' &&
230+ (needs.check-conditions.outputs.target_library == '' ||
231+ needs.check-conditions.outputs.target_library == 'matplotlib')
195232 uses : ./.github/workflows/gen-library-impl.yml
196233 with :
197234 spec_id : ${{ needs.check-conditions.outputs.spec_id }}
@@ -204,7 +241,10 @@ jobs:
204241
205242 generate-seaborn :
206243 needs : [check-conditions, create-sub-issues]
207- if : needs.check-conditions.outputs.should_run == 'true'
244+ if : |
245+ needs.check-conditions.outputs.should_run == 'true' &&
246+ (needs.check-conditions.outputs.target_library == '' ||
247+ needs.check-conditions.outputs.target_library == 'seaborn')
208248 uses : ./.github/workflows/gen-library-impl.yml
209249 with :
210250 spec_id : ${{ needs.check-conditions.outputs.spec_id }}
@@ -217,7 +257,10 @@ jobs:
217257
218258 generate-plotly :
219259 needs : [check-conditions, create-sub-issues]
220- if : needs.check-conditions.outputs.should_run == 'true'
260+ if : |
261+ needs.check-conditions.outputs.should_run == 'true' &&
262+ (needs.check-conditions.outputs.target_library == '' ||
263+ needs.check-conditions.outputs.target_library == 'plotly')
221264 uses : ./.github/workflows/gen-library-impl.yml
222265 with :
223266 spec_id : ${{ needs.check-conditions.outputs.spec_id }}
@@ -230,7 +273,10 @@ jobs:
230273
231274 generate-bokeh :
232275 needs : [check-conditions, create-sub-issues]
233- if : needs.check-conditions.outputs.should_run == 'true'
276+ if : |
277+ needs.check-conditions.outputs.should_run == 'true' &&
278+ (needs.check-conditions.outputs.target_library == '' ||
279+ needs.check-conditions.outputs.target_library == 'bokeh')
234280 uses : ./.github/workflows/gen-library-impl.yml
235281 with :
236282 spec_id : ${{ needs.check-conditions.outputs.spec_id }}
@@ -243,7 +289,10 @@ jobs:
243289
244290 generate-altair :
245291 needs : [check-conditions, create-sub-issues]
246- if : needs.check-conditions.outputs.should_run == 'true'
292+ if : |
293+ needs.check-conditions.outputs.should_run == 'true' &&
294+ (needs.check-conditions.outputs.target_library == '' ||
295+ needs.check-conditions.outputs.target_library == 'altair')
247296 uses : ./.github/workflows/gen-library-impl.yml
248297 with :
249298 spec_id : ${{ needs.check-conditions.outputs.spec_id }}
@@ -256,7 +305,10 @@ jobs:
256305
257306 generate-plotnine :
258307 needs : [check-conditions, create-sub-issues]
259- if : needs.check-conditions.outputs.should_run == 'true'
308+ if : |
309+ needs.check-conditions.outputs.should_run == 'true' &&
310+ (needs.check-conditions.outputs.target_library == '' ||
311+ needs.check-conditions.outputs.target_library == 'plotnine')
260312 uses : ./.github/workflows/gen-library-impl.yml
261313 with :
262314 spec_id : ${{ needs.check-conditions.outputs.spec_id }}
@@ -269,7 +321,10 @@ jobs:
269321
270322 generate-pygal :
271323 needs : [check-conditions, create-sub-issues]
272- if : needs.check-conditions.outputs.should_run == 'true'
324+ if : |
325+ needs.check-conditions.outputs.should_run == 'true' &&
326+ (needs.check-conditions.outputs.target_library == '' ||
327+ needs.check-conditions.outputs.target_library == 'pygal')
273328 uses : ./.github/workflows/gen-library-impl.yml
274329 with :
275330 spec_id : ${{ needs.check-conditions.outputs.spec_id }}
@@ -282,7 +337,10 @@ jobs:
282337
283338 generate-highcharts :
284339 needs : [check-conditions, create-sub-issues]
285- if : needs.check-conditions.outputs.should_run == 'true'
340+ if : |
341+ needs.check-conditions.outputs.should_run == 'true' &&
342+ (needs.check-conditions.outputs.target_library == '' ||
343+ needs.check-conditions.outputs.target_library == 'highcharts')
286344 uses : ./.github/workflows/gen-library-impl.yml
287345 with :
288346 spec_id : ${{ needs.check-conditions.outputs.spec_id }}
0 commit comments