Skip to content

Commit

Permalink
chore: reduce amount of throttling to CodeArtifact (aws#24402)
Browse files Browse the repository at this point in the history
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*
  • Loading branch information
rix0rrr authored and homakk committed Mar 28, 2023
1 parent db0d656 commit 17fa859
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
13 changes: 11 additions & 2 deletions packages/@aws-cdk-testing/cli-integ/bin/stage-distribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ async function main() {
type: 'boolean',
requiresArg: false,
})
.option('regression', {
description: 'Enable access to previous versions of the staged packages (this is expensive for CodeArtifact so we only do it when necessary)',
type: 'boolean',
requiresArg: false,
default: false,
})
.command('publish <DIRECTORY>', 'Publish a given directory', cmd => cmd
.positional('DIRECTORY', {
descripton: 'Directory distribution',
Expand Down Expand Up @@ -190,6 +196,7 @@ async function publish(repo: TestRepository, usageDir: UsageDir, args: {
python?: boolean;
java?: boolean;
dotnet?: boolean;
regression?: boolean;
}) {
const directory = `${args.DIRECTORY}`;
const login = await repo.loginInformation();
Expand Down Expand Up @@ -221,8 +228,10 @@ async function publish(repo: TestRepository, usageDir: UsageDir, args: {
await uploadDotnetPackages(glob.sync(path.join(directory, 'dotnet', '**', '*.nupkg')), usageDir);
});

console.log('🛍 Configuring packages for upstream versions');
await repo.markAllUpstreamAllow();
if (args.regression) {
console.log('🛍 Configuring packages for upstream versions');
await repo.markAllUpstreamAllow();
}
}

function whichRepos(args: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ previous=$(${INTEG_TOOLS}/bin/query-github last-release --token $GITHUB_TOKEN --
echo "Previous version is: $previous"

# Old tests, new CLI, new framework
exec $INTEG_TOOLS/bin/download-and-run-old-tests "$previous" --use-cli-release=$VERSION cli-integ-tests
exec $INTEG_TOOLS/bin/download-and-run-old-tests "$previous" --regression --use-cli-release=$VERSION cli-integ-tests
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ previous=$(${INTEG_TOOLS}/bin/query-github last-release --token $GITHUB_TOKEN --
echo "Previous version is: $previous"

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

0 comments on commit 17fa859

Please sign in to comment.