Add workflow to notify on warnings in MATLAB matrix build#79
Conversation
davidbuzinski
left a comment
There was a problem hiding this comment.
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.
| // 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 } | ||
| ); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
…fy regex Amp-Thread-ID: https://ampcode.com/threads/T-019d457e-2cfb-71e9-89db-ddeca5d8b76d Co-authored-by: Amp <amp@ampcode.com>
| workflows: ["MATLAB matrix build"] | ||
| types: [completed] | ||
| workflow_dispatch: # allow manual triggering for testing | ||
|
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
…ch issues Amp-Thread-ID: https://ampcode.com/threads/T-019d457e-2cfb-71e9-89db-ddeca5d8b76d Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019d457e-2cfb-71e9-89db-ddeca5d8b76d Co-authored-by: Amp <amp@ampcode.com>
davidbuzinski
left a comment
There was a problem hiding this comment.
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.
…rences Amp-Thread-ID: https://ampcode.com/threads/T-019d457e-2cfb-71e9-89db-ddeca5d8b76d Co-authored-by: Amp <amp@ampcode.com>
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.