Skip to content

Organization-wide Breakage#18

Draft
MaxenceGollier wants to merge 4 commits intoJuliaSmoothOptimizers:mainfrom
MaxenceGollier:comment
Draft

Organization-wide Breakage#18
MaxenceGollier wants to merge 4 commits intoJuliaSmoothOptimizers:mainfrom
MaxenceGollier:comment

Conversation

@MaxenceGollier
Copy link
Copy Markdown
Contributor

@MaxenceGollier MaxenceGollier commented Mar 20, 2026

What is implemented

This is my attempt at adding an organization-wide breakage workflow.

How do I implement it

I copy pasted the .breakage folder of a JSO package (RegularizedProblems.jl, but they should all be the same)
And the Breakage.yml and CommentBreakage.yml workflows from there too.

I adapted the workflows to be reusable and to recognise the get_jso_users.jl script 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.

Copilot AI review requested due to automatic review settings March 20, 2026 19:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +50 to +67
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
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
Comment on lines +51 to +67
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
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
Comment on lines +3 to +6
on:
workflow_run:
workflows: ["Breakage"]
types:
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@dpo
Copy link
Copy Markdown
Member

dpo commented Mar 26, 2026

@MaxenceGollier Could the entire breakage workflow be moved here?

@MaxenceGollier
Copy link
Copy Markdown
Contributor Author

Yes.

@MaxenceGollier MaxenceGollier changed the title Add CommentBreakage workflow for PR breakage comments Organization-wide Breakage Mar 29, 2026
@MaxenceGollier MaxenceGollier marked this pull request as draft March 29, 2026 19:14
@dpo
Copy link
Copy Markdown
Member

dpo commented Mar 31, 2026

How would one use this from another repo?

@MaxenceGollier
Copy link
Copy Markdown
Contributor Author

Well, i am not sure.
I think we could have two workflows like those in each JSO repo:

name: Breakage
on:
  pull_request:
uses: JuliaSmoothOptimizers/.github/.github/workflows/Breakage.yml
name: CommentBreakage
on:
  workflow_run:
    workflows: ["Breakage"]:
    types:
      - completed
uses: JuliaSmoothOptimizers/.github/.github/workflows/CommentBreakage.yml

How does that sound ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants