-
Notifications
You must be signed in to change notification settings - Fork 33
feat(approvals-satisfied): overrides for CODEOWNERS #706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
It feels like team code review settings could solve your notification problem, no? |
Afraid not. We don't use auto-assignment, which picks specific individuals from the team and sets the PR reviewers to them as individuals instead. Instead, the team is set as the reviewer, similar to this PR:
All individuals from the team receive notifications for all such PRs. There is no way to disable them, hence the GitHub feature requests about it. |
src/utils/get-core-member-logins.ts
Outdated
| }); | ||
| // codeowners-utils sorts its CodeOwnersEntry array in reverse order of the CODEOWNERS file | ||
| codeOwnerOverrides.reverse(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| }); | |
| // codeowners-utils sorts its CodeOwnersEntry array in reverse order of the CODEOWNERS file | |
| codeOwnerOverrides.reverse(); | |
| }).toReversed(); // codeowners-utils sorts its CodeOwnersEntry array in reverse order of the CODEOWNERS file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danadajian originally, i was going to use .toReversed(), but i was worried about Node compatibility -- looks like it didn't land until Node 20 which may exclude some consumers. happy to chain the .reverse() call if you'd prefer though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This action runs on node 20, so we should be good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, Jest still seems to use Node to run (despite being launched with bun), so if the user's default Node environment is <20, the tests will fail. However, moving forward since this repo's GitHub workflows seem to work fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node 18's end of life is next month so honestly I'm not too worried about people using Node 18 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the bun test runner's mocking capabilities improve I'd like to get rid of Jest anyways
danadajian
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you're adding a new input you have to add it to action.yml
|
🎉 This PR is included in version 1.75.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Extends the functionality from ExpediaGroup#706 to another helper

📝 Description
In the
approvals-satisfiedscript, to specify which approvals are needed, the current parameters support either specifying teams + users, or letting CODEOWNERS be the source of truth.This generally works, but there are times when we'd like a little of both. After all, if CODEOWNERS was flexible enough, we wouldn't need this
approvals-satisfiedGitHub Action in the first place.One such case is in large repos. For larger teams, assigning code ownership of a directory to a large team using CODEOWNERS is problematic because every event notifies every member of the team which is automatically requested for review. There is no way for GitHub users to customize these notifications. One workaround is to use GitHub Actions like this to handle fine-grained approvals.
Here, we add support for still reading from CODEOWNERS, but allowing specific overrides of it. For the use case above, this allows us to specify no owner for the directory in CODEOWNERS (defaulting to any user with write permissions counting towards the minimum approvals needed, preventing a review request and thus notifications), but then enforce a specific number of approvals by specific GitHub teams/users using this GitHub Action.