Skip to content

fix: skip self-review trigger for docker-agent[bot] review comments#180

Merged
derekmisler merged 2 commits into
docker:mainfrom
docker-agent:fix/self-review-bot-comment-loop
May 6, 2026
Merged

fix: skip self-review trigger for docker-agent[bot] review comments#180
derekmisler merged 2 commits into
docker:mainfrom
docker-agent:fix/self-review-bot-comment-loop

Conversation

@docker-agent
Copy link
Copy Markdown
Contributor

Problem

.github/workflows/self-review-pr-trigger.yml fired on every pull_request_review_comment event — including inline comments posted by the docker-agent[bot] reviewer itself (marked <!-- cagent-review -->). This created a feedback loop:

bot review comment → save-context run → self-review pipeline → more bot review comments → repeat

Fix

Added a job-level if condition to the save-context job in self-review-pr-trigger.yml that skips the run when the comment author is docker-agent[bot]:

jobs:
  save-context:
    if: github.event.comment.user.login != 'docker-agent[bot]'

self-review-pr.yml was also inspected — it has issue_comment and workflow_run triggers but no pull_request_review_comment trigger, so no change is needed there.

Validation

  • pnpm build
  • pnpm lint (Biome + tsc + actionlint) ✅ — no errors

Assisted-By: docker-agent

@docker-agent docker-agent requested a review from a team as a code owner May 6, 2026 18:33
@docker-agent docker-agent requested a review from derekmisler May 6, 2026 18:33
@docker-agent docker-agent force-pushed the fix/self-review-bot-comment-loop branch from a1193f7 to 13f284e Compare May 6, 2026 18:35
Copy link
Copy Markdown
Contributor

@docker-agent docker-agent Bot left a comment

Choose a reason for hiding this comment

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

Assessment: 🟢 APPROVE

The fix correctly addresses the feedback loop by adding a job-level if condition on the save-context job. The github.event.comment.user.login context path is the right one for pull_request_review_comment events. For pull_request events (the other trigger), the missing comment object evaluates to an empty string, which correctly passes the inequality check — so legitimate PR open/ready_for_review triggers are unaffected.

No bugs found in the changed code.

Copy link
Copy Markdown
Contributor Author

@docker-agent docker-agent left a comment

Choose a reason for hiding this comment

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

Assessment: 🟢 APPROVE

PR #180 — Break self-review feedback loop by skipping docker-agent[bot] comments

The one-line fix is correct and well-targeted. The job-level if guard on save-context effectively stops docker-agent[bot]'s own review comments from re-triggering the PR Review Trigger workflow, breaking the infinite loop.

Analysis:

  • github.event.comment.user.login path correctness — The field is present and populated for pull_request_review_comment events (the only event type that can carry bot review comments). For pull_request events (ready_for_review, opened), github.event.comment is absent and evaluates to '', making the guard '' != 'docker-agent[bot]'true — those events always run as intended. Behavior is correct for all trigger types.
  • Exact string match 'docker-agent[bot]' — This is the canonical GitHub Apps bot login format for the docker-agent app. The match is precise and intentional; there is no evidence of variant bot accounts in scope for this workflow.

No bugs or issues found in this change.

@derekmisler derekmisler enabled auto-merge (squash) May 6, 2026 18:38
- Fix if-guard: docker-agent[bot] → docker-agent (plain machine user,
  not a GitHub App bot)
- Remove the Build job from self-review-pr.yml; its pnpm build output
  is never consumed by the Review job, and build validation is already
  covered by test.yml on every PR

Assisted-By: docker-agent
@docker-agent docker-agent force-pushed the fix/self-review-bot-comment-loop branch from 13f284e to eceb236 Compare May 6, 2026 18:40
@derekmisler derekmisler merged commit 5eb6746 into docker:main May 6, 2026
8 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.

2 participants