gowalk-cicd 1.0.6 → 1.0.7
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.
package/action/.daemux-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.7
|
|
@@ -28,6 +28,13 @@ from pathlib import Path
|
|
|
28
28
|
from asc_common import get_json, request
|
|
29
29
|
|
|
30
30
|
|
|
31
|
+
# asc_common.request signals a non-retryable failure with SystemExit, which is
|
|
32
|
+
# a BaseException — `except Exception` sails straight past it. Spelling both
|
|
33
|
+
# out is what makes the "best-effort" promise below actually hold; without it
|
|
34
|
+
# a capability call that Apple rejects kills the whole signing step.
|
|
35
|
+
_API_FAILURES = (Exception, SystemExit)
|
|
36
|
+
|
|
37
|
+
|
|
31
38
|
# Entitlement key -> App Store Connect capabilityType, for capabilities that
|
|
32
39
|
# are a bare toggle. An entitlement absent from this map is not an error: most
|
|
33
40
|
# entitlements (keychain-access-groups, get-task-allow, ...) need no App ID
|
|
@@ -100,11 +107,10 @@ def warn_about_manual_entitlements(entitlement_keys: set[str], bundle_id: str) -
|
|
|
100
107
|
|
|
101
108
|
def enabled_capabilities(token: str, bundle_pk: str) -> set[str]:
|
|
102
109
|
try:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
except Exception as exc: # noqa: BLE001 - never fail signing over a read
|
|
110
|
+
# No `limit` here: this relationship rejects it outright with
|
|
111
|
+
# PARAMETER_ERROR.ILLEGAL. Apple returns the full capability set.
|
|
112
|
+
data = get_json(f"/bundleIds/{bundle_pk}/bundleIdCapabilities", token)
|
|
113
|
+
except _API_FAILURES as exc:
|
|
108
114
|
print(f"::warning::could not list capabilities for {bundle_pk}: {exc!r}")
|
|
109
115
|
return set()
|
|
110
116
|
found = set()
|
|
@@ -131,7 +137,7 @@ def enable_capability(token: str, bundle_pk: str, capability: str) -> bool:
|
|
|
131
137
|
"POST", "/bundleIdCapabilities", token,
|
|
132
138
|
json_body=body, allow_status={200, 201, 409},
|
|
133
139
|
)
|
|
134
|
-
except
|
|
140
|
+
except _API_FAILURES as exc:
|
|
135
141
|
print(f"::warning::could not enable {capability}: {exc!r}")
|
|
136
142
|
return False
|
|
137
143
|
if response.status_code == 409:
|
|
@@ -129,6 +129,26 @@ class ReconcileTest(unittest.TestCase):
|
|
|
129
129
|
|
|
130
130
|
self.assertFalse(changed)
|
|
131
131
|
|
|
132
|
+
def test_systemexit_from_asc_does_not_kill_signing(self) -> None:
|
|
133
|
+
# asc_common.request raises SystemExit, not Exception, so a bare
|
|
134
|
+
# `except Exception` would let an Apple 4xx abort the whole run.
|
|
135
|
+
with mock.patch.object(capabilities, "get_json", side_effect=SystemExit("400")), \
|
|
136
|
+
mock.patch.object(capabilities, "request", side_effect=SystemExit("400")):
|
|
137
|
+
changed = capabilities.reconcile(
|
|
138
|
+
"tok", "PK", "com.gowalk.form",
|
|
139
|
+
{"com.apple.developer.devicecheck.appattest-environment"},
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
self.assertFalse(changed)
|
|
143
|
+
|
|
144
|
+
def test_capability_listing_sends_no_limit_parameter(self) -> None:
|
|
145
|
+
# /bundleIds/{id}/bundleIdCapabilities rejects `limit` with
|
|
146
|
+
# PARAMETER_ERROR.ILLEGAL rather than ignoring it.
|
|
147
|
+
with mock.patch.object(capabilities, "get_json", return_value={"data": []}) as get:
|
|
148
|
+
capabilities.enabled_capabilities("tok", "PK")
|
|
149
|
+
|
|
150
|
+
get.assert_called_once_with("/bundleIds/PK/bundleIdCapabilities", "tok")
|
|
151
|
+
|
|
132
152
|
def test_warns_about_capabilities_it_will_not_guess(self) -> None:
|
|
133
153
|
with mock.patch.object(capabilities, "get_json", return_value={"data": []}), \
|
|
134
154
|
mock.patch("builtins.print") as printed:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.7
|