diff --git a/Cargo.lock b/Cargo.lock index d2859a0..a4daecf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -201,7 +201,6 @@ dependencies = [ [[package]] name = "codeowners" version = "0.3.0" -source = "git+https://github.com/rubyatscale/codeowners-rs.git?tag=v0.3.0#c3cace6a497f5708d3b78d1b91618fc90284ae0b" dependencies = [ "clap", "clap_derive", diff --git a/ext/code_ownership/Cargo.toml b/ext/code_ownership/Cargo.toml index 5ec2816..1542477 100644 --- a/ext/code_ownership/Cargo.toml +++ b/ext/code_ownership/Cargo.toml @@ -10,21 +10,21 @@ crate-type = ["cdylib"] [dependencies] rb-sys = { version = "0.9.111", features = [ - "bindgen-rbimpls", - "bindgen-deprecated-types", - "stable-api-compiled-fallback", + "bindgen-rbimpls", + "bindgen-deprecated-types", + "stable-api-compiled-fallback", ] } magnus = { version = "0.7.1" } serde = { version = "1.0.219", features = ["derive"] } serde_magnus = "0.9.0" -codeowners = { git = "https://github.com/rubyatscale/codeowners-rs.git", tag = "v0.3.0" } +codeowners = { git = "https://github.com/rubyatscale/codeowners-rs.git", branch = "push-qoonoyqpvuwm" } [dev-dependencies] rb-sys = { version = "0.9.117", features = [ - "link-ruby", - "bindgen-rbimpls", - "bindgen-deprecated-types", - "stable-api-compiled-fallback", + "link-ruby", + "bindgen-rbimpls", + "bindgen-deprecated-types", + "stable-api-compiled-fallback", ] } [build-dependencies] diff --git a/lib/code_ownership/code_ownership.bundle b/lib/code_ownership/code_ownership.bundle index 1ea578d..59e3ba9 100755 Binary files a/lib/code_ownership/code_ownership.bundle and b/lib/code_ownership/code_ownership.bundle differ diff --git a/spec/lib/code_ownership_spec.rb b/spec/lib/code_ownership_spec.rb index 6abb7d2..5d4e8e2 100644 --- a/spec/lib/code_ownership_spec.rb +++ b/spec/lib/code_ownership_spec.rb @@ -195,6 +195,23 @@ end end + context 'when ownership is found via metadata.owner in package.yml' do + let(:file_path) { 'packs/metadata_owner_pack/some_file.rb' } + + before do + write_file('packs/metadata_owner_pack/package.yml', <<~CONTENTS) + metadata: + owner: Foo + CONTENTS + write_file(file_path, '# some content') + RustCodeOwners.generate_and_validate(nil, false) + end + + it 'returns the correct team' do + expect(subject).to eq CodeTeams.find('Foo') + end + end + context 'when ownership is found but team is not found' do let(:file_path) { 'packs/my_pack/owned_file.rb' } before do