-
Notifications
You must be signed in to change notification settings - Fork 7
Add flag to enable quiet mode (run without PR comments) #19
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
Merged
Merged
Changes from 17 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
77eec28
test with const var
zbedforrest b2ff62f
add new flag
zbedforrest 31f8e05
refactor the commenting code
zbedforrest 389739d
add unit tests
zbedforrest 3732b4d
requestReviews should not return easily accesible and unmutated list …
zbedforrest aa3f5d2
short circuit review requests when in quiet mode
zbedforrest 2e2e131
rename flag to quiet
zbedforrest eafd96e
lint test module and update readme
zbedforrest 3115a3c
tweak readme
zbedforrest c8f65ce
specify quiet as false in codeowners workflow for this repo
zbedforrest 28f4de3
update coverage badge
zbedforrest 455933c
Merge branch 'main' into feature/quiet-mode
zbedforrest 3d8bf6a
test commit, no real change
zbedforrest c3ee6ea
update coverage
zbedforrest e10388b
add link to contibuting page
zbedforrest f7d5705
update readme's and enable quiet mode for this repo based on draft st…
zbedforrest d44bc64
use tabular tests
zbedforrest 15f02ca
Update README.md
zbedforrest 5e08463
Merge branch 'main' into feature/quiet-mode
zbedforrest File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ Code Ownership & Review Assignment Tool - GitHub CODEOWNERS but better | |
|
|
||
| [](https://goreportcard.com/report/github.com/multimediallc/codeowners-plus?kill_cache=1) | ||
| [](https://github.com/multimediallc/codeowners-plus/actions/workflows/go.yml) | ||
|  | ||
|  | ||
| [](https://opensource.org/licenses/BSD-3-Clause) | ||
| [](CODE_OF_CONDUCT.md) | ||
|
|
||
|
|
@@ -70,9 +70,9 @@ jobs: | |
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: 'Codeowners Plus' | ||
| uses: multimediallc/[email protected].0 | ||
| uses: multimediallc/[email protected].2 | ||
| with: | ||
| github-token: '${{ secrets.GITHUB_TOKEN }}' | ||
| pr: '${{ github.event.pull_request.number }}' | ||
|
|
@@ -121,7 +121,7 @@ By default, each file will resolve to a single reviewer. See [priority section] | |
|
|
||
| To instead require an owner as an additional reviewer (`AND` rule), put an `&` at the start of the line: | ||
| ``` | ||
| # this rule will add `@task-auditor` as a required review in addition to the file owner's required review | ||
| # this rule will add `@task-auditor` as a required review in addition to the file owner's required review | ||
| & **/task.go @task-auditor | ||
| ``` | ||
|
|
||
|
|
@@ -219,7 +219,7 @@ If you want to allow PR authors to bypass some reviews when there are a large nu | |
|
|
||
| `codeowners.toml` | ||
| ```toml | ||
| # | ||
| # | ||
| # `max_reviews` (default nil) allows you to skip some reviewers if the number of reviewers is greater than the max_reviewers | ||
| max_reviews = 2 | ||
| ``` | ||
|
|
@@ -254,13 +254,44 @@ high_priority_labels = ["high-priority", "urgent"] | |
|
|
||
| When a PR has any of these labels, the comment will look like this: | ||
| ``` | ||
| ❗High Prio❗ | ||
| ❗High Prio❗ | ||
|
|
||
| Codeowners approval required for this PR: | ||
| - @user1 | ||
| - @user2 | ||
| ``` | ||
|
|
||
| ## Quiet Mode | ||
|
|
||
| You can run Codeowners Plus in a "quiet" mode using the `quiet` input in the GitHub Action. | ||
|
|
||
| ### When Quiet Mode is Enabled | ||
|
|
||
| * **No Comments:** The action will **not** post the review status comment (listing required/unapproved reviewers) or the optional reviewer "cc" comment to the Pull Request. | ||
| * **No Review Requests:** The action will **not** automatically request reviews from required owners who have not yet approved via the GitHub API. | ||
|
|
||
| ### Behavior: | ||
|
|
||
| Even in quiet mode, the tool still performs all its internal calculations: determining required/optional owners based on file changes, checking existing approvals, and determining if the ownership rules are satisfied. The primary outcome is still the success or failure status of the associated status check (unless you've configured `enforcement.fail_check = false`). | ||
|
|
||
| ### Use Cases: | ||
|
|
||
| * **Draft Pull Requests:** This is a common use case. You might want the Codeowners Plus logic to run and report a status (e.g., pending or failed) on draft PRs, but without notifying reviewers prematurely by adding comments or requesting reviews until the PR is marked "Ready for review". | ||
| * **Custom Notification Workflows:** You might prefer to handle notifications or review requests through a different mechanism and only use Codeowners Plus for the status check enforcement. | ||
|
|
||
| ### Activation: | ||
|
|
||
| * **GitHub Action:** Set the `quiet` input to `'true'`. | ||
| ```yaml | ||
| - name: 'Codeowners Plus (Quiet)' | ||
| uses: multimediallc/[email protected] | ||
| with: | ||
| # ... other inputs ... | ||
| quiet: 'true' | ||
| ``` | ||
|
|
||
| **Default:** Quiet mode is **disabled** (`false`) by default. | ||
|
|
||
| ## CLI Tool | ||
|
|
||
| A CLI tool is available which provides some utilities for working with `.codeowners` files. | ||
|
|
@@ -276,7 +307,10 @@ Available commands are: | |
| * `owner` to check who owns a specific file | ||
| * `verify` to check for typos in a `.codeowners` file | ||
|
|
||
| ## Contributing | ||
|
|
||
| See [CONTRIBUTING.md](https://github.com/multimediallc/codeowners-plus/blob/main/CONTRIBUTING.md) | ||
|
|
||
| ## Future Features | ||
|
|
||
| * Inline ownership comments for having owners for specific functions, classes, etc. | ||
|
|
||
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.