Skip to content

Commit f4e49bc

Browse files
committed
fix: accept stable starter release versions
1 parent 8da74fd commit f4e49bc

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

install.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ function Get-TargetRelease {
246246
if ($version -notmatch '^v[0-9A-Za-z][0-9A-Za-z._-]*$' -or $cliVersion -ne $version.Substring(1)) {
247247
throw 'Signed channel manifest tag and CLI version do not match.'
248248
}
249-
if (-not $starterVersion.EndsWith('-SNAPSHOT')) {
250-
throw 'Signed snapshot channel requires a SNAPSHOT starter version.'
249+
if ($starterVersion -notmatch '^[0-9]+\.[0-9]+\.[0-9]+(?:-[0-9A-Za-z][0-9A-Za-z.-]*)?$') {
250+
throw 'Signed channel manifest starter version is invalid.'
251251
}
252252
if ($releaseManifestSha256 -notmatch '^[0-9a-f]{64}$') {
253253
throw 'Signed channel manifest release digest is invalid.'

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ else
496496
CHANNEL_RELEASE_MANIFEST_SHA=$(manifest_string_value "$CHANNEL_MANIFEST_FILE" releaseManifestSha256)
497497
[ "$RESOLVED_CHANNEL" = snapshot ] || fail "Signed channel manifest is not the snapshot channel."
498498
[ "$CHANNEL_CLI_VERSION" = "${VERSION#v}" ] || fail "Signed channel manifest tag and CLI version do not match."
499-
case "$CHANNEL_STARTER_VERSION" in *-SNAPSHOT) ;; *) fail "Signed snapshot channel requires a SNAPSHOT starter version." ;; esac
499+
printf '%s\n' "$CHANNEL_STARTER_VERSION" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z][0-9A-Za-z.-]*)?$' || fail "Signed channel manifest starter version is invalid."
500500
printf '%s\n' "$CHANNEL_RELEASE_MANIFEST_SHA" | grep -Eq '^[0-9a-f]{64}$' || fail "Signed channel manifest release digest is invalid."
501501
printf '%s\n' "$CHANNEL_SOURCE_COMMIT" | grep -Eq '^[0-9a-f]{40}$' || fail "Signed channel manifest source commit is invalid."
502502
fi

test/installer-runtime.test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function createRelease(keys, version, platform, assetBytes, options = {}) {
6767
starter: {
6868
groupId: 'ai.ctxa',
6969
artifactId: 'spring-boot-starter-contexa',
70-
version: options.releaseStarterVersion || '0.1.0-SNAPSHOT',
70+
version: options.releaseStarterVersion || '0.1.0',
7171
},
7272
...(options.omitSource ? {} : {
7373
source: {
@@ -100,7 +100,7 @@ function createChannel(keys, version, options = {}) {
100100
channel: options.channel || 'snapshot',
101101
releaseTag: options.releaseTag || `v${version}`,
102102
cliVersion: options.cliVersion || version,
103-
starterVersion: options.starterVersion || '0.1.0-SNAPSHOT',
103+
starterVersion: options.starterVersion || '0.1.0',
104104
sourceCommit: options.sourceCommit || 'a'.repeat(40),
105105
releaseManifestSha256: options.releaseManifestSha256 || '0'.repeat(64),
106106
}, null, 2)}\n`);
@@ -548,7 +548,8 @@ test('PowerShell installer resolves the signed snapshot channel and rejects chan
548548

549549
await assertChannelFailure('channel-cli-mismatch', {}, { cliVersion: '9.9.5-other' });
550550
await assertChannelFailure('release-tag-mismatch', { releaseTag: 'v9.9.5-other' }, {});
551-
await assertChannelFailure('starter-mismatch', { releaseStarterVersion: '0.2.0-SNAPSHOT' }, {});
551+
await assertChannelFailure('starter-mismatch', { releaseStarterVersion: '0.2.0' }, {});
552+
await assertChannelFailure('invalid-starter-version', {}, { starterVersion: 'latest' });
552553
await assertChannelFailure('asset-mismatch', { manifestDigest: '0'.repeat(64) }, {});
553554
await assertChannelFailure('channel-signature', {}, { signingKey: wrongKeys.privateKey });
554555
await assertChannelFailure('legacy-release-schema', { schemaVersion: 1, omitSource: true }, {});

0 commit comments

Comments
 (0)