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

Codeowner updates #58

Open
gentlementlegen opened this issue Nov 25, 2024 · 5 comments
Open

Codeowner updates #58

gentlementlegen opened this issue Nov 25, 2024 · 5 comments

Comments

@gentlementlegen
Copy link
Member

We do not make great use of the Code Owners file. It could be very handy for new contributors as they might not know who to ask for reviews. It would also make sure that on any pull-request opened someone is assigned, so the pull-request is taken care of.

I do not know if that should be a plugin or a simple action file in the template, but I believe it might help speeding up reviews and avoid missing them.

My idea is that people who edited a file should automatically get their name within the code owners associated with that file so GitHub automatically assigns them if that files get modified later on by someone else.

@0x4007
Copy link
Member

0x4007 commented Nov 26, 2024

My idea is that people who edited a file should automatically get their name within the code owners associated with that file so GitHub automatically assigns them if that files get modified later on by someone else.

GitHub already suggests reviewers based on recent edits to files in the diff. I wish we could tap into that instead of reimplementing the logic. But your approach can be a decent default plan until we figure a way to use the suggestions. We could consider scraping the GitHub UI and hitting the suggestions.

@gentlementlegen
Copy link
Member Author

@0x4007 Does this also work and suggest for outside collaborators?
I know that I usually add the suggested people but I often see pull-requests that sit there with no reviewers which is what I am trying to solve. And because our code owner files are mostly empty as well.

@0x4007
Copy link
Member

0x4007 commented Nov 26, 2024

I don't think it does. Only collaborators. You can't ask for reviews from non collaborators

@gentlementlegen
Copy link
Member Author

It seems you can if they wrote a comment in the PR or got mentioned. But I agree it would be nice to use the suggestions that github already suggests.

@Keyrxng
Copy link
Member

Keyrxng commented Nov 26, 2024

I think it's a great idea

Code owners are automatically requested for review when someone opens a pull request that modifies code that they own. Code owners are not automatically requested to review draft pull requests.

To trigger review requests, pull requests use the version of CODEOWNERS from the base branch of the pull request. The base branch is the branch that a pull request will modify if the pull request is merged.

If you create a pull request from a fork, and the base branch is in the upstream repository, then the pull request will use the CODEOWNERS file from that branch in the upstream repository. If the base branch is a branch within your fork, then the pull request will use the CODEOWNERS file from that branch in your fork, but this will only trigger review requests if the code owners are added to your fork specifically with write access.

When you view who is responsible for a file by hovering over , you will see information from the CODEOWNERS file for whichever branch in whichever repository you're looking at.

https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#about-code-owners

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants