Skip to content

Commit 6a611ec

Browse files
committed
Fix regression in package.yml metadata.owner key
As far as I can tell, this key was not intentionally removed and its presence is missed. Based on issues reported, We're restoring support rather than fix all the other things that depend on it. Fixes: #141
1 parent 82bebc5 commit 6a611ec

File tree

4 files changed

+25
-9
lines changed

4 files changed

+25
-9
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/code_ownership/Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ crate-type = ["cdylib"]
1010

1111
[dependencies]
1212
rb-sys = { version = "0.9.111", features = [
13-
"bindgen-rbimpls",
14-
"bindgen-deprecated-types",
15-
"stable-api-compiled-fallback",
13+
"bindgen-rbimpls",
14+
"bindgen-deprecated-types",
15+
"stable-api-compiled-fallback",
1616
] }
1717
magnus = { version = "0.7.1" }
1818
serde = { version = "1.0.219", features = ["derive"] }
1919
serde_magnus = "0.9.0"
20-
codeowners = { git = "https://github.com/rubyatscale/codeowners-rs.git", tag = "v0.3.0" }
20+
codeowners = { git = "https://github.com/rubyatscale/codeowners-rs.git", branch = "push-qoonoyqpvuwm" }
2121

2222
[dev-dependencies]
2323
rb-sys = { version = "0.9.117", features = [
24-
"link-ruby",
25-
"bindgen-rbimpls",
26-
"bindgen-deprecated-types",
27-
"stable-api-compiled-fallback",
24+
"link-ruby",
25+
"bindgen-rbimpls",
26+
"bindgen-deprecated-types",
27+
"stable-api-compiled-fallback",
2828
] }
2929

3030
[build-dependencies]
8.07 MB
Binary file not shown.

spec/lib/code_ownership_spec.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,23 @@
195195
end
196196
end
197197

198+
context 'when ownership is found via metadata.owner in package.yml' do
199+
let(:file_path) { 'packs/metadata_owner_pack/some_file.rb' }
200+
201+
before do
202+
write_file('packs/metadata_owner_pack/package.yml', <<~CONTENTS)
203+
metadata:
204+
owner: Foo
205+
CONTENTS
206+
write_file(file_path, '# some content')
207+
RustCodeOwners.generate_and_validate(nil, false)
208+
end
209+
210+
it 'returns the correct team' do
211+
expect(subject).to eq CodeTeams.find('Foo')
212+
end
213+
end
214+
198215
context 'when ownership is found but team is not found' do
199216
let(:file_path) { 'packs/my_pack/owned_file.rb' }
200217
before do

0 commit comments

Comments
 (0)