Skip to content

Commit 4e81599

Browse files
authored
chore: reduce amount of throttling to CodeArtifact (#24402)
Our new mechanism of testing candidate packages in our pipeline is by uploading them to CodeArtifact, instead of using hacky local tools that fake being NPM, NuGet, Maven, etc. For the regression tests, we need access to versions `X` and `X+1` for packages, so we set all packages to `upstream: ALLOW` (individually, because there is no other way). This giant call volume is causing throttling which is alarming to the CodeArtifact team. Only enable configuring upstreams for the regression test jobs, which is a lot less than for all tests. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 2a81f0f commit 4e81599

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

packages/@aws-cdk-testing/cli-integ/bin/stage-distribution.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ async function main() {
3434
type: 'boolean',
3535
requiresArg: false,
3636
})
37+
.option('regression', {
38+
description: 'Enable access to previous versions of the staged packages (this is expensive for CodeArtifact so we only do it when necessary)',
39+
type: 'boolean',
40+
requiresArg: false,
41+
default: false,
42+
})
3743
.command('publish <DIRECTORY>', 'Publish a given directory', cmd => cmd
3844
.positional('DIRECTORY', {
3945
descripton: 'Directory distribution',
@@ -190,6 +196,7 @@ async function publish(repo: TestRepository, usageDir: UsageDir, args: {
190196
python?: boolean;
191197
java?: boolean;
192198
dotnet?: boolean;
199+
regression?: boolean;
193200
}) {
194201
const directory = `${args.DIRECTORY}`;
195202
const login = await repo.loginInformation();
@@ -221,8 +228,10 @@ async function publish(repo: TestRepository, usageDir: UsageDir, args: {
221228
await uploadDotnetPackages(glob.sync(path.join(directory, 'dotnet', '**', '*.nupkg')), usageDir);
222229
});
223230

224-
console.log('🛍 Configuring packages for upstream versions');
225-
await repo.markAllUpstreamAllow();
231+
if (args.regression) {
232+
console.log('🛍 Configuring packages for upstream versions');
233+
await repo.markAllUpstreamAllow();
234+
}
226235
}
227236

228237
function whichRepos(args: {

packages/aws-cdk/test/integ/test-cli-regression-against-current-code.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ previous=$(${INTEG_TOOLS}/bin/query-github last-release --token $GITHUB_TOKEN --
99
echo "Previous version is: $previous"
1010

1111
# Old tests, new CLI, new framework
12-
exec $INTEG_TOOLS/bin/download-and-run-old-tests "$previous" --use-cli-release=$VERSION cli-integ-tests
12+
exec $INTEG_TOOLS/bin/download-and-run-old-tests "$previous" --regression --use-cli-release=$VERSION cli-integ-tests

packages/aws-cdk/test/integ/test-cli-regression-against-latest-release.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ previous=$(${INTEG_TOOLS}/bin/query-github last-release --token $GITHUB_TOKEN --
88
echo "Previous version is: $previous"
99

1010
# Old tests, new CLI, old framework
11-
exec $INTEG_TOOLS/bin/download-and-run-old-tests "$previous" --use-cli-release=$VERSION --framework-version=$previous cli-integ-tests
11+
exec $INTEG_TOOLS/bin/download-and-run-old-tests "$previous" --regression --use-cli-release=$VERSION --framework-version=$previous cli-integ-tests

0 commit comments

Comments
 (0)