claude-dev-env 8.33.1 → 8.33.2
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.
|
@@ -59,6 +59,7 @@ try:
|
|
|
59
59
|
ALL_FAILING_CHECK_CONCLUSIONS,
|
|
60
60
|
ALL_PASSING_CHECK_CONCLUSIONS,
|
|
61
61
|
CHECK_COMPLETED_STATUS,
|
|
62
|
+
CHECKS_NOT_REPORTED_TEXT,
|
|
62
63
|
DONE_LABEL_NAME,
|
|
63
64
|
GH_PR_CREATE_ACTION,
|
|
64
65
|
GH_PR_SUBCOMMAND,
|
|
@@ -164,7 +165,7 @@ def _check_counts(all_pr_fields: dict[str, object]) -> dict[str, int]:
|
|
|
164
165
|
|
|
165
166
|
def _checks_line(all_check_counts: dict[str, int]) -> str:
|
|
166
167
|
if all_check_counts["total"] == 0:
|
|
167
|
-
return
|
|
168
|
+
return CHECKS_NOT_REPORTED_TEXT
|
|
168
169
|
return (
|
|
169
170
|
f"{all_check_counts['failing']} failing, "
|
|
170
171
|
f"{all_check_counts['pending']} pending, "
|
|
@@ -185,6 +186,7 @@ def _has_done_label(all_pr_fields: dict[str, object]) -> bool:
|
|
|
185
186
|
def _is_done(mergeable_value: str, all_check_counts: dict[str, int]) -> bool:
|
|
186
187
|
return (
|
|
187
188
|
mergeable_value == MERGEABLE_CLEAN_VALUE
|
|
189
|
+
and all_check_counts["total"] > 0
|
|
188
190
|
and all_check_counts["failing"] == 0
|
|
189
191
|
and all_check_counts["pending"] == 0
|
|
190
192
|
)
|
|
@@ -152,6 +152,58 @@ def test_should_say_done_when_mergeable_and_checks_pass() -> None:
|
|
|
152
152
|
assert "NOT DONE" not in context
|
|
153
153
|
|
|
154
154
|
|
|
155
|
+
def test_should_say_not_done_when_no_check_has_reported_on_the_head() -> None:
|
|
156
|
+
no_checks_yet = {**_CLEAN_PR_OBJECT, "statusCheckRollup": []}
|
|
157
|
+
|
|
158
|
+
context = pr_done_reminder.build_reminder_context(no_checks_yet)
|
|
159
|
+
|
|
160
|
+
assert "CI checks: none reported yet on this head." in context
|
|
161
|
+
assert "NOT DONE" in context
|
|
162
|
+
assert "gh pr edit 42 --add-label" not in context
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def test_should_say_not_done_when_the_rollup_is_missing() -> None:
|
|
166
|
+
no_rollup = {key: value for key, value in _CLEAN_PR_OBJECT.items() if key != "statusCheckRollup"}
|
|
167
|
+
|
|
168
|
+
context = pr_done_reminder.build_reminder_context(no_rollup)
|
|
169
|
+
|
|
170
|
+
assert "none reported yet on this head." in context
|
|
171
|
+
assert "NOT DONE" in context
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
def test_should_say_not_done_while_a_check_is_pending_on_an_otherwise_green_head() -> None:
|
|
175
|
+
one_pending = {
|
|
176
|
+
**_CLEAN_PR_OBJECT,
|
|
177
|
+
"statusCheckRollup": [
|
|
178
|
+
{"name": "pytest", "status": "COMPLETED", "conclusion": "SUCCESS"},
|
|
179
|
+
{"name": "mypy", "status": "QUEUED", "conclusion": ""},
|
|
180
|
+
],
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
context = pr_done_reminder.build_reminder_context(one_pending)
|
|
184
|
+
|
|
185
|
+
assert "1 pending" in context
|
|
186
|
+
assert "NOT DONE" in context
|
|
187
|
+
assert "gh pr edit 42 --add-label" not in context
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def test_should_say_done_when_every_reported_check_passed() -> None:
|
|
191
|
+
all_green = {
|
|
192
|
+
**_CLEAN_PR_OBJECT,
|
|
193
|
+
"statusCheckRollup": [
|
|
194
|
+
{"name": "pytest", "status": "COMPLETED", "conclusion": "SUCCESS"},
|
|
195
|
+
{"name": "docs", "status": "COMPLETED", "conclusion": "SKIPPED"},
|
|
196
|
+
{"context": "lint", "state": "SUCCESS"},
|
|
197
|
+
],
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
context = pr_done_reminder.build_reminder_context(all_green)
|
|
201
|
+
|
|
202
|
+
assert "CI checks: 0 failing, 0 pending, 3 total" in context
|
|
203
|
+
assert "Verdict: DONE. Add the label now:" in context
|
|
204
|
+
assert "NOT DONE" not in context
|
|
205
|
+
|
|
206
|
+
|
|
155
207
|
def test_should_keep_the_checklist_order_verdict_then_recheck_then_footer() -> None:
|
|
156
208
|
all_lines = pr_done_reminder.build_reminder_context(_CLEAN_PR_OBJECT).split("\n")
|
|
157
209
|
|
|
@@ -28,6 +28,7 @@ __all__ = [
|
|
|
28
28
|
"REMINDER_FOOTER",
|
|
29
29
|
"REMINDER_LINE_SEPARATOR",
|
|
30
30
|
"ALL_REMINDER_HINTS_BY_MERGEABLE",
|
|
31
|
+
"CHECKS_NOT_REPORTED_TEXT",
|
|
31
32
|
"VERDICT_DONE",
|
|
32
33
|
"VERDICT_NOT_DONE",
|
|
33
34
|
"NO_PULL_REQUEST_REMINDER",
|
|
@@ -75,6 +76,9 @@ ALL_REMINDER_HINTS_BY_MERGEABLE: dict[str, str] = {
|
|
|
75
76
|
),
|
|
76
77
|
MERGEABLE_UNKNOWN_VALUE: "GitHub is still computing. Re-run the re-check command in a minute.",
|
|
77
78
|
}
|
|
79
|
+
CHECKS_NOT_REPORTED_TEXT: str = (
|
|
80
|
+
"none reported yet on this head. Wait for the checks, then run the re-check command."
|
|
81
|
+
)
|
|
78
82
|
VERDICT_DONE: str = "DONE. Add the label now:"
|
|
79
83
|
VERDICT_NOT_DONE: str = "NOT DONE. Do not add the done label yet."
|
|
80
84
|
NO_PULL_REQUEST_REMINDER: str = (
|