Skip to content

Commit e8a9af3

Browse files
test release archive overlong expected revisions
1 parent 97e46f7 commit e8a9af3

5 files changed

Lines changed: 56 additions & 11 deletions

File tree

‎docs/getting-started/installation.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ first-contract CLI smoke against the unpacked `modal` binary. The language CLI
143143
revision may be the exact provenance revision or a longer matching hex prefix
144144
for the same commit; expected revisions must be full commit hashes or Git-style
145145
short hashes of at least seven lowercase hexadecimal characters. The producer
146-
and downloaded-artifact verifier both reject uppercase expected revision tokens
147-
before replay evidence can pass. Set
146+
and downloaded-artifact verifier both reject uppercase or overlong expected
147+
revision tokens before replay evidence can pass. Set
148148
`MODAL_ONBOARDING_ARCHIVE_EXPECT_REV=<commit>` when release evidence must fail
149149
if the built `modal` binary is stale or came from a different source revision.
150150
The `.github/workflows/onboarding-release-archive.yml` workflow wires this into
@@ -356,8 +356,8 @@ The producer-side archive smoke and the downloaded-artifact verifier both
356356
accept exact or matching-prefix hex revision markers for the same commit before
357357
claiming same-revision first-contract replay, and both reject expected or
358358
same-revision language CLI revision tokens shorter than seven hexadecimal
359-
characters. They also reject uppercase expected revision tokens before producer
360-
or downloaded-artifact replay evidence can pass. The producer-side archive
359+
characters. They also reject uppercase or overlong expected revision tokens
360+
before producer or downloaded-artifact replay evidence can pass. The producer-side archive
361361
smoke now also independently enforces
362362
the same single-line `modality` prefix and supported-marker shape with no other
363363
parenthesized version notes, duplicate revision markers, bare `@...` markers,

‎tests/README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ consumer. Set
217217
`MODAL_ONBOARDING_ARCHIVE_EXPECT_REV=<commit>` when release evidence must fail
218218
if the built `modal` binary is stale or came from a different source revision.
219219
The producer and downloaded-artifact verifier both reject uppercase expected
220-
revision tokens before replay evidence can pass.
220+
or overlong revision tokens before replay evidence can pass.
221221
The archive check also runs the downloaded-artifact verifier against the
222222
generated archive directory, which simulates the GitHub Actions artifact
223223
consumer path by requiring exactly one `modal-*.tar.gz`, its matching detached
@@ -312,7 +312,8 @@ independently enforces the same single-line `modality` prefix and
312312
supported-marker shape with no other parenthesized version notes, duplicate
313313
revision markers, bare `@...` markers, or trailing marker text before local first-contract replay.
314314
It also rejects uppercase expected revision tokens before producer or
315-
downloaded-artifact replay evidence can pass.
315+
downloaded-artifact replay evidence can pass, and rejects overlong expected
316+
revision tokens before either replay entry point can pass.
316317
When a regular
317318
non-symlink executable
318319
`MODALITY_BIN` is available, the producer smoke also runs

‎tests/cli/README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ command for artifact consumers in the canonical emitted order. Set
107107
`MODAL_ONBOARDING_ARCHIVE_EXPECT_REV=<commit>` when release
108108
evidence must fail if the built `modal` binary is stale or came from a
109109
different source revision. The producer and downloaded-artifact verifier both
110-
reject uppercase expected revision tokens before replay evidence can pass.
110+
reject uppercase or overlong expected revision tokens before replay evidence can pass.
111111

112112
To verify a downloaded GitHub Actions artifact before unpacking or trusting it:
113113

@@ -201,7 +201,7 @@ archive smoke applies the same language-CLI version-shape check before local
201201
first-contract replay, including direct producer-side negatives for duplicate
202202
revision markers, bare `@...` markers, and trailing marker text.
203203
The producer and downloaded-artifact verifier also reject uppercase expected
204-
revision tokens before replay evidence can pass.
204+
or overlong revision tokens before replay evidence can pass.
205205

206206
The archive producer selects the source checkout revision before falling back
207207
to any embedded `modal --version` revision marker, and its negative corpus

‎tests/cli/check-modal-release-archive-readiness.sh‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,23 @@ $negative_output
10441044
EOF
10451045
exit 1
10461046
fi
1047+
long_expected_revision="${source_revision}0"
1048+
negative_output="$(
1049+
MODAL_ONBOARDING_ARTIFACT_EXPECT_REV="$long_expected_revision" \
1050+
"$ROOT_DIR/tests/cli/check-modal-release-artifact-download.sh" "$ARCHIVE_DIR" 2>&1
1051+
)" && {
1052+
echo "release artifact verifier accepted an overlong expected revision" >&2
1053+
exit 1
1054+
}
1055+
if ! grep -Fq "release artifact expected source revision is not a lowercase hex commit token" <<<"$negative_output"; then
1056+
cat >&2 <<EOF
1057+
release artifact verifier rejected the overlong expected revision for the wrong reason
1058+
expected: release artifact expected source revision is not a lowercase hex commit token
1059+
actual:
1060+
$negative_output
1061+
EOF
1062+
exit 1
1063+
fi
10471064
upper_expected_revision="$(printf '%s' "${source_revision:0:7}" | tr '[:lower:]' '[:upper:]')"
10481065
negative_output="$(
10491066
MODAL_ONBOARDING_ARTIFACT_EXPECT_REV="$upper_expected_revision" \
@@ -4076,6 +4093,22 @@ $negative_output
40764093
EOF
40774094
exit 1
40784095
fi
4096+
negative_output="$(
4097+
MODAL_ONBOARDING_ARCHIVE_EXPECT_REV="$long_expected_revision" \
4098+
"$ROOT_DIR/tests/cli/check-modal-release-archive-readiness.sh" 2>&1
4099+
)" && {
4100+
echo "release archive readiness accepted an overlong producer expected revision" >&2
4101+
exit 1
4102+
}
4103+
if ! grep -Fq "release archive expected source revision is not a lowercase hex commit token" <<<"$negative_output"; then
4104+
cat >&2 <<EOF
4105+
release archive readiness rejected overlong producer expected revision for the wrong reason
4106+
expected: release archive expected source revision is not a lowercase hex commit token
4107+
actual:
4108+
$negative_output
4109+
EOF
4110+
exit 1
4111+
fi
40794112
negative_output="$(
40804113
MODAL_ONBOARDING_ARCHIVE_EXPECT_REV="$upper_expected_revision" \
40814114
"$ROOT_DIR/tests/cli/check-modal-release-archive-readiness.sh" 2>&1

‎tests/docs/check-installation-doc.sh‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ required_patterns=(
8080
"expected revisions must be full commit hashes or Git-style"
8181
"short hashes of at least seven lowercase hexadecimal characters"
8282
"producer"
83-
"downloaded-artifact verifier both reject uppercase expected revision tokens"
83+
"downloaded-artifact verifier both reject uppercase or overlong expected"
84+
"revision tokens"
8485
"before replay evidence can pass"
8586
"checks the unpacked help surface"
8687
"first-contract CLI smoke against the unpacked \`modal\` binary"
@@ -375,8 +376,8 @@ required_patterns=(
375376
"both reject expected or"
376377
"same-revision language CLI revision tokens shorter than seven hexadecimal"
377378
"characters"
378-
"They also reject uppercase expected revision tokens before producer"
379-
"or downloaded-artifact replay evidence can pass"
379+
"They also reject uppercase or overlong expected revision tokens"
380+
"before producer or downloaded-artifact replay evidence can pass"
380381
"uppercase revision markers are rejected"
381382
"smoke now also independently enforces"
382383
"same single-line \`modality\` prefix and supported-marker shape with no other"
@@ -783,6 +784,16 @@ if ! grep -Fq 'release artifact verifier accepted a too-short expected revision'
783784
echo "release archive producer should prove too-short expected revisions are rejected" >&2
784785
exit 1
785786
fi
787+
if ! grep -Fq 'release artifact verifier accepted an overlong expected revision' \
788+
"$ROOT_DIR/tests/cli/check-modal-release-archive-readiness.sh"; then
789+
echo "release archive producer should prove overlong artifact expected revisions are rejected" >&2
790+
exit 1
791+
fi
792+
if ! grep -Fq 'release archive readiness accepted an overlong producer expected revision' \
793+
"$ROOT_DIR/tests/cli/check-modal-release-archive-readiness.sh"; then
794+
echo "release archive producer should prove overlong producer expected revisions are rejected" >&2
795+
exit 1
796+
fi
786797
if ! grep -Fq '[[ ! "$modality_revision" =~ ^[0-9a-f]{7,40}$ ]]' \
787798
"$ROOT_DIR/tests/cli/check-modal-release-artifact-download.sh"; then
788799
echo "release artifact verifier should reject too-short smoke modality revisions" >&2

0 commit comments

Comments
 (0)