Skip to content

Handle flat single-artifact layout in strict-status reporting#949

Merged
mwcraig merged 2 commits into
astropy:mainfrom
mwcraig:fix-strict-status-artifact-layout
Jul 14, 2026
Merged

Handle flat single-artifact layout in strict-status reporting#949
mwcraig merged 2 commits into
astropy:mainfrom
mwcraig:fix-strict-status-artifact-layout

Conversation

@mwcraig

@mwcraig mwcraig commented Jul 14, 2026

Copy link
Copy Markdown
Member

Post-merge verification of the strict-status flow from #942 (via test PR #948) showed that no ubuntu-py313-strict check run was posted, even though the gate and the outcome artifact both worked. Root cause: when the strict-job-outcome-* pattern matches exactly one artifact, actions/download-artifact extracts it directly into strict-outcomes/ with no per-artifact subdirectory, so the script's scan for strict-job-outcome-* directories finds nothing and exits with "No strict-job-outcome-* artifacts found; nothing to report" (see the Create check runs step log). The same happened on the concurrent dependabot PR's run, so it is reproducible.

This changes the script to scan for the strict-outcome.json files themselves, supporting both:

  • the flat layout (single matching artifact, today's situation), and
  • the per-artifact subdirectory layout (which returns once the expected-failures matrix has more than one entry).

The two warning messages now reference the JSON path instead of the directory name, and the flat layout falls back to a generic check name only if the JSON is also unreadable (the JSON normally carries the real matrix name).

Since workflow_run workflows execute from the default branch, this takes effect only after merging; re-verify by re-triggering CI on any open PR (e.g. close/reopen #948) and confirming a neutral ubuntu-py313-strict check with a "failed (expected)" title appears.

🤖 Generated with Claude Code

https://claude.ai/code/session_01M5FNYqVHbKLbVSGJGftLrL

Post-merge verification of the workflow_run flow (test PR astropy#948) showed
no ubuntu-py313-strict check run was posted: with a pattern matching
exactly one artifact, download-artifact extracts it directly into the
destination directory instead of a per-artifact subdirectory, so the
script's scan for strict-job-outcome-* directories found nothing and
returned "nothing to report".

Scan for the strict-outcome.json files themselves, supporting both the
flat single-artifact layout and the per-artifact subdirectory layout
that appears once the expected-failures matrix has more than one entry.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M5FNYqVHbKLbVSGJGftLrL

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the strict_status.yml workflow-run reporter so it correctly finds and reports strict job outcomes when actions/download-artifact produces a flat extraction layout for a single matching artifact (rather than creating per-artifact subdirectories). This ensures the expected neutral strict check run (e.g. ubuntu-py313-strict) is posted reliably.

Changes:

  • Switch from scanning strict-job-outcome-* directories to scanning strict-outcome.json files to support both flat and per-artifact layouts.
  • Improve warning messages to reference the JSON file path being read (instead of a directory name).
  • Add a fallback naming path for the flat-layout case when the JSON cannot be read.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/strict_status.yml Outdated
}
}
if (outcomes.length === 0) {
core.info('No strict-job-outcome-* artifacts found; nothing to report.');

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.

Good catch — updated the message to say "No strict-outcome.json files found in downloaded artifacts" in 503ce8f, which matches what the script actually scans for now.

@mwcraig mwcraig merged commit 378eeb0 into astropy:main Jul 14, 2026
14 checks passed
@mwcraig mwcraig deleted the fix-strict-status-artifact-layout branch July 14, 2026 22:27
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