Skip to content

Commit 69bbf13

Browse files
committed
fix(codeowners): generate at .bitbucket/CODEOWNERS for Bitbucket provider
Bitbucket reads code owners from .bitbucket/CODEOWNERS, but the generator fell through to the repo-root default. Closes #2604.
1 parent 3198d41 commit 69bbf13

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

crates/codeowners/src/codeowners_generator.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ impl CodeownersGenerator {
2121
let file_path = workspace_root.join(match provider {
2222
VcsProvider::GitHub => ".github/CODEOWNERS",
2323
VcsProvider::GitLab => ".gitlab/CODEOWNERS",
24+
VcsProvider::Bitbucket => ".bitbucket/CODEOWNERS",
2425
_ => "CODEOWNERS",
2526
});
2627

crates/codeowners/tests/codeowners_generator_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ mod codeowners {
5252
fn generates_bitbucket() {
5353
let sandbox = load_generator(VcsProvider::Bitbucket);
5454

55-
assert_snapshot!(fs::read_to_string(sandbox.path().join("CODEOWNERS")).unwrap());
55+
assert_snapshot!(fs::read_to_string(sandbox.path().join(".bitbucket/CODEOWNERS")).unwrap());
5656
}
5757

5858
#[test]

website/docs/guides/codeowners.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ The configuration above would generate the following:
8484
</TabItem>
8585
<TabItem value="bitbucket">
8686

87-
```shell title="CODEOWNERS"
87+
```shell title=".bitbucket/CODEOWNERS"
8888
# components
8989
/packages/components/src/ @frontend @design-system
9090
/packages/components/*.config.js @frontend-infra
@@ -148,7 +148,7 @@ config/ @app-platform
148148
</TabItem>
149149
<TabItem value="bitbucket">
150150

151-
```shell title="CODEOWNERS"
151+
```shell title=".bitbucket/CODEOWNERS"
152152
# (workspace)
153153
* @admins
154154
config/ @app-platform
@@ -201,6 +201,7 @@ The location of the file is dependent on the configured provider.
201201

202202
- GitHub -> `.github/CODEOWNERS`
203203
- GitLab -> `.gitlab/CODEOWNERS`
204+
- Bitbucket -> `.bitbucket/CODEOWNERS`
204205
- Everything else -> `CODEOWNERS`
205206

206207
### Why are owners defined in `moon.*` and not an alternative like `OWNERS`?

0 commit comments

Comments
 (0)