-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 CODEOWNERS feature #25060
Add CODEOWNERS feature #25060
Conversation
Users that exist are automatically requested as reviewers when a PR is created. Does not work for teams. Does not validate that the users are eligible to actually review the PR. Includes call to stub function in issue.go (line 216) to what will become the Parser.
Returns a list of individual owners and teams associated with changed files that are passed into it.
…ea#33) from CodeownersUnitTests into main Reviewed-on: https://git.etogy.internal/etogy/gitea/pulls/33
…sUnitTests into main Reviewed-on: https://git.etogy.internal/etogy/gitea/pulls/35
base for good refactoring
…om ihamm.RefactoringLineValidation into main Reviewed-on: https://git.etogy.internal/etogy/gitea/pulls/53
Duplicate of #24910? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should just set FileError
. This is already implemented in Gitea, so you don't need this file.
Yeah. This one follows the GitHub CODEOWNERS syntax rules though, and it requires write access to be an owner. Shield icon on the files is helpful. |
Since #24910 merged, please update this PR. |
It's been a while since anyone on my team has looked at this. If any further changes are required to the CODEOWNERS feature (in either our implementation or the official implementation), it would be easier for all parties to create a new issue and work fresh from the latest version of Gitea. |
Adds the ability to define code ownership in a CODEOWNERS file, similar to the GitHub feature. See the new docs page for a full feature description.
Closes #10161
Implementation
The primary back-end change is adding a call to
AddCodeownerReviewers()
inservices/issue/issue.go
. This searches the base repo for a valid CODEOWNERS file, parses it, and requests reviews from any users/teams that own any changed files in the PR. The parsing/validation is contained in functions withinservices/issue/codeowners.go
.The applicable CODEOWNERS file is also parsed to:
UI Changes
Viewing a CODEOWNERS file with validation errors:
Editing a CODEOWNERS file with validation errors:
The remaining examples assume the following valid CODEOWNERS file is in the
main
branch:Viewing a file that has an owner displays a shield icon that can be hovered over to show the ownership tooltip. If no owner applies to the file, the shield is not displayed:
When opening a PR, the same hoverable codeowner shield icon is visible for any changed files with owners:
Same thing when viewing a PR's changed files:
Same thing when viewing a commit:
Known issues and features we are still working on
codeowners.go