Delete --compatibility=1.63 code from the server (#183738)

This commit is contained in:
Martin Aeschlimann
2023-05-30 00:24:14 +02:00
committed by GitHub
parent 4ec04f4c25
commit c2a9a86afa
6 changed files with 1 additions and 89 deletions

View File

@@ -309,8 +309,6 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
.pipe(replace('@@COMMIT@@', commit))
.pipe(replace('@@APPNAME@@', product.applicationName))
.pipe(rename(`bin/helpers/browser.cmd`)),
gulp.src('resources/server/bin/server-old.cmd', { base: '.' })
.pipe(rename(`server.cmd`)),
gulp.src('resources/server/bin/code-server.cmd', { base: '.' })
.pipe(rename(`bin/${product.serverApplicationName}.cmd`)),
);
@@ -332,13 +330,6 @@ function packageTask(type, platform, arch, sourceFolderName, destinationFolderNa
.pipe(rename(`bin/${product.serverApplicationName}`))
.pipe(util.setExecutableBit())
);
if (type !== 'reh-web') {
result = es.merge(result,
gulp.src('resources/server/bin/server-old.sh', { base: '.' })
.pipe(rename(`server.sh`))
.pipe(util.setExecutableBit()),
);
}
}
return result.pipe(vfs.dest(destination));

View File

@@ -1,24 +0,0 @@
@echo off
setlocal
set ROOT_DIR=%~dp0
set _FIRST_ARG=%1
if "%_FIRST_ARG:~0,9%"=="--inspect" (
set INSPECT=%1
shift
) else (
set INSPECT=
)
:loop1
if "%~1"=="" goto after_loop
set RESTVAR=%RESTVAR% %1
shift
goto loop1
:after_loop
"%ROOT_DIR%node.exe" %INSPECT% "%ROOT_DIR%out\server-main.js" --compatibility=1.63 %RESTVAR%
endlocal

View File

@@ -1,12 +0,0 @@
#!/usr/bin/env sh
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
case "$1" in
--inspect*) INSPECT="$1"; shift;;
esac
ROOT="$(dirname "$0")"
"$ROOT/node" ${INSPECT:-} "$ROOT/out/server-main.js" --compatibility=1.63 "$@"

View File

@@ -45,12 +45,6 @@ async function start() {
return;
}
if (parsedArgs['compatibility'] === '1.63') {
console.warn(`server.sh is being replaced by 'bin/${product.serverApplicationName}'. Please migrate to the new command and adopt the following new default behaviors:`);
console.warn('* connection token is mandatory unless --without-connection-token is used');
console.warn('* host defaults to `localhost`');
}
/**
* @typedef { import('./vs/server/node/remoteExtensionHostAgentServer').IServerAPI } IServerAPI
*/

View File

@@ -29,17 +29,6 @@ export class NoneServerConnectionToken {
}
}
export class OptionalServerConnectionToken {
public readonly type = ServerConnectionTokenType.Optional;
constructor(public readonly value: string) {
}
public validate(connectionToken: any): boolean {
return (connectionToken === this.value);
}
}
export class MandatoryServerConnectionToken {
public readonly type = ServerConnectionTokenType.Mandatory;
@@ -51,7 +40,7 @@ export class MandatoryServerConnectionToken {
}
}
export type ServerConnectionToken = NoneServerConnectionToken | OptionalServerConnectionToken | MandatoryServerConnectionToken;
export type ServerConnectionToken = NoneServerConnectionToken | MandatoryServerConnectionToken;
export class ServerConnectionTokenParseError {
constructor(
@@ -63,7 +52,6 @@ export async function parseServerConnectionToken(args: ServerParsedArgs, default
const withoutConnectionToken = args['without-connection-token'];
const connectionToken = args['connection-token'];
const connectionTokenFile = args['connection-token-file'];
const compatibility = (args['compatibility'] === '1.63');
if (withoutConnectionToken) {
if (typeof connectionToken !== 'undefined' || typeof connectionTokenFile !== 'undefined') {
@@ -96,20 +84,9 @@ export async function parseServerConnectionToken(args: ServerParsedArgs, default
return new ServerConnectionTokenParseError(`The connection token '${connectionToken} does not adhere to the characters 0-9, a-z, A-Z or -.`);
}
if (compatibility) {
// TODO: Remove this case soon
return new OptionalServerConnectionToken(connectionToken);
}
return new MandatoryServerConnectionToken(connectionToken);
}
if (compatibility) {
// TODO: Remove this case soon
console.log(`Breaking change in the next release: Please use one of the following arguments: '--connection-token', '--connection-token-file' or '--without-connection-token'.`);
return new OptionalServerConnectionToken(await defaultValue());
}
return new MandatoryServerConnectionToken(await defaultValue());
}

View File

@@ -27,13 +27,6 @@ suite('parseServerConnectionToken', () => {
assert.ok(result.type === ServerConnectionTokenType.Mandatory);
});
test('no arguments with --compatibility generates a token that is not mandatory', async () => {
const result = await parseServerConnectionToken({ 'compatibility': '1.63' } as ServerParsedArgs, async () => 'defaultTokenValue');
assert.ok(!(result instanceof ServerConnectionTokenParseError));
assert.ok(result.type === ServerConnectionTokenType.Optional);
assert.strictEqual(result.value, 'defaultTokenValue');
});
test('--without-connection-token', async () => {
const result = await parseServerConnectionToken({ 'without-connection-token': true } as ServerParsedArgs, async () => 'defaultTokenValue');
assert.ok(!(result instanceof ServerConnectionTokenParseError));
@@ -74,11 +67,4 @@ suite('parseServerConnectionToken', () => {
assert.strictEqual(result.value, connectionToken);
});
test('--connection-token --compatibility marks a as not mandatory', async () => {
const connectionToken = `12345-123-abc`;
const result = await parseServerConnectionToken({ 'connection-token': connectionToken, 'compatibility': '1.63' } as ServerParsedArgs, async () => 'defaultTokenValue');
assert.ok(!(result instanceof ServerConnectionTokenParseError));
assert.ok(result.type === ServerConnectionTokenType.Optional);
assert.strictEqual(result.value, connectionToken);
});
});