Skip to content

chore(e2e): added an e2e testing setup#208

Open
derekmisler wants to merge 4 commits into
docker:mainfrom
derekmisler:feat/e2e-reviewer-testing
Open

chore(e2e): added an e2e testing setup#208
derekmisler wants to merge 4 commits into
docker:mainfrom
derekmisler:feat/e2e-reviewer-testing

Conversation

@derekmisler
Copy link
Copy Markdown
Contributor

@derekmisler derekmisler commented May 12, 2026

Summary

Adds comprehensive E2E test coverage for both top-level and inline mention scenarios.

Changes

  • E2E test coverage: Add two new test jobs in test-e2e.yml that validate the mention-reply handler correctly extracts and outputs metadata for both issue_comment (top-level) and pull_request_review_comment (inline) events
  • Manual E2E workflow: Add test-e2e-reviewer.yml for ad-hoc testing of full review, top-level mention, and inline mention scenarios against any PR
  • Self-review workflow: Switch from pinned action version to local workflow reference (./.github/workflows/review-pr.yml)

Test plan

  • Automated E2E tests run on every PR and validate:
    • Top-level mention handler correctly sets is-inline=false and in-reply-to-id=""
    • Inline mention handler correctly sets is-inline=true and in-reply-to-id=<comment-id>
    • Reply comments are posted and cleaned up automatically
  • Manual workflow allows testing against any PR with three scenarios: full review, top-level mention, inline mention

@derekmisler derekmisler self-assigned this May 12, 2026
@derekmisler derekmisler force-pushed the feat/e2e-reviewer-testing branch from 022fe66 to fbc73f9 Compare May 12, 2026 20:18
Signed-off-by: Derek Misler <derek.misler@docker.com>
@derekmisler derekmisler force-pushed the feat/e2e-reviewer-testing branch from fbc73f9 to e306e79 Compare May 12, 2026 20:32
@derekmisler derekmisler changed the title feat(mention-reply): emit owner/repo/pr-number/is-inline/in-reply-to-id outputs chore(e2e): added an e2e testing setup May 12, 2026
@derekmisler derekmisler requested a review from a team May 12, 2026 20:36
@derekmisler derekmisler marked this pull request as ready for review May 12, 2026 20:36
@derekmisler derekmisler marked this pull request as draft May 12, 2026 20:40
@derekmisler derekmisler marked this pull request as ready for review May 12, 2026 20:40
aheritier
aheritier previously approved these changes May 12, 2026
Copy link
Copy Markdown
Contributor

@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: 🔴 CRITICAL

This PR adds comprehensive E2E testing infrastructure for the mention-reply pipeline. The structure is sound and the approach is correct, but there are two high-severity bugs that break the tests' correctness guarantees, plus a medium-severity design issue that causes every automated run to post to the wrong PR.

Comment thread .github/workflows/test-e2e.yml Outdated
Comment thread .github/workflows/test-e2e.yml Outdated
Comment thread .github/workflows/self-review-pr.yml
Comment thread .github/workflows/test-e2e.yml Outdated
Fix 1 & 2: Replace invalid 'gh api --jq --argjson' with pipe to jq
- In test-mention-reply-inline 'Verify inline reply' step: pipe gh api output to 'jq --argjson' instead of using invalid '--jq --argjson' flag combo
- Same fix in 'Cleanup anchor comment and thread replies' step

Fix 3: Replace hardcoded PR docker#207 with dynamic TEST_PR_NUMBER
- Add job-level 'if: github.event_name == pull_request' guard to both test-mention-reply-toplevel and test-mention-reply-inline jobs (prevents running on push-to-main where no PR number exists)
- Add job-level 'env: TEST_PR_NUMBER: ${{ github.event.pull_request.number }}' to both jobs
- Update all synthetic event JSON, gh api endpoint URLs, and assertions to use $TEST_PR_NUMBER
- Remove hardcoded default '207' from test-e2e-reviewer.yml workflow_dispatch input

Fix 4: Revert self-review-pr.yml local ref back to pinned SHA
- Restore 'uses: docker/cagent-action@f208610 # v1.5.3'
- Local './.github/workflows/review-pr.yml' ref is resolved from default branch (main), not the PR branch, so it doesn't achieve dogfooding
@derekmisler derekmisler enabled auto-merge (squash) May 12, 2026 20:55
@derekmisler derekmisler requested a review from aheritier May 12, 2026 20:55
Copy link
Copy Markdown
Contributor

@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: 🟡 NEEDS ATTENTION

3 medium-severity issues found in the new E2E workflow additions: one missing cleanup step (orphan PR comments on every manual run) and two missing GitHub token permission declarations.

Comment thread .github/workflows/test-e2e-reviewer.yml
Comment thread .github/workflows/test-e2e.yml
Comment thread .github/workflows/test-e2e.yml
- Add `issues: write` to test-mention-reply-toplevel job (test-e2e.yml)
- Add `pull-requests: write` to test-mention-reply-inline job (test-e2e.yml)
- Add cleanup step to inline-mention job (test-e2e-reviewer.yml) to
  delete the anchor PR review comment and its thread replies on every
  manual run, preventing orphan comments from accumulating
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.

3 participants