Skip to content

Add workflow to notify on warnings in MATLAB matrix build#79

Merged
mcafaro merged 6 commits intohourlyfrom
hourly-notify-on-warnings
Mar 31, 2026
Merged

Add workflow to notify on warnings in MATLAB matrix build#79
mcafaro merged 6 commits intohourlyfrom
hourly-notify-on-warnings

Conversation

@mcafaro
Copy link
Copy Markdown
Member

@mcafaro mcafaro commented Mar 13, 2026

This PR adds an automated notification mechanism that emails the CI team when warning annotations occur in the build-v2 or build-v2-with-cache matrix jobs of the MATLAB matrix build workflow.

The goal is to surface important non‑fatal issues (for example, deprecation warnings) that do not currently fail the workflow and therefore do not trigger existing failure‑based email alerts.

@mcafaro mcafaro requested a review from davidbuzinski March 13, 2026 16:07
Copy link
Copy Markdown
Member

@davidbuzinski davidbuzinski left a comment

Choose a reason for hiding this comment

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

Overall looks good. Maybe we merge with v2 specified to make sure it does email, then update it to check against v3. I'm also a little worried we'll get spammed for a bit if we do encounter a warning but maybe that's okay.

Comment thread .github/workflows/notify-on-warnings.yml Outdated
Comment on lines +34 to +48
// 2) Only GitHub Actions runs whose names start with build-v2 or build-v2-with-cache
const prefixes = [/^build-v2(\b| |\()/, /^build-v2-with-cache(\b| |\()/];
const wanted = checkRuns.filter(run => {
const name = run.name || "";
const fromActions = run.app?.slug === "github-actions";
return fromActions && prefixes.some(rx => rx.test(name));
});

// 3) Collect warning annotations
const warnings = [];
for (const run of wanted) {
const anns = await github.paginate(
github.rest.checks.listAnnotations,
{ owner, repo, check_run_id: run.id, per_page: 100 }
);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks like if we do encounter a warning, we'll get hourly notifications until we have >= 100 runs without a warning. I think each job counts as a "check" so maybe that's at most 1 day without warnings because we run ~8 checks per hour. Is that right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

You're right that each completed run with warnings triggers an email. But since we're keying off the triggering workflow run's check runs (not all historical runs), we'd only get spammed if the same warning keeps appearing in new runs. If that's a concern we could add deduplication (e.g., cache the last-alerted SHA and skip if it matches), but it might be fine to start without it and see how noisy it gets.

@davidbuzinski davidbuzinski self-requested a review March 31, 2026 19:59
workflows: ["MATLAB matrix build"]
types: [completed]
workflow_dispatch: # allow manual triggering for testing

Copy link
Copy Markdown
Member

@davidbuzinski davidbuzinski Mar 31, 2026

Choose a reason for hiding this comment

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

I'm not sure this will trigger unless we do it through the manual workflow dispatch in the same way we do for hourly. I think the workflow_run trigger only works if we merge this to the main branch (or whatever the repository default is). If it worked on other branches, I'd have expected it to run on this branch already.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Bummer. We'll have to trigger with cron and just run on the half-hours with the hope that the hourly job has completed by then. If not, it'll catch it the next hour.

@davidbuzinski davidbuzinski self-requested a review March 31, 2026 20:37
Copy link
Copy Markdown
Member

@davidbuzinski davidbuzinski left a comment

Choose a reason for hiding this comment

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

We can give this a try and iterate as needed, if you'd like. We'll probably need to schedule through the API similar to how we do for the hourly jobs.

@mcafaro mcafaro merged commit 06c235b into hourly Mar 31, 2026
19 checks passed
@mcafaro mcafaro deleted the hourly-notify-on-warnings branch March 31, 2026 20:46
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.

2 participants