code_ownership 1.32.0 → 1.32.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62401f4e5d0f4c94669144b049a2e47f0f436b0dec4977db339827aa2378afb6
4
- data.tar.gz: be8561814a7c648b659b15fbe5c860edd409d3aa5aef91c1818820d447537a57
3
+ metadata.gz: ebb581f1f5784bcac8ce0772d2350227c522f1d5096f2b9546a514b1d79fba1d
4
+ data.tar.gz: 4f2d525089ce8a67f1c0248bfa2bdb06db432dac677ae995e125c5997cdd97f1
5
5
  SHA512:
6
- metadata.gz: d75fed2acaf64ba6ae82b7692531ad3d4629745d48a5567cfe954851d0edcd623b619be3d2a0f89f52e01125029bb01f5c1983bc39e4294640410f3d52229bd5
7
- data.tar.gz: 290e5caeef1ed81b45a048d55800ee1d2772418d25ff749fc3dab33eef3f85190e294b4e0d7082f51ac2590df458011b5a859ea2faddfc96eec9d238163bb3a6
6
+ metadata.gz: 2ccb639acea58cf8a882a06a1075146991781a8ee213251ec0dd8a5fdde19583df739a439246bd00548bf4b540e2904bd7c679f57ca470a3aecacfe1ee022e26
7
+ data.tar.gz: af0f3b0ee49dbdd0ce6f5a8b98aa6cf15cf290620d080ae1d791b273377b723ae5a31a4d48a667ece4072a24748dff2672d15cb38752ad8574b0e6bdd65fffd4
@@ -25,6 +25,14 @@ module CodeOwnership
25
25
  @configuration ||= Configuration.fetch
26
26
  end
27
27
 
28
+ # This is just an alias for `configuration` that makes it more explicit what we're doing instead of just calling `configuration`.
29
+ # This is necessary because configuration may contain extensions of code ownership, so those extensions should be loaded prior to
30
+ # calling APIs that provide ownership information.
31
+ sig { returns(Configuration) }
32
+ def self.load_configuration!
33
+ configuration
34
+ end
35
+
28
36
  sig { void }
29
37
  def self.bust_caches!
30
38
  @configuration = nil
@@ -28,6 +28,8 @@ module CodeOwnership
28
28
  return nil if file.start_with?('./')
29
29
  return @for_file[file] if @for_file.key?(file)
30
30
 
31
+ Private.load_configuration!
32
+
31
33
  owner = T.let(nil, T.nilable(CodeTeams::Team))
32
34
 
33
35
  Mapper.all.each do |mapper|
@@ -40,6 +42,8 @@ module CodeOwnership
40
42
 
41
43
  sig { params(team: T.any(CodeTeams::Team, String)).returns(String) }
42
44
  def for_team(team)
45
+ Private.load_configuration!
46
+
43
47
  team = T.must(CodeTeams.find(team)) if team.is_a?(String)
44
48
  ownership_information = T.let([], T::Array[String])
45
49
 
@@ -87,6 +91,7 @@ module CodeOwnership
87
91
  autocorrect: true,
88
92
  stage_changes: true
89
93
  )
94
+ Private.load_configuration!
90
95
  tracked_file_subset = Private.tracked_files & files
91
96
  Private.validate!(files: tracked_file_subset, autocorrect: autocorrect, stage_changes: stage_changes)
92
97
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: code_ownership
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.32.0
4
+ version: 1.32.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gusto Engineers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-08 00:00:00.000000000 Z
11
+ date: 2023-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: code_teams