aws / aws-toolkit-vscode

Amazon Q, CodeCatalyst, Local Lambda debug, SAM/CFN syntax, ECS Terminal, AWS resources
https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.amazon-q-vscode
Apache License 2.0
1.41k stars 346 forks source link

Fix[gumby]: include exportContext when downloadArtifactId is not undefined #5217

Closed JuliaABurch closed 5 days ago

JuliaABurch commented 1 week ago

Problem

Some gumby workflows need a specific artifact ID, but if one is not defined, we expect exportContext to not be defined

Solution

This change uses nullish coalition to optinally add the exportContext property when downloadArtifactId is defined.

Note: in adding test coverage, I brought the test from the amazonq package to the core package, as it tests the internals of the transformApiHandler class, which lives in the core package.

Testing done

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

justinmk3 commented 1 week ago

Note: in adding test coverage, I brought the test from the amazonq package to the core package, as it tests the internals of the transformApiHandler class, which lives in the core package.

Thanks for mentioning that. Can that be avoided? This is reversing the direction we want to go.

For example, try exporting from one of the index.ts files, e.g. https://github.com/aws/aws-toolkit-vscode/blob/f1ba3d1e0e48bb169e15dc7bf065c1518626423c/packages/core/src/amazonqFeatureDev/index.ts#L6-L10