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

Code owners #95

Open
ThePrimeagen opened this issue May 30, 2023 · 9 comments
Open

Code owners #95

ThePrimeagen opened this issue May 30, 2023 · 9 comments

Comments

@ThePrimeagen
Copy link
Owner

I have to get this working... unsure when i will, but i will! Merged pr #90 for this, just never used codeowners as a way to manage the suppository, glad to try

@novusnota
Copy link
Contributor

This CODEOWNERS file only starts being meaningful once people/orgs listed in it have write permissions to the repo.

And it's purpose is to manage branch protection rules: people listed there are automatically requested for review when someone opens a pull request that modifies code that they own as specified in it.

P.S.: Also, to decrease overall clutter in the root of the repo, that file could be moved to .github/ folder and it would still operate the same here on GitHub.

@ThePrimeagen
Copy link
Owner Author

@novusnota is this branch protection stuff automagic?

so if ShyRy is elixerdeez, he cannot merge a change with zig?

@novusnota
Copy link
Contributor

novusnota commented May 30, 2023

@ThePrimeagen yes! But first one has to:

  1. Enable branch protection rule for master
  2. Check "Require pull requests before merging"
  3. Check "Require review from Code Owners"
  4. Validate the correctness of CODEOWNERS file (gitattributes-like format) — GitHub will tell something like "This CODEOWNERS file is valid" when viewing it from the web interface.

And then anytime anyone touches your Zig nuts, merging would be blocked until you explicitly grant your permission.

But if, say, ShyRy commits something for elixerdeez, GitHub would still require a review, but only from him and any other code owners assigned to elixerdeez in CODEOWNERS file. Self-admission, baby!

@novusnota
Copy link
Contributor

Rules in a file work quite simple (like in CSS): successive rules override preceding ones.

Here's an example:

# You here are supreme code owner of everything
* @ThePrimeagen

# ShyRy with elixerdeez
/elixir/ @ryanwinchester

ShyRy here is now responsible for elixerdeez, so GitHub won't bother you when he edits his files, but if he starts editing anything else, which isn't /elixir, GitHub would require a code review from the related code owner. If there is none — it would require review from you.

@bhansconnect
Copy link
Contributor

Is there a way to enable code owners to approve their own PRs (to the respective folders of course)? I have #43 that I would like to submit for Roc, and I am the code owner for Roc. I just can't submit cause it lacks review and I can't review my own PR. Maybe there is some other way to handle this?

@novusnota
Copy link
Contributor

@bhansconnect yes, code owners also need to have write permissions to the repo for that

@zivlakmilos
Copy link
Contributor

zivlakmilos commented Jun 5, 2023

Is codeowners setup completed?
I don't see option to merge my own pull requests. Don't know if I doing it correct.

@vhladko
Copy link
Collaborator

vhladko commented Jun 6, 2023

Is codeowners setup completed? I don't see option to merge my own pull requests. Don't know if I doing it correct.

It's not completed yet, you can tag me for now if your PR is ready to be merged.

@leo-costa
Copy link
Contributor

Is codeowners setup completed? I don't see option to merge my own pull requests. Don't know if I doing it correct.

It's not completed yet, you can tag me for now if your PR is ready to be merged.

Any updates on this?

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

6 participants