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

"last_files_match_only=true" only adds one alias as a reviewer, regardless of number of edited files #115

Open
jamoor-moj opened this issue Jan 23, 2024 · 0 comments

Comments

@jamoor-moj
Copy link

Problem

Currently, I have a repository with the action setup to have last_files_match_only=true. When I open a PR with multiple files edited inside the PR that each have their own alias associated with them, I would expect that a single alias for each file edited would be added to the PR.

codereviewers.yml

files:
  'include/client.h':
    - jamoor-john-doe
  'src/**':
    - jamoor
  'src/client.cpp':
    - jamoor-test
options:
  ignore_draft: true
  last_files_match_only: true

Changes in PR
image

Expected Behavior

image

Actual Behavior

image

Context

Based on the PR that added the last_files_match_only=true functionality (#80), it looks like the intention was to have the files section of codereviewers.yml to match the behavior of github's codeowners file.

I've setup a test repo (https://github.com/jamoor-moj/codereview_demo) that I can compare the behavior of codeowners and codereviewers (which is where I got the screenshots of the behavior above)

Codeowners: jamoor-moj/codereview_demo#4

  include/client.h @jamoor-john-doe
  src/ @jamoor
  src/client.cpp @jamoor-test

Codereviewers: jamoor-moj/codereview_demo#5

files:
  'include/client.h':
    - jamoor-john-doe
  'src/**':
    - jamoor
  'src/client.cpp':
    - jamoor-test
options:
  ignore_draft: true
  last_files_match_only: true

Is my understanding correct that this was the intention and therefore this is a bug? Or was that not the intention and this is an enhancement?

jamoor-moj added a commit to Mojang/auto-request-review that referenced this issue Jan 30, 2024
There is an open issue with the upstream repo (necojackarc#115) where the behavior when turning on last_files_match_only only matches one alias, even if mutliple files have been edited.

This is a different behavior than GitHub's codeowners file which the setting seeks to emulate.

This PR adds a per file check to the last match, allowing each file to add one alias assuming that that file matches a glob pattern inside the codereviewers yaml file.
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

No branches or pull requests

1 participant