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 'CODEOWNERS' configuration for repos #20348

Closed
C-EO opened this issue Jul 12, 2022 · 1 comment
Closed

Add 'CODEOWNERS' configuration for repos #20348

C-EO opened this issue Jul 12, 2022 · 1 comment
Labels
issue/duplicate The issue has already been reported.

Comments

@C-EO
Copy link

C-EO commented Jul 12, 2022

Feature Description

Github gives big teams the ability to allocate people or group of people to certain files. This means that they have the absolute control over those files and have the final say on those files. Using the 'CODEOWNERS' file, I have been able to keep large teams organized on Github. I think it would be great if Gitea had that option too.

SCENARIOS

A user would create a file, probably named .CODEOWNERS, CODEOWNERS, .codeowners, or codeowners in the .gitea directory or in the top level directory of a repo.

The file would be implemented in such a format

# This is a comment.
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
# @{user} and @{org}/{team} will be requested for
# review when someone opens a pull request.
*       @{user} @{org}/{team}

# Order is important; the last matching pattern takes the most
# precedence. When someone opens a pull request that only
# modifies JS files, only @{user} and not the global
# owner(s) will be requested for a review.
*.js    @{user}

# You can also use email addresses if you prefer. They'll be
# used to look up users just like we do for commit author
# emails.
*.js user@email.com
*.ts user@email.com

# Teams can be specified as code owners as well. Teams should
# be identified in the format @{org}/{team}. Teams must have
# explicit write access to the repository. In this example,
# the {team} team in the {org} organization owns all .txt files.
*.txt @{org}/{team} @{org}/{team-2} @{user}
*.js  @{org}/{team}
*.ts  @{org}/{team}
*.tsx @{org}/{team} @{org}/{team-2}
*.jsx @{org}/{team} @{org}/{team-2}
*.sh  @{org}/{team}
*.mdx @{org}/{team-2}
*.md  @{org}/{team-2}

# In this example, @{user} owns any files in the .github/workflows
# directory at the root of the repository and any of its
# subdirectories.
.github/workflows @{user} @{org}/{team}

# The `docs/*` pattern will match files like
# `docs/getting-started.md` but not further nested files like
# `docs/build-app/troubleshooting.md`.
docs/*  user@email.com
.github/ISSUE_TEMPLATES/* 
.github/PULL_REQUEST_TEMPLATE/*
.github/workflows/*

# In this example, @{user} owns any file in an apps directory
# anywhere in your repository.
apps/ @{user}
etc/ @{user} @{org}/{team}

# In this example, @{user} owns any file in the `/docs`
# directory in the root of your repository and any of its
# subdirectories.
docs/ @{user}

# In this example, @{user} owns any file in the `/apps` 
# directory in the root of your repository except for the `/apps/gitea` 
# subdirectory, as its owners are left empty.
/apps/ @{user}
/apps/gitea 

This would help keep the team organized and less confused.

The CODEOWNERS file can also be added to your codebase to help organize the developers better.

For further info, you could then use an icon like 'shield-lock' to show the developers who has charge over that file.

Screenshots

Web capture_13-7-2022_02522_github com
Web capture_13-7-2022_02654_github com

@C-EO C-EO added type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Jul 12, 2022
@Gusted
Copy link
Contributor

Gusted commented Jul 12, 2022

Duplicate of #10161 ~ This is quite a detailed post with a use-case, please copy your message over there.

@6543 6543 added the issue/duplicate The issue has already been reported. label Jul 13, 2022
@techknowlogick techknowlogick removed type/proposal The new feature has not been accepted yet but needs to be discussed first. type/feature Completely new functionality. Can only be merged if feature freeze is not active. labels Jul 13, 2022
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/duplicate The issue has already been reported.
Projects
None yet
Development

No branches or pull requests

4 participants