Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(build): Use semver version in docker version tag #2065

Merged
merged 5 commits into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build-system/scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ if [[ -n "$COMMIT_TAG" ]]; then
VERSION=$(npx semver $COMMIT_TAG_VERSION)
if [ -z "$VERSION" ]; then
COMMIT_TAG_VERSION=""
else
COMMIT_TAG_VERSION=$VERSION
fi
else
COMMIT_TAG_VERSION=""
Expand Down
5 changes: 2 additions & 3 deletions yarn-project/aztec-cli/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export async function createCompatibleClient(rpcUrl: string, logger: DebugLogger
const expectedVersionRange = packageJsonContents.version; // During sandbox, we'll expect exact matches

try {
await checkServerVersion(client, expectedVersionRange, logger);
await checkServerVersion(client, expectedVersionRange);
} catch (err) {
if (err instanceof VersionMismatchError) {
logger.debug(err.message);
Expand All @@ -53,14 +53,13 @@ class VersionMismatchError extends Error {}
* @param rpc - RPC server connection.
* @param expectedVersionRange - Expected version by CLI.
*/
export async function checkServerVersion(rpc: AztecRPC, expectedVersionRange: string, logger?: DebugLogger) {
export async function checkServerVersion(rpc: AztecRPC, expectedVersionRange: string) {
const serverName = 'Aztec Sandbox';
const { client } = await rpc.getNodeInfo();
if (!client) {
throw new VersionMismatchError(`Couldn't determine ${serverName} version. You may run into issues.`);
}
const version = client.split('@')[1];
logger?.warn(`Comparing server version ${version} against CLI expected ${expectedVersionRange}`);
if (!version || !valid(version)) {
throw new VersionMismatchError(`Missing or invalid version identifier for ${serverName} (${version ?? 'empty'}).`);
} else if (!satisfies(version, expectedVersionRange)) {
Expand Down