Skip to content

feat(check-merge-safety): Add comment path matching feat#777

Closed
avwu99 wants to merge 1 commit into
ExpediaGroup:mainfrom
avwu99:auwu/safety-merge-test-matching
Closed

feat(check-merge-safety): Add comment path matching feat#777
avwu99 wants to merge 1 commit into
ExpediaGroup:mainfrom
avwu99:auwu/safety-merge-test-matching

Conversation

@avwu99
Copy link
Copy Markdown
Contributor

@avwu99 avwu99 commented Apr 22, 2026

📝 Description

Summary

Adds match_comment_paths parameter to check-merge-safety helper that reads paths from a specially formatted PR comment and checks if the branch is behind on any of those paths
Solves the edge case where selective testing runs tests for paths beyond what a PR directly modifies (e.g., transitive dependencies in monorepos), but merge safety only checked direct file changes
When enabled, the helper looks for a comment with the marker containing a JSON array of paths

Problem

In monorepos with selective testing, a PR changing PackageA might trigger tests for PackageB (a dependent). If someone merges changes to PackageB on main, the original PR's tests become stale, but the existing merge safety check wouldn't catch this since it only compared direct file changes.

Solution

Allow CI to post a comment with all paths covered by the PR's tests. The merge safety check then uses these paths (in addition to existing checks) to determine if a rebase is needed.

Files Changed

action.yml - Added match_comment_paths input
src/types/generated.ts - Added type declaration
src/helpers/check-merge-safety.ts - Added comment parsing and path matching logic
test/helpers/check-merge-safety.test.ts - Added tests for new functionality
README.md - Added documentation with usage examples

🔗 Related Issues

@avwu99 avwu99 requested a review from a team as a code owner April 22, 2026 20:33
@avwu99 avwu99 changed the title feat: Add comment path matching feat feat(check-merge-safety): Add comment path matching feat Apr 22, 2026
@avwu99 avwu99 closed this Apr 22, 2026
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