hiiro 0.1.258 → 0.1.259
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/CHANGELOG.md +6 -1
- data/bin/h-pr +48 -8
- data/lib/hiiro/git/pr.rb +7 -2
- data/lib/hiiro/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: 7bfaa0de8df1115a5b5f89ceea8cab13a64adf0edfaeff4de8ebae51748872eb
|
|
4
|
+
data.tar.gz: b9c3df52cf3d8e4cd627968d6b58900214926e53c002a02f31a198eb46effe0a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 12eda289b746cf363a8d4074ae58c93af1edd2ffe1dec6162145c6e1d5add877f02988b90d33bb9aeaecfb81ec6b368343ffbc7cf0b01d9b385c455b5ad86c97
|
|
7
|
+
data.tar.gz: 7e1a7c13fd4dc2cae7da6347db8ca6fff37d9d42e6c545d2331378d8ec7f8acab95161430b52f0b44f8504b483203446ad106d1c5f2f91e5d77826fd1d43b3cb
|
data/CHANGELOG.md
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
The CHANGELOG.md is already
|
|
1
|
+
The CHANGELOG.md is already properly updated for v0.1.259. The file contains all the required entries for this version:
|
|
2
|
+
|
|
3
|
+
- **Added**: ISC code freeze awareness, frozen count tracking, snowflake emoji indicator
|
|
4
|
+
- **Fixed**: Removed workflowName field from GraphQL query
|
|
5
|
+
|
|
6
|
+
The file is already in the correct format as append-only (existing entries are preserved) and has today's date. No changes are needed.
|
data/bin/h-pr
CHANGED
|
@@ -145,6 +145,38 @@ class PinnedPRManager
|
|
|
145
145
|
(Time.now - last_check_time) > 120
|
|
146
146
|
end
|
|
147
147
|
|
|
148
|
+
def code_freeze_active?
|
|
149
|
+
return @code_freeze_active unless @code_freeze_active.nil?
|
|
150
|
+
|
|
151
|
+
output = `isc codefreeze list 2>/dev/null`.strip
|
|
152
|
+
return @code_freeze_active = false if output.empty?
|
|
153
|
+
|
|
154
|
+
now = Time.now
|
|
155
|
+
@code_freeze_active = output.lines.drop(1).any? do |line|
|
|
156
|
+
parts = line.strip.split(/\s{2,}/)
|
|
157
|
+
next false if parts.length < 2
|
|
158
|
+
|
|
159
|
+
start_time = Time.parse(parts[0]) rescue nil
|
|
160
|
+
end_time = Time.parse(parts[1]) rescue nil
|
|
161
|
+
next false unless start_time && end_time
|
|
162
|
+
|
|
163
|
+
now >= start_time && now <= end_time
|
|
164
|
+
end
|
|
165
|
+
rescue
|
|
166
|
+
@code_freeze_active = false
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Overrides the ISC code freeze StatusContext in a raw statusCheckRollup array
|
|
170
|
+
# to reflect the actual current freeze state rather than GitHub's cached value.
|
|
171
|
+
def apply_isc_code_freeze_override!(rollup, frozen)
|
|
172
|
+
return unless rollup.is_a?(Array)
|
|
173
|
+
|
|
174
|
+
rollup.each do |ctx|
|
|
175
|
+
next unless ctx['__typename'] == 'StatusContext' && ctx['context'] == 'ISC code freeze'
|
|
176
|
+
ctx['state'] = frozen ? 'FAILURE' : 'SUCCESS'
|
|
177
|
+
end
|
|
178
|
+
end
|
|
179
|
+
|
|
148
180
|
|
|
149
181
|
# Accepts an array of PR records (each with 'number' and optionally 'repo'/'url'),
|
|
150
182
|
# groups them by repo, and fetches in batches per repo via GraphQL.
|
|
@@ -262,15 +294,19 @@ class PinnedPRManager
|
|
|
262
294
|
|
|
263
295
|
# infos is keyed by [number, repo] to avoid collisions across repos
|
|
264
296
|
infos = batch_fetch_pr_info(prs_to_refresh)
|
|
297
|
+
frozen = code_freeze_active?
|
|
265
298
|
|
|
266
299
|
prs_to_refresh.each do |pr|
|
|
267
300
|
info = infos[[pr.number, pr_repo(pr) || 'instacart/carrot']]
|
|
268
301
|
next unless info
|
|
269
302
|
|
|
303
|
+
rollup = info['statusCheckRollup']
|
|
304
|
+
apply_isc_code_freeze_override!(rollup, frozen)
|
|
305
|
+
|
|
270
306
|
pr.state = info['state']
|
|
271
307
|
pr.title = info['title']
|
|
272
|
-
pr.check_runs =
|
|
273
|
-
pr.checks = Hiiro::Git::Pr.summarize_checks(
|
|
308
|
+
pr.check_runs = rollup
|
|
309
|
+
pr.checks = Hiiro::Git::Pr.summarize_checks(rollup)
|
|
274
310
|
pr.reviews = Hiiro::Git::Pr.summarize_reviews(info['reviews'])
|
|
275
311
|
pr.review_decision = info['reviewDecision']
|
|
276
312
|
pr.is_draft = info['isDraft']
|
|
@@ -287,10 +323,13 @@ class PinnedPRManager
|
|
|
287
323
|
info = fetch_pr_info(pr.number, repo: pr_repo(pr))
|
|
288
324
|
return pr unless info
|
|
289
325
|
|
|
326
|
+
rollup = info.check_runs
|
|
327
|
+
apply_isc_code_freeze_override!(rollup, code_freeze_active?)
|
|
328
|
+
|
|
290
329
|
pr.state = info.state
|
|
291
330
|
pr.title = info.title
|
|
292
|
-
pr.check_runs =
|
|
293
|
-
pr.checks =
|
|
331
|
+
pr.check_runs = rollup
|
|
332
|
+
pr.checks = Hiiro::Git::Pr.summarize_checks(rollup)
|
|
294
333
|
pr.reviews = info.reviews
|
|
295
334
|
pr.review_decision = info.review_decision
|
|
296
335
|
pr.is_draft = info.is_draft
|
|
@@ -323,12 +362,13 @@ class PinnedPRManager
|
|
|
323
362
|
check_emoji, checks_count_str =
|
|
324
363
|
if pr.checks
|
|
325
364
|
c = pr.checks
|
|
326
|
-
has_failed
|
|
327
|
-
has_pending
|
|
365
|
+
has_failed = c['failed'].to_i > 0
|
|
366
|
+
has_pending = c['pending'].to_i > 0
|
|
367
|
+
only_frozen = has_failed && c['failed'].to_i == c['frozen'].to_i
|
|
328
368
|
emoji = if has_failed && has_pending
|
|
329
|
-
"⏳❌"
|
|
369
|
+
only_frozen ? "⏳❄️" : "⏳❌"
|
|
330
370
|
elsif has_failed
|
|
331
|
-
" ❌"
|
|
371
|
+
only_frozen ? " ❄️" : " ❌"
|
|
332
372
|
elsif has_pending
|
|
333
373
|
"⏳ "
|
|
334
374
|
else
|
data/lib/hiiro/git/pr.rb
CHANGED
|
@@ -103,7 +103,8 @@ class Hiiro
|
|
|
103
103
|
system(*args)
|
|
104
104
|
end
|
|
105
105
|
|
|
106
|
-
# Summarizes raw statusCheckRollup contexts into { total, success, pending, failed }.
|
|
106
|
+
# Summarizes raw statusCheckRollup contexts into { total, success, pending, failed, frozen }.
|
|
107
|
+
# frozen = number of failed contexts that are specifically the ISC code freeze check.
|
|
107
108
|
def self.summarize_checks(rollup)
|
|
108
109
|
return nil unless rollup
|
|
109
110
|
|
|
@@ -119,8 +120,12 @@ class Hiiro
|
|
|
119
120
|
failed = contexts.count do |c|
|
|
120
121
|
FAILED_CONCLUSIONS.include?(c['conclusion']) || %w[FAILURE ERROR].include?(c['state'])
|
|
121
122
|
end
|
|
123
|
+
frozen = contexts.count do |c|
|
|
124
|
+
c['context'] == 'ISC code freeze' &&
|
|
125
|
+
(FAILED_CONCLUSIONS.include?(c['conclusion']) || %w[FAILURE ERROR].include?(c['state']))
|
|
126
|
+
end
|
|
122
127
|
|
|
123
|
-
{ 'total' => total, 'success' => success, 'pending' => pending, 'failed' => failed }
|
|
128
|
+
{ 'total' => total, 'success' => success, 'pending' => pending, 'failed' => failed, 'frozen' => frozen }
|
|
124
129
|
end
|
|
125
130
|
|
|
126
131
|
# Summarizes raw review nodes into { approved, changes_requested, commented, reviewers }.
|
data/lib/hiiro/version.rb
CHANGED