Skip to content

Commit d031dea

Browse files
committed
Require platform 1.2.0 in the CLI.
1 parent 420e981 commit d031dea

2 files changed

Lines changed: 15 additions & 12 deletions

File tree

‎packages/void/src/cli/client.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function readCliVersion(): string | null {
3636
const VOID_CLI_VERSION = readCliVersion();
3737

3838
/** The oldest Void platform release this CLI supports. */
39-
export const MIN_PLATFORM_VERSION = '1.1.11';
39+
export const MIN_PLATFORM_VERSION = '1.2.0';
4040

4141
const RELEASE_VERSION = /^(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$/;
4242

‎packages/void/test/unit/client-platform-version.test.ts‎

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function client(options: { checkPlatformVersion?: boolean } = {}): PlatformClien
5454
}
5555

5656
describe('minimum platform version', () => {
57-
it.each(['1.1.11', '1.2.0', '2.0.0', 'hosted'])(
57+
it.each(['1.2.0', '1.2.1', '2.0.0', 'hosted'])(
5858
'accepts a platform reporting %s',
5959
async (version) => {
6060
serve(version);
@@ -64,22 +64,25 @@ describe('minimum platform version', () => {
6464
);
6565

6666
it('sends discovery without the account token', async () => {
67-
serve('1.1.11');
67+
serve('1.2.0');
6868
await client().listProjectChoices();
6969
const [, init] = fetchMock.mock.calls[0] as [string, RequestInit];
7070
expect(init.headers).not.toHaveProperty('Authorization');
7171
});
7272

73-
it.each(['1.1.0', '1.1.9', '1.1.11-1'])('refuses a platform reporting %s', async (version) => {
74-
serve(version);
75-
await expect(client().listProjectChoices()).rejects.toThrow(
76-
`The Void platform at ${origin} runs version ${version}, but this CLI requires 1.1.11 or later. Ask its administrator to upgrade the platform runtime with \`void platform upgrade\`.`,
77-
);
78-
expect(requestedPaths()).toEqual(['/.well-known/void-platform']);
79-
});
73+
it.each(['1.1.0', '1.1.11', '1.1.12', '1.2.0-1'])(
74+
'refuses a platform reporting %s',
75+
async (version) => {
76+
serve(version);
77+
await expect(client().listProjectChoices()).rejects.toThrow(
78+
`The Void platform at ${origin} runs version ${version}, but this CLI requires 1.2.0 or later. Ask its administrator to upgrade the platform runtime with \`void platform upgrade\`.`,
79+
);
80+
expect(requestedPaths()).toEqual(['/.well-known/void-platform']);
81+
},
82+
);
8083

8184
it('checks once per process and base URL, sharing a concurrent first check', async () => {
82-
serve('1.1.11');
85+
serve('1.2.0');
8386
await Promise.all([client().listProjectChoices(), client().listProjects()]);
8487
await client().listProjectChoices();
8588
expect(requestedPaths().filter((path) => path === '/.well-known/void-platform')).toHaveLength(
@@ -110,7 +113,7 @@ describe('minimum platform version', () => {
110113
['a JSON 404', () => Response.json({ error: 'not found' }, { status: 404 })],
111114
])('refuses a platform that answers discovery with %s', async (_label, answer) => {
112115
serve(answer);
113-
const message = `The Void platform at ${origin} does not report its version, but this CLI requires 1.1.11 or later. Ask its administrator to upgrade the platform runtime with \`void platform upgrade\`.`;
116+
const message = `The Void platform at ${origin} does not report its version, but this CLI requires 1.2.0 or later. Ask its administrator to upgrade the platform runtime with \`void platform upgrade\`.`;
114117
await expect(client().listProjectChoices()).rejects.toThrow(message);
115118
await expect(client().listProjects()).rejects.toThrow(message);
116119
expect(requestedPaths()).toEqual(['/.well-known/void-platform']);

0 commit comments

Comments
 (0)