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

chore(override): enable passing down COPILOT env vars to CDK files #4350

Merged
merged 3 commits into from Jan 11, 2023

Conversation

efekarakus
Copy link
Contributor

Related #4208

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.

@efekarakus efekarakus requested a review from a team as a code owner January 10, 2023 22:13
@efekarakus efekarakus requested review from dannyrandall and removed request for a team January 10, 2023 22:13
@github-actions
Copy link

github-actions bot commented Jan 10, 2023

🍕 Here are the new binary sizes!

Name New size (kiB) size (kiB) Delta (%)
macOS (amd) 48436 47904 🥺 +1.11
macOS (arm) 49108 48576 🥺 +1.10
linux (amd) 42608 42124 🥺 +1.15
linux (arm) 41924 41472 🥺 +1.09
windows (amd) 39364 38940 🥺 +1.09

Copy link
Contributor

@iamhopaul123 iamhopaul123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall :shipit:

Comment on lines 8 to 13
readonly appName?: string;
readonly envName?: string;
}

export class TransformedStack extends cdk.Stack {
constructor (scope: cdk.App, id: string, props?: cdk.StackProps) {
constructor (scope: cdk.App, id: string, props: TransformedStackProps) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if appName and envName are optional, why do we make props required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good question 😂 changed to appName and envName being required

Comment on lines +25 to +27
exec struct {
LookPath func(file string) (string, error)
Command func(name string, args ...string) *exec.Cmd
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this be a problem for mock for unit test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope! In the unit tests we use the public constructor to define our own custom behavior:

WithCDK("some/path", CDKOpts{
   LookPathFn: func(string) (string, error) { return "", errors.New("some error") }
})

@codecov-commenter
Copy link

Codecov Report

Merging #4350 (16fdf09) into mainline (410856b) will increase coverage by 0.00%.
The diff coverage is 69.69%.

@@            Coverage Diff            @@
##           mainline    #4350   +/-   ##
=========================================
  Coverage     70.02%   70.03%           
=========================================
  Files           260      260           
  Lines         37030    37096   +66     
  Branches        266      266           
=========================================
+ Hits          25931    25979   +48     
- Misses         9853     9869   +16     
- Partials       1246     1248    +2     
Impacted Files Coverage Δ
internal/pkg/override/cdk.go 74.71% <69.69%> (-3.86%) ⬇️
internal/pkg/aws/sessions/sessions.go 36.95% <0.00%> (-1.39%) ⬇️
internal/pkg/override/override.go 87.14% <0.00%> (+2.14%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@huanjani huanjani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@mergify mergify bot merged commit 25f9a28 into aws:mainline Jan 11, 2023
Sprint 🏃‍♀️ automation moved this from In review to Pending release Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Sprint 🏃‍♀️
  
Pending release
Development

Successfully merging this pull request may close these issues.

None yet

4 participants