entitlements-github-plugin 1.2.8 → 1.2.9
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 +4 -4
- data/lib/entitlements/service/github.rb +12 -2
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f2b0df98e7f69e4f2189cf5a2e4edf7308faf18c8c307263c21bbf03e6e25e32
|
|
4
|
+
data.tar.gz: 411e9f69958ffc3685613befb69bce451a1ff18e4b087782ef143e9e7ce989a2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ed27dd9f70d393b25a3cc8b0f3b5bac2c013d5aafe2030e423ee0a2d40476e2f90e81f61e5e46a6848bddc524b14da987f7dec9eed1ab8b4ee24ed2d2aa7312e
|
|
7
|
+
data.tar.gz: 344da39e0b7af4638393a4ffe21ee15ebbe70b90172edc0b8b674d93b08e92035b53fea1f20062953de7f6249c873ad0280205074d877c324cb18febf7373fe6
|
|
@@ -183,7 +183,7 @@ module Entitlements
|
|
|
183
183
|
end
|
|
184
184
|
|
|
185
185
|
# Get data from the predictive updates cache if it's available and valid, or else get it
|
|
186
|
-
# from
|
|
186
|
+
# from the API. This is a shim between readers and `members_and_roles_from_api`.
|
|
187
187
|
#
|
|
188
188
|
# Takes no parameters.
|
|
189
189
|
#
|
|
@@ -194,7 +194,7 @@ module Entitlements
|
|
|
194
194
|
member_from_cache = Entitlements::Data::Groups::Cached.members("cn=member,#{ou}")
|
|
195
195
|
|
|
196
196
|
# If we do not have *both* admins and members, we need to call the API
|
|
197
|
-
return [
|
|
197
|
+
return [members_and_roles_from_api, false] unless admin_from_cache && member_from_cache
|
|
198
198
|
|
|
199
199
|
# Convert the Sets of strings into the expected hash structure.
|
|
200
200
|
Entitlements.logger.debug "Loading organization members and roles for #{org} from cache"
|
|
@@ -203,6 +203,16 @@ module Entitlements
|
|
|
203
203
|
[result, true]
|
|
204
204
|
end
|
|
205
205
|
|
|
206
|
+
# Use GraphQL in GitHub Actions, where entitlements-caches can answer it, and REST elsewhere.
|
|
207
|
+
#
|
|
208
|
+
# Takes no parameters.
|
|
209
|
+
#
|
|
210
|
+
# Returns Hash of { "username" => "ROLE" } where "ROLE" is from GraphQL Enum.
|
|
211
|
+
Contract C::None => C::HashOf[String => String]
|
|
212
|
+
def members_and_roles_from_api
|
|
213
|
+
ENV["GITHUB_RUN_ID"] ? members_and_roles_from_graphql : members_and_roles_from_rest
|
|
214
|
+
end
|
|
215
|
+
|
|
206
216
|
# Query GraphQL API to get a list of members and their roles.
|
|
207
217
|
#
|
|
208
218
|
# Takes no parameters.
|
data/lib/version.rb
CHANGED