Skip to content

feat: self-review uses local ./ action paths#184

Merged
derekmisler merged 3 commits into
docker:mainfrom
docker-agent:feat/self-review-local-paths
May 6, 2026
Merged

feat: self-review uses local ./ action paths#184
derekmisler merged 3 commits into
docker:mainfrom
docker-agent:feat/self-review-local-paths

Conversation

@docker-agent
Copy link
Copy Markdown
Contributor

Summary

Rewrites self-review-pr.yml so it no longer delegates to the reusable review-pr.yml workflow. Instead, the four jobs (resolve-context, review, reply-to-feedback, reply-to-mention) are inlined directly with ./ local paths for all docker/cagent-action action references.

This ensures self-review always exercises the action code on the current main branch rather than a pinned release SHA.

Changes

.github/workflows/self-review-pr.yml

  • Removes the single uses: ./.github/workflows/review-pr.yml (workflow_call) delegation
  • Inlines all four jobs verbatim from review-pr.yml, with these targeted changes:
    • Local paths replace all pinned docker/cagent-action/...@<SHA> references:
      Old (SHA-pinned) New (local)
      docker/cagent-action/.github/actions/setup-credentials@<SHA> ./.github/actions/setup-credentials
      docker/cagent-action/review-pr@<SHA> ./review-pr
      docker/cagent-action/review-pr/reply@<SHA> ./review-pr/reply
      docker/cagent-action/review-pr/mention-reply@<SHA> ./review-pr/mention-reply
      docker/cagent-action/.github/actions/mention-reply@<SHA> ./.github/actions/mention-reply
    • Checkout step added as the first step of every job so the workspace is populated with main branch code before ./ paths are resolved
    • PR head checkout changed to path: pr-head in review and reply-to-feedback jobs so it does not overwrite the local action files
    • workflow_call inputs translated to event-context equivalents (e.g. inputs.trigger-run-idgithub.event.workflow_run.id, step-level if: inputs.trigger-run-id != ''if: github.event_name == 'workflow_run')
    • All third-party action SHAs (actions/checkout, actions/github-script, etc.) are preserved unchanged

.github/actions/mention-reply/action.yml

  • Fix pre-existing node24node20 (AGENTS.md already documented the intent as node20; actionlint enforces valid runner names and node24 is not yet a valid value — this fix was required to make pnpm lint pass after local path resolution exposed the issue)

Validation

pnpm build && pnpm lint passes (Biome CI + tsc --noEmit + actionlint).

Refs: task to make self-review dogfood current-branch code.

Rewrite self-review-pr.yml to inline the three jobs from review-pr.yml
(resolve-context, review, reply-to-feedback, reply-to-mention) using
local './' paths for all docker/cagent-action action references instead
of the previously pinned SHA via the reusable workflow_call.

This ensures self-review always exercises the action code on the current
main branch rather than a pinned release.

Changes:
- Replace 'uses: ./.github/workflows/review-pr.yml' (workflow_call) with
  four inlined jobs copied verbatim from review-pr.yml
- All 'uses: docker/cagent-action/...@<SHA>' replaced with './' local
  equivalents: ./.github/actions/setup-credentials, ./review-pr,
  ./review-pr/reply, ./review-pr/mention-reply,
  ./.github/actions/mention-reply
- Add 'actions/checkout' (no ref) as the first step of every job so the
  workspace is populated with main branch code for local action resolution
- Change PR head checkout to 'path: pr-head' so it does not overwrite the
  local action files that were just checked out
- Translate workflow_call inputs to event-context equivalents:
  inputs.trigger-run-id -> github.event.workflow_run.id
  resolve-context job if: -> github.event_name == 'workflow_run' && ...
  trigger-run-id step guards -> github.event_name == 'workflow_run'
- All third-party action SHAs are preserved unchanged
- Fix .github/actions/mention-reply/action.yml: change 'node24' -> 'node20'
  (AGENTS.md already documented it as node20; actionlint requires node20)

Assisted-By: docker-agent
@docker-agent docker-agent requested a review from a team as a code owner May 6, 2026 20:15
@docker-agent docker-agent requested a review from derekmisler May 6, 2026 20:15
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: 🟡 NEEDS ATTENTION

Reviewed changes in .github/workflows/self-review-pr.yml and .github/actions/mention-reply/action.yml.

The node20 fix in mention-reply/action.yml is correct and matches project convention.

The workflow inlining is structurally sound: checkout ordering is correct (first step in every job), path: pr-head is used correctly for PR head checkouts, and inputs.*github.event.* translations are correct.

2 NOTABLE findings (dead code from inlining — no runtime crash, but functional gaps).

Comment thread .github/workflows/self-review-pr.yml Outdated
Comment thread .github/workflows/self-review-pr.yml Outdated
self-review-pr.yml only declares three triggers (workflow_dispatch,
issue_comment, workflow_run). The pull_request_review_comment event is
never delivered to this workflow, so its OR clauses in the if: conditions
of reply-to-feedback and reply-to-mention were dead code.

reply-to-feedback: drop the direct pull_request_review_comment branch;
  retain only the workflow_run/resolve-context path. Also simplify
  away the now-redundant needs.resolve-context.result != 'failure'
  guard (implied by the == 'success' check that remains).

reply-to-mention: drop the pull_request_review_comment branch;
  retain only the issue_comment branch (a live trigger).

Assisted-By: docker-agent
The earlier node24 -> node20 change was unnecessary. actionlint v1.7.7
did not recognise node24 as a valid runner, but v1.7.8 added support for
it (rhysd/actionlint#561). The CI lint job uses raven-actions/actionlint
at 'latest' which already ships v1.7.8+, so it was never broken in CI —
only in the local sandbox where an old binary was installed.

Revert the action back to 'node24' and note that pnpm lint (local
dev) requires actionlint >= v1.7.8 on PATH.

Assisted-By: docker-agent
@docker-agent
Copy link
Copy Markdown
Contributor Author

Reverted in commit 30aa926: .github/actions/mention-reply/action.yml is back on node24.

The earlier node24node20 change was a mistake on my part. The root cause was that the locally-installed actionlint binary was v1.7.7, which didn't know about node24. The actual fix was to upgrade actionlint — v1.7.8 added node24 support (rhysd/actionlint#561). The CI lint job uses raven-actions/actionlint at latest which already ships v1.7.8+, so CI was never broken — only my local sandbox had an old binary. pnpm lint passes cleanly now with actionlint v1.7.12.

@derekmisler
Copy link
Copy Markdown
Contributor

/review

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

All hypotheses were evaluated and dismissed:

  • reply-to-feedback condition simplification: The omission of the direct pull_request_review_comment event path is correct — self-review-pr.yml has no such trigger, so the original dual-path condition from review-pr.yml would never have fired the direct branch anyway. The simplified condition is accurate for the available triggers.
  • review job with always() + skipped resolve-context: GitHub Actions correctly handles skipped upstream jobs when always() is present. On issue_comment events, resolve-context is skipped and the review job evaluates its independent issue_comment branch — as intended.
  • reply-to-mention on issue_comment events: The needs.resolve-context.result != 'failure' pattern is deliberately chosen to pass when resolve-context is skipped. All required event context for mention replies is directly available from the issue_comment payload without needing resolve-context.

The inlining of the four jobs from review-pr.yml into self-review-pr.yml with ./ local paths is correct. The PR head checkout to path: pr-head properly preserves the main-branch action files at the workspace root so that uses: ./review-pr resolves correctly. Event-context translations (inputs.trigger-run-idgithub.event.workflow_run.id, etc.) are accurate.

@derekmisler derekmisler merged commit 1c07c8c into docker:main May 6, 2026
9 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