code_ownership 1.32.0 → 1.32.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/code_ownership/private.rb +8 -0
- data/lib/code_ownership.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ebb581f1f5784bcac8ce0772d2350227c522f1d5096f2b9546a514b1d79fba1d
|
4
|
+
data.tar.gz: 4f2d525089ce8a67f1c0248bfa2bdb06db432dac677ae995e125c5997cdd97f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/code_ownership.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2023-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: code_teams
|