Skip to content

fix: score CI from the latest Actions workflow run - #4

Merged
shayan-ys merged 1 commit into
mainfrom
fix/ci-latest-workflow-run
Sep 28, 2026
Merged

shayan-ys merged 1 commit into
mainfrom
fix/ci-latest-workflow-run

Conversation

@shayan-ys

@shayan-ys shayan-ys commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

📝 Summary

This PR changes the CI badge so it follows the latest GitHub Actions run of each workflow, then the latest check of each name. GitHub's statusCheckRollup keeps a cancelled workflow's Verify / gate FAILURE on the SHA after a new run starts, even before that run has posted gate, so DevDash showed red while CI was still in progress.


🛠️ Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • ⚡ Performance / Refactor (code optimization without behavior changes)
  • 📚 Documentation update

🔍 Changes Made

  • Fetch checkSuite.workflowRun (id, createdAt, workflow name) on each CheckRun, with a GraphQL fallback when those fields are missing.
  • latest_contexts keeps only checks from the latest Actions run per workflow, then the newest run of each remaining check name.
  • Tests cover a cancelled Verify gate plus an in-progress rerun, a same-run failure that must stay red, and the workflowRun schema fallback.

🧪 How to Test

  1. Pull this branch: git checkout fix/ci-latest-workflow-run
  2. Run uv run pytest
  3. Point DevDash at a GitHub account and open a PR whose latest workflow run is in progress after a cancelled run (for example a re-pushed Verify workflow that has not posted Verify / gate yet).
  4. Verify the CI badge is pending (●ciN) instead of red from the cancelled run's gate.

✅ Review and verification

  • Review path: low risk self-review; omitted optional reviews: extra independent review (no sensitive behavior; the scoring change is local and covered by tests)
  • Verification: uv run pytest — 59 passed. gh pr checks 4 — all 6 test jobs SUCCESS on 34d9fc2. Live getmash/mash-2-point-o#833 scored ●ci1 (Verify / ios / compile in progress) instead of red from the cancelled Verify gate.
  • Declined findings: none
  • Remaining non-blocking findings: CodeRabbit was requested with @coderabbitai review and posted no commit status, review, or comment after 30 minutes (same as PRs fix: score CI from the latest run of each check name #2 and Add omp profile selection and a GitHub account flag #3 on this repo)

GitHub's statusCheckRollup keeps a cancelled Verify run's gate FAILURE
on the SHA after a new run starts, even before that run posts gate.
Score the latest run per workflow, then the latest check of each name,
so a still-running rerun shows pending instead of the stale red.
@shayan-ys

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@shayan-ys
shayan-ys marked this pull request as ready for review September 28, 2026 18:31
@shayan-ys
shayan-ys merged commit bd17e28 into main Sep 28, 2026
6 checks passed
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.

1 participant