Repository navigation
fix: AFM caller pre-production cleanup (debug removal + timeout) - #2095
Conversation
- debug: true was hardcoded for smoke testing; verbose sidecar output on every real release is noise - timeout-minutes: 10 guards against the job queuing forever if the AFM runner is offline during a real release Closes #2092 Related: runbot-hq/afm-release-notes-action#4
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
📝 WalkthroughWalkthroughThe workflows now limit and configure AFM release-note generation, invoke it during real publishing runs when manual notes are absent, and create GitHub Releases using prioritized manual, AFM-generated, or GitHub-generated notes. ChangesAFM release publishing
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant PublishWorkflow
participant AFMAction
participant GitHubRelease
PublishWorkflow->>AFMAction: Generate release title and body
AFMAction-->>PublishWorkflow: Return AFM outputs
PublishWorkflow->>GitHubRelease: Create release with selected title and notes file
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/afm-release-notes.yml:
- Line 19: Clarify the workflow job’s timeout configuration around
timeout-minutes to state that it limits execution time only and does not cancel
jobs waiting for self-hosted runners. If queue cancellation is required, add a
separate supported mechanism rather than relying on timeout-minutes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 5fc4b494-e15c-48a1-94bc-4671a4078688
📒 Files selected for processing (1)
.github/workflows/afm-release-notes.yml
| jobs: | ||
| generate-notes: | ||
| runs-on: [self-hosted, macOS, apple-intelligence] | ||
| timeout-minutes: 10 |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
git ls-files .github/workflows/afm-release-notes.yml
wc -l .github/workflows/afm-release-notes.yml
cat -n .github/workflows/afm-release-notes.yml | sed -n '1,120p'Repository: runbot-hq/run-bot
Length of output: 1733
🌐 Web query:
GitHub Actions timeout-minutes queued self-hosted runner job waiting for runner assignment docs
💡 Result:
In GitHub Actions, the jobs.<job_id>.timeout-minutes setting defines the maximum time a job is allowed to run, but it does not specifically control or limit the time a job spends in the "queued" state waiting for a self-hosted runner to become available [1]. Key points regarding job timing and queueing: 1. Queued Time vs. Execution Time: The timeout-minutes clock begins when the job starts executing on a runner, not when the job is first submitted to the queue [1]. Consequently, setting a low timeout-minutes value will not cause a job to fail while it is still waiting for a runner assignment [2]. 2. Automatic Queue Limit: GitHub Actions enforces a separate, system-wide limit for jobs in the queue. A job can remain in the queue for a maximum of 24 hours before it is automatically cancelled by GitHub [3]. This limit cannot be adjusted via the timeout-minutes property. 3. Monitoring and Mitigation: Because timeout-minutes does not apply to the time spent waiting for a runner, there is no native way to configure a shorter, custom timeout specifically for the "waiting for runner" phase [2]. If your workflow requires immediate failure when a runner is not available, you must implement custom logic, such as a separate monitoring workflow that checks for queued jobs and cancels them using the GitHub CLI (gh) [2]. If you find that your jobs are failing unexpectedly due to timeout-minutes, verify if your setup time or queue time is causing the job to exceed its total allowed execution duration [1]. For more precise control over long-running processes, consider using step-level timeouts (steps.<step_id>.timeout-minutes) instead of, or in addition to, the job-level timeout [1].
Citations:
- 1: timeout-minutes is not getting respected actions/runner#3699
- 2: https://stackoverflow.com/questions/78202763/how-can-i-make-a-github-action-timeout-if-the-runner-isnt-found
- 3: https://docs.github.com/en/actions/reference/limits
timeout-minutes won’t stop queueing on self-hosted runners. It only starts once a runner is assigned, so this job can still sit queued for up to GitHub’s 24-hour limit. Use a separate queue-cancellation mechanism or clarify that the timeout only covers execution.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/afm-release-notes.yml at line 19, Clarify the workflow
job’s timeout configuration around timeout-minutes to state that it limits
execution time only and does not cancel jobs waiting for self-hosted runners. If
queue cancellation is required, add a separate supported mechanism rather than
relying on timeout-minutes.
There was a problem hiding this comment.
1 issue found across 1 file
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/workflows/afm-release-notes.yml">
<violation number="1" location=".github/workflows/afm-release-notes.yml:19">
P2: An offline `apple-intelligence` runner can still leave this job queued for hours; job-level `timeout-minutes` starts only after a runner begins executing, so it does not enforce the stated queue guard. A queue-aware cancellation/watchdog or runner-availability preflight is needed; this timeout can remain as an execution limit.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| jobs: | ||
| generate-notes: | ||
| runs-on: [self-hosted, macOS, apple-intelligence] | ||
| timeout-minutes: 10 |
There was a problem hiding this comment.
P2: An offline apple-intelligence runner can still leave this job queued for hours; job-level timeout-minutes starts only after a runner begins executing, so it does not enforce the stated queue guard. A queue-aware cancellation/watchdog or runner-availability preflight is needed; this timeout can remain as an execution limit.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/afm-release-notes.yml, line 19:
<comment>An offline `apple-intelligence` runner can still leave this job queued for hours; job-level `timeout-minutes` starts only after a runner begins executing, so it does not enforce the stated queue guard. A queue-aware cancellation/watchdog or runner-availability preflight is needed; this timeout can remain as an execution limit.</comment>
<file context>
@@ -16,6 +16,7 @@ permissions:
jobs:
generate-notes:
runs-on: [self-hosted, macOS, apple-intelligence]
+ timeout-minutes: 10
steps:
- uses: actions/checkout@v4
</file context>
Insert afm-release-notes-action@v1 as a step before Create GitHub Release. Runs only on real releases when no manual release_notes input is provided. continue-on-error: true ensures a failing AFM run does not block the release — falls back to --generate-notes automatically. Title priority: AFM release_title > tag name Notes priority: manual input > AFM release_body > --generate-notes Closes #2092
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/workflows/publish.yml">
<violation number="1" location=".github/workflows/publish.yml:414">
P1: Missing `timeout-minutes: 10` on the AFM release notes step. The PR description and commit message (`caaede11`) both describe adding a 10-minute timeout to guard against the self-hosted runner's AFM sidecar hanging during a real release, but the step doesn't include it. With `continue-on-error: true`, the timeout would cause the step to fail fast, its outputs to be empty, and the Create Release step to fall through to `--generate-notes` as intended. Without it, a hang blocks the workflow for the entire 30-minute job timeout before the fallback kicks in.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| id: afm_notes | ||
| with: | ||
| tag: ${{ steps.tag.outputs.tag }} | ||
| continue-on-error: true |
There was a problem hiding this comment.
P1: Missing timeout-minutes: 10 on the AFM release notes step. The PR description and commit message (caaede11) both describe adding a 10-minute timeout to guard against the self-hosted runner's AFM sidecar hanging during a real release, but the step doesn't include it. With continue-on-error: true, the timeout would cause the step to fail fast, its outputs to be empty, and the Create Release step to fall through to --generate-notes as intended. Without it, a hang blocks the workflow for the entire 30-minute job timeout before the fallback kicks in.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/publish.yml, line 414:
<comment>Missing `timeout-minutes: 10` on the AFM release notes step. The PR description and commit message (`caaede11`) both describe adding a 10-minute timeout to guard against the self-hosted runner's AFM sidecar hanging during a real release, but the step doesn't include it. With `continue-on-error: true`, the timeout would cause the step to fail fast, its outputs to be empty, and the Create Release step to fall through to `--generate-notes` as intended. Without it, a hang blocks the workflow for the entire 30-minute job timeout before the fallback kicks in.</comment>
<file context>
@@ -400,13 +400,27 @@ jobs:
+ id: afm_notes
+ with:
+ tag: ${{ steps.tag.outputs.tag }}
+ continue-on-error: true
+
# ── Create GitHub Release ──────────────────────────────────────────────────────────
</file context>
…itHub Release
AFM title and body are LLM-generated and must not be interpolated into
the shell script via ${{ }}. Move them to env: vars so the runner sets
them before bash starts, with no expression expansion in the script body.
Also replace --notes "$AFM_BODY" with --notes-file <tmpfile> to avoid
all shell word-splitting and quoting issues with multi-line content
containing quotes, backticks, or $() sequences.
Manual release_notes input follows the same pattern for consistency.
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
rm -f was only reached on success; if gh release create exits non-zero, set -euo pipefail aborts and the temp file leaks. trap EXIT fires on any exit path (success, error, signal). Remove the now-redundant manual rm.
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/workflows/publish.yml">
<violation number="1" location=".github/workflows/publish.yml:473">
P3: A temp-directory path containing `'` makes this generated trap command invalid, so release-note temp-file cleanup can fail. Keep the trap command literal and expand `NOTES_FILE` when the EXIT trap executes.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
| # shellcheck disable=SC2064 # intentional: $NOTES_FILE must expand NOW, not at trap time | ||
| trap "rm -f '$NOTES_FILE'" EXIT |
There was a problem hiding this comment.
P3: A temp-directory path containing ' makes this generated trap command invalid, so release-note temp-file cleanup can fail. Keep the trap command literal and expand NOTES_FILE when the EXIT trap executes.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/publish.yml, line 473:
<comment>A temp-directory path containing `'` makes this generated trap command invalid, so release-note temp-file cleanup can fail. Keep the trap command literal and expand `NOTES_FILE` when the EXIT trap executes.</comment>
<file context>
@@ -468,6 +468,10 @@ jobs:
NOTES_FILE=$(mktemp)
+ # trap ensures NOTES_FILE is removed on any exit path — success, set -e abort,
+ # or signal — so the file never leaks if gh release create fails.
+ # shellcheck disable=SC2064 # intentional: $NOTES_FILE must expand NOW, not at trap time
+ trap "rm -f '$NOTES_FILE'" EXIT
if [[ -n "${MANUAL_NOTES:-}" ]]; then
</file context>
| # shellcheck disable=SC2064 # intentional: $NOTES_FILE must expand NOW, not at trap time | |
| trap "rm -f '$NOTES_FILE'" EXIT | |
| trap 'rm -f "$NOTES_FILE"' EXIT |
| - name: Generate AFM release notes | ||
| if: ${{ inputs.dry_run != 'true' && inputs.release_notes == '' }} | ||
| uses: runbot-hq/afm-release-notes-action@v1 | ||
| id: afm_notes | ||
| with: | ||
| tag: ${{ steps.tag.outputs.tag }} | ||
| continue-on-error: true |
There was a problem hiding this comment.
Pass
GH_TOKEN
The AFM step calls gh api but does not receive a token, so continue-on-error makes automatic-notes releases silently fall back to --generate-notes. GitHub does not inject secrets.GITHUB_TOKEN into step environments automatically, and gh authenticates from explicit GH_TOKEN or GITHUB_TOKEN env vars.
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/publish.yml
Line: 414-420
Comment:
**Pass `GH_TOKEN`**
The AFM step calls `gh api` but does not receive a token, so `continue-on-error` makes automatic-notes releases silently fall back to `--generate-notes`. GitHub does not inject `secrets.GITHUB_TOKEN` into step environments automatically, and `gh` authenticates from explicit `GH_TOKEN` or `GITHUB_TOKEN` env vars.
How can I resolve this? If you propose a fix, please make it concise.- TAG/CHANNEL/ZIP/SIG: document why inline ${{ }} is safe (trusted
runner values, not user input) vs AFM outputs which go via env:
- continue-on-error: document intent (self-hosted runner may be offline)
and that skipped step outputs are empty strings handled correctly
| jobs: | ||
| generate-notes: | ||
| runs-on: [self-hosted, macOS, apple-intelligence] | ||
| timeout-minutes: 10 |
There was a problem hiding this comment.
Timeout misses queueing
timeout-minutes only limits how long the job is allowed to run, so it does not enforce the stated 10-minute guard while this self-hosted job is still queued waiting for an offline apple-intelligence runner. In that failure mode the workflow can still remain queued until GitHub cancels stale self-hosted jobs, so this cleanup does not fix the release-blocking outage condition it describes.
Context Used: AGENTS.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/afm-release-notes.yml
Line: 19
Comment:
**Timeout misses queueing**
`timeout-minutes` only limits how long the job is allowed to run, so it does not enforce the stated 10-minute guard while this self-hosted job is still queued waiting for an offline `apple-intelligence` runner. In that failure mode the workflow can still remain queued until GitHub cancels stale self-hosted jobs, so this cleanup does not fix the release-blocking outage condition it describes.
**Context Used:** AGENTS.md ([source](https://app.greptile.com/eonist/github/eoncode/run-bot/-/custom-context?memory=02ac88f9-f20e-46ce-9bbb-decad86e51e4))
How can I resolve this? If you propose a fix, please make it concise.
|
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".github/workflows/publish.yml">
<violation number="1" location=".github/workflows/publish.yml:432">
P1: Release runs execute whatever code `main` resolves to at runtime with this workflow's write-capable token; a mistaken or compromised future action-repo push can therefore alter release behavior. Pin the action to a verified full commit SHA and update that SHA deliberately.</violation>
</file>
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
| # The action's own generate.sh requires a self-hosted apple-intelligence runner | ||
| # to call AFM, but that constraint lives inside the standalone afm-release-notes.yml | ||
| # caller — not here. This step inherits the caller job's runner, which is fine. | ||
| uses: runbot-hq/afm-release-notes-action@main |
There was a problem hiding this comment.
P1: Release runs execute whatever code main resolves to at runtime with this workflow's write-capable token; a mistaken or compromised future action-repo push can therefore alter release behavior. Pin the action to a verified full commit SHA and update that SHA deliberately.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/publish.yml, line 432:
<comment>Release runs execute whatever code `main` resolves to at runtime with this workflow's write-capable token; a mistaken or compromised future action-repo push can therefore alter release behavior. Pin the action to a verified full commit SHA and update that SHA deliberately.</comment>
<file context>
@@ -413,12 +413,23 @@ jobs:
# to call AFM, but that constraint lives inside the standalone afm-release-notes.yml
# caller — not here. This step inherits the caller job's runner, which is fine.
- uses: runbot-hq/afm-release-notes-action@v1
+ uses: runbot-hq/afm-release-notes-action@main
id: afm_notes
with:
</file context>
| uses: runbot-hq/afm-release-notes-action@main | |
| uses: runbot-hq/afm-release-notes-action@78694036d1b531407f0a5ad632b4d20961c105bf |

Pre-production cleanup of the AFM release notes caller workflow.
Changes
Remove
debug: 'true'hardcodeWas left in for smoke testing. Verbose AFM sidecar logs on every real release are noise.
debugdefaults to'false'in the action.Add
timeout-minutes: 10Guards against the job queuing forever if the AFM self-hosted runner is offline during a real release.
Notes
@v1pin was already correct — no change neededrelease_titleon first smoke test) is handled in afm-release-notes-action #5Closes #2092
Closes #2090 (fence-strip fix landed in afm-release-notes-action #5)
Summary by cubic
Wired AFM release notes into the publish workflow via
runbot-hq/afm-release-notes-action@mainwith safe fallbacks. Cleaned up the AFM caller (debug off, 10‑minute timeout) and hardened release creation to avoid injection and temp file leaks.New Features
runbot-hq/afm-release-notes-action@maininpublish.ymlafter tag push; runs only on real releases when no manualrelease_notesare provided;continue-on-error: truefalls back to--generate-notes.${{ }}safety, composite‑action runner compatibility, and why@mainis safe for this first‑party composite action.Bug Fixes
debug: 'true'; addedtimeout-minutes: 10to avoid stuck runs.envand write notes to a temp file with--notes-file; addedtrap EXITfor cleanup.Written for commit a6a9c73. Summary will update on new commits.
Summary by CodeRabbit