Skip to content
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

Add options.last_files_match_only to simulate CODEOWNERS #80

Merged
merged 4 commits into from
Dec 22, 2022

Conversation

k0kubun
Copy link
Contributor

@k0kubun k0kubun commented Dec 20, 2022

When you want to migrate the following CODEOWNERS file:

foo/**/* @foo
foo/bar  @bar

options.last_files_match_only added in this PR allows to easily simulate the same behavior with auto-request-review:

files:
  foo/**/*: [foo]
  foo/bar: [bar]
options:
  last_files_match_only: true

When there are multiple matching patterns in CODEOWNERS, the last matching pattern takes the most precedence and thus it asks reviews only from @bar. The above YAML file behaves in the same way with this PR.

@necojackarc
Copy link
Owner

@k0kubun Thanks for the pull request 👍

I'm already on my Christmas holiday, but hopefully I can find time today to review and merge your pull request.

@necojackarc
Copy link
Owner

CI is failing because the dist hasn't been updated. I can quickly update it, so it should be fine.
I'll see if it's easy to add some tests for this new option. Wait a moment...

src/reviewer.js Outdated
@@ -34,6 +34,15 @@ function fetch_other_group_members({ author, config }) {
}

function identify_reviewers_by_changed_files({ config, changed_files, excludes = [] }) {
const DEFAULT_OPTIONS = {
last_match_only: false,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm now wondering if this option is clear enough since this only works for files 🤔 Let me check the whole configuration.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it can be confusing. This action can be used without files, for instance.
Just brainstorming now...

  • last_files_match_only
  • last_matching_files_pattern_only
  • last_matching_files_only

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I'll go with last_files_match_only.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it's better. Thank you!

@necojackarc necojackarc changed the title Add options.last_match_only to simulate CODEOWNERS Add options.last_files_match_only to simulate CODEOWNERS Dec 22, 2022
@necojackarc necojackarc merged commit 4f89302 into necojackarc:master Dec 22, 2022
@k0kubun k0kubun deleted the last-match-only branch December 22, 2022 23:15
@necojackarc
Copy link
Owner

Released in v0.10.0 🎉
https://github.com/necojackarc/auto-request-review/releases/tag/v0.10.0

(I don't know when I'll make it v1.0.0, by the way🤦‍♂️)

github-actions bot referenced this pull request in simpledotorg/simple-android Apr 8, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[necojackarc/auto-request-review](https://togithub.com/necojackarc/auto-request-review)
| action | minor | `v0.8.0` -> `v0.13.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>necojackarc/auto-request-review
(necojackarc/auto-request-review)</summary>

###
[`v0.13.0`](https://togithub.com/necojackarc/auto-request-review/releases/tag/v0.13.0)

[Compare
Source](https://togithub.com/necojackarc/auto-request-review/compare/v0.12.0...v0.13.0)

#### What's Changed

- Bump word-wrap from 1.2.3 to 1.2.4 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/necojackarc/auto-request-review/pull/108](https://togithub.com/necojackarc/auto-request-review/pull/108)
- Bump [@&#8203;babel/traverse](https://togithub.com/babel/traverse)
from 7.11.0 to 7.23.2 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/necojackarc/auto-request-review/pull/112](https://togithub.com/necojackarc/auto-request-review/pull/112)
- Bump to node.js v20.x by [@&#8203;mcgows](https://togithub.com/mcgows)
in
[https://github.com/necojackarc/auto-request-review/pull/117](https://togithub.com/necojackarc/auto-request-review/pull/117)
- Bump version to v0.13.0 by
[@&#8203;necojackarc](https://togithub.com/necojackarc) in
[https://github.com/necojackarc/auto-request-review/pull/118](https://togithub.com/necojackarc/auto-request-review/pull/118)

#### New Contributors

- [@&#8203;mcgows](https://togithub.com/mcgows) made their first
contribution in
[https://github.com/necojackarc/auto-request-review/pull/117](https://togithub.com/necojackarc/auto-request-review/pull/117)

**Full Changelog**:
necojackarc/auto-request-review@v0.12.0...v0.13.0

###
[`v0.12.0`](https://togithub.com/necojackarc/auto-request-review/releases/tag/v0.12.0)

[Compare
Source](https://togithub.com/necojackarc/auto-request-review/compare/v0.11.0...v0.12.0)

- Revert "Use team keys for authors"
([#&#8203;96](https://togithub.com/necojackarc/auto-request-review/issues/96))

###
[`v0.11.0`](https://togithub.com/necojackarc/auto-request-review/releases/tag/v0.11.0)

[Compare
Source](https://togithub.com/necojackarc/auto-request-review/compare/v0.10.0...v0.11.0)

- Support GitHub teams in `per_author`
([#&#8203;88](https://togithub.com/necojackarc/auto-request-review/issues/88))

###
[`v0.10.0`](https://togithub.com/necojackarc/auto-request-review/releases/tag/v0.10.0)

[Compare
Source](https://togithub.com/necojackarc/auto-request-review/compare/v0.9.0...v0.10.0)

- Support a `last_files_match_only` option for CODEOWNERS-compatibility
([https://github.com/necojackarc/auto-request-review/pull/80](https://togithub.com/necojackarc/auto-request-review/pull/80))

###
[`v0.9.0`](https://togithub.com/necojackarc/auto-request-review/releases/tag/v0.9.0)

[Compare
Source](https://togithub.com/necojackarc/auto-request-review/compare/v0.8.0...v0.9.0)

- Support local config
([#&#8203;77](https://togithub.com/necojackarc/auto-request-review/issues/77))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/simpledotorg/simple-android).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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