Skip to content

Commit a62666f

Browse files
authored
chore: revert the alpha version computation and change the required version in the sam test (#19573)
The [previous change](#19560) breaks `jsii-pacmak` with the message: >Error: Unable to map prerelease identifier (in: 2.18.0-rc.0-alpha.0) to python, as sequence ‘0-alpha’ is not an integer Going for a more conservative solution here: keep the versions as they are and just replace `rc` with `alpha` in the tests that need to install alpha versions. ---- ### All Submissions: * [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/master/INTEGRATION_TESTS.md)? * [ ] Did you use `cdk-integ` to deploy the infrastructure and generate the snapshot (i.e. `cdk-integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 7ab2c30 commit a62666f

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

packages/aws-cdk/test/integ/helpers/sam.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ export function withSamIntegrationCdkApp<A extends TestContext & AwsContext>(blo
6060
} else {
6161
await installNpmPackages(fixture, {
6262
'aws-cdk-lib': installationVersion,
63-
'@aws-cdk/aws-lambda-go-alpha': `${installationVersion}-alpha.0`,
64-
'@aws-cdk/aws-lambda-python-alpha': `${installationVersion}-alpha.0`,
63+
'@aws-cdk/aws-lambda-go-alpha': installationVersion.replace('rc', 'alpha'),
64+
'@aws-cdk/aws-lambda-python-alpha': installationVersion.replace('rc', 'alpha'),
6565
'constructs': '^10',
6666
});
6767
}

tools/@aws-cdk/individual-pkg-gen/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,12 @@
2929
"@aws-cdk/cdk-build-tools": "0.0.0",
3030
"@aws-cdk/pkglint": "0.0.0",
3131
"@types/fs-extra": "^8.1.2",
32-
"@types/jest": "^27.4.1",
33-
"@types/semver": "^7.3.9"
32+
"@types/jest": "^27.4.1"
3433
},
3534
"dependencies": {
3635
"aws-cdk-migration": "0.0.0",
3736
"fs-extra": "^9.1.0",
38-
"@lerna/project": "4.0.0",
39-
"semver": "^7.3.5"
37+
"@lerna/project": "4.0.0"
4038
},
4139
"keywords": [
4240
"aws",

tools/@aws-cdk/individual-pkg-gen/transform-packages.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as path from 'path';
22
import * as awsCdkMigration from 'aws-cdk-migration';
33
import * as fs from 'fs-extra';
4-
import { SemVer, parse } from 'semver';
54
// eslint-disable-next-line @typescript-eslint/no-require-imports
65
const lerna_project = require('@lerna/project');
76
// eslint-disable-next-line @typescript-eslint/no-require-imports
@@ -159,10 +158,7 @@ function transformPackageJson(pkg: any, source: string, destination: string, alp
159158

160159
packageJson.name += '-alpha';
161160
if (ver.alphaVersion) {
162-
// The -rc.0 suffix is used in the integration pipeline to distinguish candidate packages from real NPM packages, and needs to be retained
163-
const rcSuffix = packageJson.version.endsWith('-rc.0') ? '-rc.0' : '';
164-
const { major, minor, patch } = parse(packageJson.version) as SemVer;
165-
packageJson.version = [major, minor, patch].join('.') + rcSuffix + '-alpha.0';
161+
packageJson.version = ver.alphaVersion;
166162
}
167163
packageJson.repository.directory = `packages/individual-packages/${pkgUnscopedName}`;
168164

0 commit comments

Comments
 (0)