Organization-wide Breakage#18
Organization-wide Breakage#18MaxenceGollier wants to merge 4 commits intoJuliaSmoothOptimizers:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions workflow intended to post a PR comment summarizing “Breakage” workflow artifacts after that workflow completes.
Changes:
- Introduces a new
workflow_run-triggered workflow to download artifacts from a “Breakage” run. - Generates a markdown summary table from downloaded
breakage-*artifacts. - Posts the generated summary as a pull request comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| count=0 | ||
| for file in breakage-* | ||
| do | ||
| if [ $count == "0" ]; then | ||
| name=$(echo $file | cut -f2 -d-) | ||
| echo -n "| $name | " | ||
| else | ||
| echo -n "| " | ||
| fi | ||
| cat $file | ||
| if [ $count == "0" ]; then | ||
| echo -n " " | ||
| count=1 | ||
| else | ||
| echo " |" | ||
| count=0 | ||
| fi | ||
| done >> summary.md |
There was a problem hiding this comment.
The summary generation will fail if no files match breakage-* (the glob will expand to the literal string and cat breakage-* will error). Add an explicit check for matching files (or enable nullglob) and handle the empty-artifact case so the workflow can still post a useful message.
| count=0 | |
| for file in breakage-* | |
| do | |
| if [ $count == "0" ]; then | |
| name=$(echo $file | cut -f2 -d-) | |
| echo -n "| $name | " | |
| else | |
| echo -n "| " | |
| fi | |
| cat $file | |
| if [ $count == "0" ]; then | |
| echo -n " " | |
| count=1 | |
| else | |
| echo " |" | |
| count=0 | |
| fi | |
| done >> summary.md | |
| shopt -s nullglob | |
| files=(breakage-*) | |
| if [ ${#files[@]} -eq 0 ]; then | |
| echo "| No breakage artifacts found | | |" >> summary.md | |
| else | |
| count=0 | |
| for file in "${files[@]}" | |
| do | |
| if [ "$count" = "0" ]; then | |
| name=$(echo "$file" | cut -f2 -d-) | |
| echo -n "| $name | " | |
| else | |
| echo -n "| " | |
| fi | |
| cat "$file" | |
| if [ "$count" = "0" ]; then | |
| echo -n " " | |
| count=1 | |
| else | |
| echo " |" | |
| count=0 | |
| fi | |
| done >> summary.md | |
| fi |
| for file in breakage-* | ||
| do | ||
| if [ $count == "0" ]; then | ||
| name=$(echo $file | cut -f2 -d-) | ||
| echo -n "| $name | " | ||
| else | ||
| echo -n "| " | ||
| fi | ||
| cat $file | ||
| if [ $count == "0" ]; then | ||
| echo -n " " | ||
| count=1 | ||
| else | ||
| echo " |" | ||
| count=0 | ||
| fi | ||
| done >> summary.md |
There was a problem hiding this comment.
The markdown table construction relies on file ordering and an even number of breakage-* files (toggling count to decide when to close the row). If a package is missing one of the two expected files, or the glob order changes, you’ll produce malformed rows (e.g., missing trailing |). Consider iterating per package and explicitly reading the expected latest/stable files, or add validation and a final row-close to keep the output well-formed.
| for file in breakage-* | |
| do | |
| if [ $count == "0" ]; then | |
| name=$(echo $file | cut -f2 -d-) | |
| echo -n "| $name | " | |
| else | |
| echo -n "| " | |
| fi | |
| cat $file | |
| if [ $count == "0" ]; then | |
| echo -n " " | |
| count=1 | |
| else | |
| echo " |" | |
| count=0 | |
| fi | |
| done >> summary.md | |
| { | |
| for file in breakage-* | |
| do | |
| if [ "$count" -eq 0 ]; then | |
| name=$(echo "$file" | cut -f2 -d-) | |
| echo -n "| $name | " | |
| else | |
| echo -n "| " | |
| fi | |
| cat "$file" | |
| if [ "$count" -eq 0 ]; then | |
| echo -n " " | |
| count=1 | |
| else | |
| echo " |" | |
| count=0 | |
| fi | |
| done | |
| if [ "$count" -eq 1 ]; then | |
| echo " |" | |
| fi | |
| } >> summary.md |
| on: | ||
| workflow_run: | ||
| workflows: ["Breakage"] | ||
| types: |
There was a problem hiding this comment.
workflow_run.workflows: ["Breakage"] references a workflow name that does not exist in this repository (no workflow with name: Breakage is present under .github/workflows). As a result, this workflow will never trigger. Add/rename the upstream Breakage workflow in this repo, or update workflows:/workflow: to match the actual upstream workflow name.
|
@MaxenceGollier Could the entire breakage workflow be moved here? |
|
Yes. |
|
How would one use this from another repo? |
|
Well, i am not sure. How does that sound ? |
What is implemented
This is my attempt at adding an organization-wide breakage workflow.
How do I implement it
I copy pasted the
.breakagefolder of a JSO package (RegularizedProblems.jl, but they should all be the same)And the
Breakage.ymlandCommentBreakage.ymlworkflows from there too.I adapted the workflows to be reusable and to recognise the
get_jso_users.jlscript in b688244 and d5d7ddf respectively.Why do I implement it
This allows to unify the JSO workflows and remove a lot of redundancy in the JSO repos.
How do I test it
I don't and i have no idea how I could make sure this would run smoothly in the JSO repos... I am open to any suggestion.