test: add regression test for non-team-member /approve before valid approval#99
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a regression test to the Node.js GitHub Action to ensure /approve is accepted when the first matching comment is from a non-team member but a later matching comment is from an authorized team member (covering the failure mode described in #98 and preventing v2’s earlier shell-script bug from resurfacing in the JS implementation).
Changes:
- Added an integration-style test case where an unauthorized
/approvecomment appears before an authorized/approve. - Asserts the action reports approval based on the later authorized comment (by checking output and log content).
Show a summary per file
| File | Description |
|---|---|
src/index.test.js |
Adds regression test ensuring the action skips unauthorized /approve comments and approves on a subsequent authorized one. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
2e2f120 to
0e444ae
Compare
…pproval Adds a test confirming that when a non-team-member comments /approve before a valid team member, the action correctly skips the unauthorized comment and finds the later authorized one. This behavior was already correct in the Node.js rewrite, but was a real bug in the earlier shell-script version (v2). Adding the test to prevent regression. Ref #98
0e444ae to
46ae8c9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a regression test confirming that when a non-team-member comments
/approvebefore a valid team member does, the action correctly skips the unauthorized comment and finds the later authorized one.This behavior is already correct in the current Node.js implementation (the
breakonly fires inside theteamMembers.has(actor)check), but the earlier shell-script version (v2) had a real bug where thebreakexecuted on any/approvematch regardless of authorization.A separate hotfix for v2 is being submitted in parallel. #100
References #98