@@ -9,14 +9,14 @@ class PackageOwnership
99 extend T ::Sig
1010 include Interface
1111
12- @@package_yml_cache = T . let ( { } , T ::Hash [ String , T . nilable ( ParsePackwerk :: Package ) ] ) # rubocop:disable Style/ClassVars
12+ @@package_yml_cache = T . let ( { } , T ::Hash [ String , T . nilable ( Packs :: Pack ) ] ) # rubocop:disable Style/ClassVars
1313
1414 sig do
1515 override . params ( file : String ) .
1616 returns ( T . nilable ( ::CodeTeams ::Team ) )
1717 end
1818 def map_file_to_owner ( file )
19- package = ParsePackwerk . package_from_path ( file )
19+ package = Packs . for_file ( file )
2020
2121 return nil if package . nil?
2222
@@ -29,11 +29,11 @@ def map_file_to_owner(file)
2929 returns ( T ::Hash [ String , T . nilable ( ::CodeTeams ::Team ) ] )
3030 end
3131 def map_files_to_owners ( files ) # rubocop:disable Lint/UnusedMethodArgument
32- ParsePackwerk . all . each_with_object ( { } ) do |package , res |
32+ Packs . all . each_with_object ( { } ) do |package , res |
3333 owner = owner_for_package ( package )
3434 next if owner . nil?
3535
36- glob = package . directory . join ( '**/**' ) . to_s
36+ glob = package . relative_path . join ( '**/**' ) . to_s
3737 Dir . glob ( glob ) . each do |path |
3838 res [ path ] = owner
3939 end
@@ -52,11 +52,11 @@ def map_files_to_owners(files) # rubocop:disable Lint/UnusedMethodArgument
5252 override . returns ( T ::Hash [ String , T . nilable ( ::CodeTeams ::Team ) ] )
5353 end
5454 def codeowners_lines_to_owners
55- ParsePackwerk . all . each_with_object ( { } ) do |package , res |
55+ Packs . all . each_with_object ( { } ) do |package , res |
5656 owner = owner_for_package ( package )
5757 next if owner . nil?
5858
59- res [ package . directory . join ( '**/**' ) . to_s ] = owner
59+ res [ package . relative_path . join ( '**/**' ) . to_s ] = owner
6060 end
6161 end
6262
@@ -65,7 +65,7 @@ def description
6565 'Owner metadata key in package.yml'
6666 end
6767
68- sig { params ( package : ParsePackwerk :: Package ) . returns ( T . nilable ( CodeTeams ::Team ) ) }
68+ sig { params ( package : Packs :: Pack ) . returns ( T . nilable ( CodeTeams ::Team ) ) }
6969 def owner_for_package ( package )
7070 raw_owner_value = package . metadata [ 'owner' ]
7171 return nil if !raw_owner_value
0 commit comments