code_ownership 1.32.10 → 1.32.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e0713332aa7dacd9ec6f097bba250555cb25208f594fd08bfba4a4ecf951d06b
4
- data.tar.gz: aa039e732cfa8aad7a16439bc2608f51c043eef2f9b642513a7616b95b319c01
3
+ metadata.gz: 766c909e87feb435319240d22675e5bd3bbbb2da5e9984098df27eb6586b2d46
4
+ data.tar.gz: 74e9e35278a45fce5aecf0de4131c56785c774eb6abe9e3d6db599f3bf6332f1
5
5
  SHA512:
6
- metadata.gz: 1c7b7a855b051aa6c856f39144e17484180fa6ff530ec7af3b7870ebf4cbf61b5b33c1a17d2402a319d784a7a17d7b226b64542c65a002707bb87419e1a660dd
7
- data.tar.gz: b91f701455620e4fe27f2a99b20b58f6b03d78fa04d66548d3f85b1e4202cdf9c09ec2b53a454a3bca419d33b65150c5c24977e9eca93efc102c25e36df21303
6
+ metadata.gz: eae6b000156ff509afe12b70019d3b73a62d30718f890f62dcd8ff46c8a03687e5cbc041463ef5b28e0de85bbb96c72799db95334d575bd5b42669ece4960885
7
+ data.tar.gz: e4c4b07430f1b611fb2e1493210a67c2a0e69013fdeddaa2042f8b6334e3b1c66d666343030da1af79b7af2dd9d8873af88556143cfa60406aa0991f72f7a9be
@@ -68,9 +68,10 @@ module CodeOwnership
68
68
 
69
69
  Mapper.all.each do |mapper|
70
70
  mapped_files = mapper.globs_to_owner(Private.tracked_files)
71
+ glob_to_owner_map_by_mapper_description[mapper.description] ||= {}
72
+
71
73
  mapped_files.each do |glob, owner|
72
74
  next if owner.nil?
73
- glob_to_owner_map_by_mapper_description[mapper.description] ||= {}
74
75
  glob_to_owner_map_by_mapper_description.fetch(mapper.description)[glob] = owner
75
76
  end
76
77
  end
@@ -43,27 +43,23 @@ module CodeOwnership
43
43
 
44
44
  sig { params(team: T.any(CodeTeams::Team, String)).returns(String) }
45
45
  def for_team(team)
46
- Private.load_configuration!
47
-
48
46
  team = T.must(CodeTeams.find(team)) if team.is_a?(String)
49
47
  ownership_information = T.let([], T::Array[String])
50
48
 
51
49
  ownership_information << "# Code Ownership Report for `#{team.name}` Team"
52
- Mapper.all.each do |mapper|
53
- ownership_information << "## #{mapper.description}"
54
- codeowners_lines = mapper.globs_to_owner(Private.tracked_files)
50
+
51
+ Private.glob_cache.raw_cache_contents.each do |mapper_description, glob_to_owning_team_map|
52
+ ownership_information << "## #{mapper_description}"
55
53
  ownership_for_mapper = []
56
- codeowners_lines.each do |line, team_for_line|
57
- next if team_for_line.nil?
58
- if team_for_line.name == team.name
59
- ownership_for_mapper << "- #{line}"
60
- end
54
+ glob_to_owning_team_map.each do |glob, owning_team|
55
+ next if owning_team != team
56
+ ownership_for_mapper << "- #{glob}"
61
57
  end
62
58
 
63
59
  if ownership_for_mapper.empty?
64
60
  ownership_information << 'This team owns nothing in this category.'
65
61
  else
66
- ownership_information += ownership_for_mapper
62
+ ownership_information += ownership_for_mapper.sort
67
63
  end
68
64
 
69
65
  ownership_information << ""
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code_ownership
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.32.10
4
+ version: 1.32.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusto Engineers