Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

fix: bundle lambdas in script instead of command line #655

Merged
merged 7 commits into from
Jul 19, 2022

Conversation

ssvegaraju
Copy link
Contributor

@ssvegaraju ssvegaraju commented Jul 15, 2022

Issue #, if available:

Description of changes:
Created a script to move files as needed instead of using command line hooks. This resolves the failing action here https://github.com/awslabs/fhir-works-on-aws-deployment/actions/runs/2678017744

Checklist:

  • Have you successfully deployed to an AWS account with your changes?
  • Have you written new tests for your core changes, as applicable?

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

@ssvegaraju ssvegaraju requested a review from a team as a code owner July 15, 2022 20:00
@codecov-commenter
Copy link

codecov-commenter commented Jul 15, 2022

Codecov Report

Merging #655 (d10bf5d) into develop (b308d2a) will increase coverage by 4.87%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #655      +/-   ##
===========================================
+ Coverage    90.78%   95.65%   +4.87%     
===========================================
  Files            8        4       -4     
  Lines          282      207      -75     
  Branches        52       30      -22     
===========================================
- Hits           256      198      -58     
+ Misses          25        9      -16     
+ Partials         1        0       -1     
Impacted Files Coverage Δ
src/subscriptions/restHookLambda/restHook.ts 100.00% <100.00%> (ø)
src/config.ts
src/index.ts
src/implementationGuides/loadCompiledIGs.ts
src/RBACRules.ts

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b308d2a...d10bf5d. Read the comment docs.

Bingjiling
Bingjiling previously approved these changes Jul 18, 2022
Copy link
Contributor

@Bingjiling Bingjiling left a comment

Choose a reason for hiding this comment

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

Looks good! Could you please add the link of the failed GitHub action run to provide context for this fix?

ensureDirectoryExistence(`${outputDir}\\${fileToMove}`);
fs.copyFileSync(`${inputDir}\\${fileToMove}`, `${outputDir}\\${fileToMove}`);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit - No new line at end of file

Copy link
Contributor

@Bingjiling Bingjiling left a comment

Choose a reason for hiding this comment

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

Looks good! One last thing on logging -

@@ -67,8 +66,9 @@ export default class RestHookHandler {
event: SQSEvent,
allowListPromise: Promise<{ [key: string]: AllowListInfo }>,
): Promise<SQSBatchResponse> {
await ensureAsyncInit(allowListPromise);
console.log(allowListPromise);
Copy link
Contributor

Choose a reason for hiding this comment

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

Use logger.debug instead? The allowList might contain sensitive information that customers do not want in the log all the time.

@Bingjiling Bingjiling self-requested a review July 19, 2022 15:01
@ssvegaraju ssvegaraju merged commit d6d3e00 into develop Jul 19, 2022
@ssvegaraju ssvegaraju deleted the cdk-lambdaBundleFix branch July 19, 2022 15:02
Comment on lines 68 to 72
): Promise<SQSBatchResponse> {
await ensureAsyncInit(allowListPromise);
logger.debug(allowListPromise);
const allowList = await allowListPromise;
logger.debug(allowList);
const messages = event.Records.map((record: any): SubscriptionNotification => {
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like you are no longer calling

        await ensureAsyncInit(allowListPromise);

did you mean for that?

`cp ${inputDir}\\bulkExport\\schema\\transitiveReferenceParams.json ${outputDir}\\bulkExport\\schema\\transitiveReferenceParams.json`,
`cp ${inputDir}\\bulkExport\\schema\\${PATIENT_COMPARTMENT_V3} ${outputDir}\\bulkExport\\schema\\${PATIENT_COMPARTMENT_V3}`,
`cp ${inputDir}\\bulkExport\\schema\\${PATIENT_COMPARTMENT_V4} ${outputDir}\\bulkExport\\schema\\${PATIENT_COMPARTMENT_V4}`,
`node scripts/build_lambda.js ${inputDir} ${outputDir} bulkExport\\glueScripts\\export-script.py`,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we will want forward slashes not back slashes - https://stackoverflow.com/a/38428899

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants