Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

CODEOWNERS not working with teams,yaml

Ludwig OHallorans May 13, 2024

Hi,

I'm trying to implement code owners functionality in our repositories.

I got one to test, removed the configured default reviewers in bitbucket, and added both files to the .bitbucket folder in the root of the repository. I commit the changes and can see the folder and the files in development branch, but when a PR is requested from any branch to development the configuration in CODEOWNERS is not used.

Can anyone help me here please?

Note: the space between @ and teams I need to add it because the forum insisted in placing an User link there, In my file there is no space between the @ and teams.

CODEOWNERS file:

# User @ teams to prefix your team name and let CODEOWNERS know to look in
# your teams.yaml file

# For Client changes designTeam need to be as default PR
# accompanied by 2 of the webTeam
* @ teams/designteam @ teams/webteam

# It can be useful to setup a "meta-owner" that is responsible for changes to the
# teams and CODEOWNERS files
.bitbucket/* some.name@subdomain.domain

teams.yaml file:

webTeam: # Name of the Team
  contributors: # Array of contributors by email address
    - some.name1@subdomain.domain
    - some.name2@subdomain.domain
    - some.name3@subdomain.domain
    - some.name4@subdomain.domain
    - some.name5@subdomain.domain
  reviews: # Configuration for selecting PR reviewers
    strategy: least_busy # Reverse sort by # of open PR's they are reviewing
    select: 2 # and select the top 2 contributors
designTeam:
  contributors:
    - some.name@subdomain.domain
  reviews:
  strategy: all # Select all users, no filtering/sorting applied
mobileTeam:
  contributors:
    - some.name6@subdomain.domain
    - some.name7@subdomain.domain
    - some.name8@subdomain.domain
  reviews:
  strategy: all

 

1 answer

1 accepted

1 vote
Answer accepted
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 14, 2024

Hello @Ludwig OHallorans and welcome to the Community!

By checking your CODEOWNERS and teams.yaml file you shared, I see the group names were defined using camel case in the teams file, while in the CODEOWNERS, you refer to all the groups in lowercase. This is the reason why Bitbucket is not finding a match, as the team names are case-sensitive.

Could you edit those files to match the case and try to test opening a pull request again?

Thank you @Ludwig OHallorans !

Patrik S

Ludwig OHallorans May 15, 2024

I did it like that following the example Atlassian put in the setup article.

Thank you.

I will modify and test.

And share my results.

Ludwig OHallorans May 16, 2024

It worked perfectly.

Thank you.

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 16, 2024

Awesome @Ludwig OHallorans ! Happy to hear that it worked :)

We have also updated the Set up and use code owners documentation to include the matching case in the provided example.

Feel free to reach out to the community if you ever need help!

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events