Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

@ammar-agent ammar-agent commented Oct 29, 2025

Shows step-by-step status for in-progress and pending jobs, making it much easier to debug CI runs that haven't completed yet.

Key improvements:

  • Shows detailed step status (COMPLETED, IN_PROGRESS, PENDING) for jobs that are still running
  • Highlights which step is currently running
  • Provides direct link to view live logs in browser (GitHub API doesn't expose logs for in-progress jobs)
  • Automatically detects in-progress jobs when no failures exist
  • Simplified UX: removed --wait flag, pending jobs work automatically
  • New --all flag to show all jobs regardless of status
  • Better filtering logic to prioritize failed jobs, then in-progress jobs

Example output for in-progress job:

📊 Step-by-step status:
  [COMPLETED] Set up job (success)
  [COMPLETED] Checkout code (success)
  [IN_PROGRESS] Run /./.github/actions/setup-cmux
  [PENDING] Build application

🔄 Currently running: Run /./.github/actions/setup-cmux
👁️  View live logs: https://github.com/coder/cmux/actions/runs/.../job/...

Limitation: GitHub's API doesn't provide actual log content for in-progress jobs - logs are only available once a job completes. The script now provides a direct link to view live logs in the browser instead.

Generated with cmux

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +44 to 55
# If --all flag is set or no failures, get latest run regardless of status
if [[ "$SHOW_ALL_JOBS" == true ]]; then
echo "🔍 Finding latest run for PR #$PR_NUMBER..." >&2
RUN_ID=$(gh pr checks "$PR_NUMBER" --json name,link,state --jq '.[] | select(.link | contains("/runs/")) | .link' | head -1 | sed -E 's|.*/runs/([0-9]+).*|\1|' || echo "")
else
echo "🔍 Finding latest failed run for PR #$PR_NUMBER..." >&2
# Get the latest failed run for this PR
RUN_ID=$(gh pr checks "$PR_NUMBER" --json name,link,state --jq '.[] | select(.state == "FAILURE") | select(.link | contains("/runs/")) | .link' | head -1 | sed -E 's|.*/runs/([0-9]+).*|\1|' || echo "")
fi

if [[ -z "$RUN_ID" ]]; then
echo "❌ No failed runs found for PR #$PR_NUMBER" >&2

Choose a reason for hiding this comment

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

P1 Badge Fallback to pending runs never triggers

When invoked with a PR number and no --all flag, the script still looks exclusively for failed runs (select(.state == "FAILURE")) and immediately exits if none are found. This means a PR whose checks are only PENDING/IN_PROGRESS still returns “No failed runs found” and never reaches the new logic that should display step-by-step status for in-progress jobs. The commit message promises automatic handling of in-progress jobs, but that path is unreachable unless the user manually supplies --all or a run ID. Consider falling back to the latest run when no failures exist so the script can surface pending job steps as advertised.

Useful? React with 👍 / 👎.

Shows step-by-step status for in-progress and pending jobs, making it much easier to debug CI runs that haven't completed yet.

**Key improvements:**
- Shows detailed step status (COMPLETED, IN_PROGRESS, PENDING) for jobs that are still running
- Highlights which step is currently running
- Provides direct link to view live logs in browser (GitHub API doesn't expose logs for in-progress jobs)
- Automatically detects in-progress jobs when no failures exist
- Simplified UX: removed --wait flag, pending jobs work automatically
- New --all flag to show all jobs regardless of status
- Better filtering logic to prioritize failed jobs, then in-progress jobs

**Example output for in-progress job:**
```
📊 Step-by-step status:
  [COMPLETED] Set up job (success)
  [COMPLETED] Checkout code (success)
  [IN_PROGRESS] Run /./.github/actions/setup-cmux
  [PENDING] Build application

🔄 Currently running: Run /./.github/actions/setup-cmux
👁️  View live logs: https://github.com/coder/cmux/actions/runs/.../job/...
```

_Generated with `cmux`_
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