-
Notifications
You must be signed in to change notification settings - Fork 0
fix(workflows): improve robustness of impl-generate and impl-merge #1308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -245,39 +245,56 @@ jobs: | |
| # Get current labels on the issue | ||
| LABELS=$(gh issue view "$ISSUE" --json labels -q '.labels[].name' 2>/dev/null || echo "") | ||
|
|
||
| # Count done implementations | ||
| # Count done and failed implementations | ||
| DONE_COUNT=0 | ||
| FAILED_COUNT=0 | ||
| DONE_LIBS="" | ||
| FAILED_LIBS="" | ||
|
|
||
| for lib in $LIBRARIES; do | ||
| if echo "$LABELS" | grep -q "^impl:${lib}:done$"; then | ||
| DONE_COUNT=$((DONE_COUNT + 1)) | ||
| DONE_LIBS="$DONE_LIBS $lib" | ||
| elif echo "$LABELS" | grep -q "^impl:${lib}:failed$"; then | ||
| FAILED_COUNT=$((FAILED_COUNT + 1)) | ||
| FAILED_LIBS="$FAILED_LIBS $lib" | ||
| fi | ||
| done | ||
|
|
||
| echo "::notice::Libraries done: $DONE_COUNT/9" | ||
| TOTAL=$((DONE_COUNT + FAILED_COUNT)) | ||
| echo "::notice::Libraries: $DONE_COUNT done, $FAILED_COUNT failed, $TOTAL/9 total" | ||
|
|
||
| # Close issue if all 9 libraries are done OR done+failed=9 | ||
| if [ "$TOTAL" -eq 9 ]; then | ||
| # Build status table | ||
| TABLE="| Library | Status |\n|---------|--------|" | ||
| for lib in $LIBRARIES; do | ||
| if echo "$DONE_LIBS" | grep -w -q "$lib"; then | ||
| TABLE="$TABLE\n| $lib | :white_check_mark: |" | ||
| elif echo "$FAILED_LIBS" | grep -w -q "$lib"; then | ||
| TABLE="$TABLE\n| $lib | :x: (not supported) |" | ||
| fi | ||
| done | ||
|
|
||
| if [ "$FAILED_COUNT" -eq 0 ]; then | ||
| TITLE=":tada: All Implementations Complete!" | ||
| SUMMARY="All 9 library implementations for \`${SPEC_ID}\` have been successfully merged." | ||
| else | ||
| TITLE=":white_check_mark: Implementations Complete" | ||
| SUMMARY="${DONE_COUNT}/9 implementations merged, ${FAILED_COUNT} libraries could not implement this plot type." | ||
| fi | ||
|
|
||
| # Close issue if all 9 libraries are done | ||
| if [ "$DONE_COUNT" -eq 9 ]; then | ||
| gh issue comment "$ISSUE" --body "## :tada: All Implementations Complete! | ||
| gh issue comment "$ISSUE" --body "## ${TITLE} | ||
|
|
||
| All 9 library implementations for \`${SPEC_ID}\` have been successfully merged. | ||
| ${SUMMARY} | ||
|
|
||
| | Library | Status | | ||
| |---------|--------| | ||
| | matplotlib | :white_check_mark: | | ||
| | seaborn | :white_check_mark: | | ||
| | plotly | :white_check_mark: | | ||
| | bokeh | :white_check_mark: | | ||
| | altair | :white_check_mark: | | ||
| | plotnine | :white_check_mark: | | ||
| | pygal | :white_check_mark: | | ||
| | highcharts | :white_check_mark: | | ||
| | letsplot | :white_check_mark: | | ||
| $(echo -e "$TABLE") | ||
|
||
|
|
||
| --- | ||
| :robot: *[impl-merge](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})*" | ||
|
|
||
| gh issue close "$ISSUE" | ||
| echo "::notice::Closed issue #$ISSUE - all implementations complete" | ||
| echo "::notice::Closed issue #$ISSUE - all implementations complete ($DONE_COUNT done, $FAILED_COUNT failed)" | ||
| fi | ||
|
|
||
| - name: Trigger database sync | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The DONE_LIBS and FAILED_LIBS variables accumulate library names with leading spaces (e.g., " matplotlib seaborn"). This works with the current grep usage but makes the code fragile. Consider either trimming the leading space or using an array-based approach for cleaner string handling.