CODEOWNERS with teams.yml not working

Salim S
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 10, 2024

Hi Experts, looking for your support on adding the CODEOWNERS with teams.yaml
Here is my team.yml
************************************ teams.yaml ********************************
developers: # Name of the Team
contributors: # Array of contributors by email address
- abc@domain.com
- def@domain.com
reviews: # Configuration for selecting PR reviewers
strategy: all # Reverse sort by # of open PR's they are reviewing (least_busy,all or random)
#select: 2
principals: # Name of the Team
contributors: # Array of principal Engineers by email address
- ghi@domain.com
- jkl@domain.com
reviews: # Configuration for selecting PR reviewers
strategy: all # Select all users, no filtering/sorting applied
associate_principals: # Name of the Team
contributors: # Array of associate principal Engineers by email address
- mno@domain.com
reviews: # Configuration for selecting PR reviewers
strategy: all # Select all users, no filtering/sorting applied
leads: # Name of the Team # Array of leads by email address
contributors: # Array of leads by email address
- pqr@domain.com
reviews: # Configuration for selecting PR reviewers
strategy: all # Select all users, no filtering/sorting applied


**********************************CODEOWNERS***************************************
# Use @ teams to prefix your team name and reference teams.yaml
* @ teams/developers @ teams/principals
*****************************************************************************************
NOTE:  In code owner file i have intentionally gave a space in between at the rate and teams due to community post does not allow.
Not sure why its throwing error:

Code Owners warning: teams/developers: user not found
Code Owners warning: teams/principals: user not found

1 answer

1 accepted

2 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 11, 2024

Hi Salim and welcome to the community!

Are you using CODEOWNERS in a Bitbucket Cloud repo or a Bitbucket Server/Data Center repo? Your tag has the question 'cloud', but your Bitbucket Cloud account doesn't have access to any repos. If you are unsure, the URL of a Bitbucket Cloud repo on your browser starts with https://bitbucket.org/ while Bitbucket Server/Data Center repos have a different custom URL.

CODEOWNERS with a teams.yaml file is a Bitbucket Cloud feature. If you are using Bitbucket Server/Data Center, the teams.yaml won't work. The native feature for Bitbucket Data Center is documented here (you can switch the dropdown with the version at the top right corner of that page to the one you are using):

In case you are using Bitbucket Cloud:

  1. Where exactly do you see the error message you posted in your question?
  2. Have you used indentation in the teams.yaml file as per our documentation https://support.atlassian.com/bitbucket-cloud/docs/set-up-and-use-code-owners/ ?
  3. Do the teams.yaml and the CODEOWNERS files belong to a folder named .bitbucket in the repo?
  4. Does the folder with these files exist in the destination branch of the pull request?
  5. Can you please confirm that the name of your file is teams.yaml instead of team.yml?

Kind regards,
Theodora

Salim S
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 12, 2024

Hi Theodora
Thanks for your response.
Currently, I am using Bitbucket Server/Data Center. That may be the reason my implementation not working.

Thanks for the links shared.



Suggest an answer

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

Atlassian Community Events