Skip to content

Commit bd0c6c4

Browse files
authored
[static] Remove charts version and override version (#1218)
1 parent a350d25 commit bd0c6c4

File tree

7 files changed

+16
-77
lines changed

7 files changed

+16
-77
lines changed

.github/actions/scripts/backport_reminder.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,8 @@ async function getBranchesForCluster(deps, cluster) {
1616
const upgrade = config.synchronizerMigration.upgrade?.releaseReference.gitReference;
1717
const archived = config.synchronizerMigration.archived?.map((a) => a.releaseReference?.gitReference);
1818

19-
const envrc = await getFileFromGit(deps, `cluster/deployment/${cluster}/.envrc.vars`, 'main');
20-
const regex = /export OVERRIDE_VERSION=["]?[0-9]+.[0-9]+.[0-9]+["]?/g;
21-
const overrideVersion = envrc.match(regex)[0];
22-
const cnVersion = overrideVersion.split('=')[1].replaceAll('"', '');
23-
const cnVersionBranch = `refs/heads/release-line-${cnVersion}`;
24-
2519
return {
26-
cnVersion: cnVersionBranch,
20+
cnVersion: active,
2721
active,
2822
upgrade,
2923
archived

build-tools/get-charts-version

Lines changed: 0 additions & 21 deletions
This file was deleted.

build-tools/lib/hard-domain-migration-commands

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ EOF
5252
_update_cluster_config "$migration_config" "synchronizerMigration.$migration_type"
5353
}
5454

55-
subcommand_whitelist[update_active_version]='Upgrade the version of the active migration id including CHARTS_VERSION'
55+
subcommand_whitelist[update_active_version]='Upgrade the version of the active migration id'
5656

5757
function subcmd_update_active_version() {
5858
local cluster_directory
@@ -66,8 +66,6 @@ function subcmd_update_active_version() {
6666
else
6767
cluster_directory="${DEPLOYMENT_DIR}/${TARGET_CLUSTER}"
6868
fi
69-
set -x
70-
sed -i "s/^export CHARTS_VERSION=.*$/export CHARTS_VERSION=\"$1\"/" "$cluster_directory/.envrc.vars"
7169
}
7270

7371
subcommand_whitelist[update_config_to_migrate]='Upgrade the cluster config.yaml to migrate cluster'

build-tools/lib/pulumi-commands

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,6 @@ function subcmd_ci_apply_sv() {
276276
_info "Bootstrapping SV from ${BOOTSTRAPPING_CONFIG}"
277277
fi
278278

279-
local -x CHARTS_VERSION="${1-}"
280-
281279
_uses_pulumi_stack sv-runbook
282280

283281
subcmd_install_data_export_bucket_key
@@ -358,8 +356,6 @@ function subcmd_ci_apply_validator() {
358356
_info "Bootstrapping Validator from ${BOOTSTRAPPING_CONFIG}"
359357
fi
360358

361-
local -x CHARTS_VERSION="${1-}"
362-
363359
_uses_pulumi_stack validator-runbook
364360

365361
subcmd_install_data_export_bucket_key
@@ -401,11 +397,6 @@ function subcmd_apply_multi() {
401397
_prompt_to_confirm
402398
_cluster_must_exist
403399

404-
if [ -z "${MULTI_VALIDATOR_IMAGE_VERSION:-}" ]; then
405-
MULTI_VALIDATOR_IMAGE_VERSION=$(get-snapshot-version)
406-
export MULTI_VALIDATOR_IMAGE_VERSION
407-
fi
408-
409400
_uses_pulumi_stack multi-validator
410401
subcmd_pulumi multi-validator up --yes --skip-preview --show-sames "${args[@]}"
411402
}

build-tools/lib/pulumi-helpers

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ function _resolve_pulumi_stack() {
5151
}
5252

5353
function _cluster_reset() {
54-
# not used but required to pass config validation
55-
if [ -z "${CHARTS_VERSION:-}" ]; then
56-
export CHARTS_VERSION="local"
57-
fi
5854
_info "Uninstalling Pulumi canton-network and runbook stacks"
5955

6056
_pulumi_automation_run_down

cluster/pulumi/common/src/artifacts.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
22
// SPDX-License-Identifier: Apache-2.0
3-
import { spliceEnvConfig } from './config/envConfig';
43

54
export type CnChartVersion =
65
| { type: 'local' }
@@ -17,5 +16,3 @@ export function parsedVersion(version: string | undefined): CnChartVersion {
1716
}
1817
: { type: 'local' };
1918
}
20-
21-
export const CHARTS_VERSION: string | undefined = spliceEnvConfig.optionalEnv('CHARTS_VERSION');

cluster/pulumi/common/src/config/migrationSchema.ts

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,29 @@
11
// Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
22
// SPDX-License-Identifier: Apache-2.0
3-
import * as _ from 'lodash';
4-
import * as util from 'node:util';
53
import { z } from 'zod';
64

7-
import { CHARTS_VERSION, CnChartVersion, parsedVersion } from '../artifacts';
5+
import { CnChartVersion, parsedVersion } from '../artifacts';
86
import { spliceEnvConfig } from './envConfig';
97

108
export const defaultActiveMigration = {
119
id: 0,
12-
version: CHARTS_VERSION,
10+
version: 'local',
1311
sequencer: {
1412
enableBftSequencer: false,
1513
},
1614
};
1715

18-
const migrationVersion = z
19-
.string()
20-
.optional()
21-
.transform<CnChartVersion>((version, ctx) => {
22-
if (!version && !CHARTS_VERSION && spliceEnvConfig.optionalEnv('SPLICE_OPERATOR_DEPLOYMENT')) {
23-
ctx.addIssue({
24-
code: z.ZodIssueCode.custom,
25-
message: `No active version or CHARTS_VERSION specified`,
26-
});
27-
return z.NEVER;
28-
} else {
29-
return parsedVersion(version || CHARTS_VERSION);
30-
}
31-
});
16+
const migrationVersion = z.string().transform<CnChartVersion>((version, ctx) => {
17+
if (version == 'local' && spliceEnvConfig.optionalEnv('SPLICE_OPERATOR_DEPLOYMENT')) {
18+
ctx.addIssue({
19+
code: z.ZodIssueCode.custom,
20+
message: `Using a local version for the operator deployment is not supported.`,
21+
});
22+
return z.NEVER;
23+
} else {
24+
return parsedVersion(version);
25+
}
26+
});
3227

3328
export const GitReferenceSchema = z.object({
3429
repoUrl: z.string(),
@@ -63,18 +58,7 @@ export const SynchronizerMigrationSchema = z
6358
legacy: MigrationInfoSchema.optional(),
6459
active: MigrationInfoSchema.extend({
6560
migratingFrom: z.number().optional(),
66-
version: migrationVersion.transform((version, ctx) => {
67-
const parsedChartsVersion = parsedVersion(CHARTS_VERSION);
68-
if (CHARTS_VERSION && !_.isEqual(parsedChartsVersion, version)) {
69-
ctx.addIssue({
70-
code: z.ZodIssueCode.custom,
71-
message: `Specified different active version and CHARTS_VERSION: ${util.inspect(version)} - ${util.inspect(parsedChartsVersion)}`,
72-
});
73-
return z.NEVER;
74-
} else {
75-
return version;
76-
}
77-
}),
61+
version: migrationVersion,
7862
})
7963
.strict()
8064
.default(defaultActiveMigration),

0 commit comments

Comments
 (0)