From 5727185c309d3582c828b99d3a23cc26d5153c5a Mon Sep 17 00:00:00 2001 From: Martin Emde Date: Wed, 26 Nov 2025 16:04:55 -0800 Subject: [PATCH] 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 --- Cargo.lock | 2 +- ext/code_ownership/Cargo.toml | 16 ++++++++-------- spec/lib/code_ownership_spec.rb | 17 +++++++++++++++++ 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 06d6c86..acd6645 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -201,7 +201,7 @@ dependencies = [ [[package]] name = "codeowners" version = "0.3.1" -source = "git+https://github.com/rubyatscale/codeowners-rs.git?branch=main#c8a5d535a9ccb286b8a2274ff98bd52c058908e4" +source = "git+https://github.com/rubyatscale/codeowners-rs.git?branch=push-qoonoyqpvuwm#88dd208c320e7445616eca57232e5e3a5738b2eb" dependencies = [ "clap", "clap_derive", diff --git a/ext/code_ownership/Cargo.toml b/ext/code_ownership/Cargo.toml index 1297906..94de510 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.8" } serde = { version = "1.0.219", features = ["derive"] } serde_magnus = "0.10" -codeowners = { git = "https://github.com/rubyatscale/codeowners-rs.git", branch = "main" } +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/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