nasa / earthdata-search

Earthdata Search is a web application developed by NASA EOSDIS to enable data discovery, search, comparison, visualization, and access across EOSDIS' Earth Science data holdings.
https://search.earthdata.nasa.gov
Other
743 stars 221 forks source link

EDSC-4212: Fix the minify exception when running with invoke-local; Add workflow documentation #1784

Closed eudoroolivares2016 closed 1 month ago

eudoroolivares2016 commented 2 months ago

…dd documentation for running lambdas

Overview

What is the feature?

This fixes an issue on esbuild where if you run lambda's locally we are not able to fire this off because the build is getting minified. This is because the stage is getting resolved to invokeLocal

What is the Solution?

Update the map for whether to minify or not with invokeLocal as an option and make it false if that is the case

What areas of the application does this impact?

Local development workflows for running lambdas on dev machines

Testing

Reproduction steps

  1. Create a Harmony order on EDSC locally
  2. Submit the Harmony order via npm run invoke-local -- --function fetchHarmonyOrder --path ./event.json Where the event.json is some file that includes { "Records": [ { "body": { "accessToken": "", "id": 1 } } ] }

id is going to be the latest (or whichever matches the Harmony submission you did) id value on the RDS for the retrieval_orders table and the accessToken is the JWT token associated to the order (should be in the corresponding retrievals table if you follow the foreign keys)

  1. This event we either need to disable the JSON.parse on the lambda or otherwise stringify the event above.

  2. Once submitted check that it worked on https://harmony.earthdata.nasa.gov/workflow-ui (this is PROD Harmony, but, its just whatever env your harmony order was made in)

Attachments

Please include relevant screenshots or files that would be helpful in reviewing and verifying this change.

Checklist

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 82.41%. Comparing base (ff0ab6c) to head (799eb70). Report is 9 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1784 +/- ## ========================================== + Coverage 82.40% 82.41% +0.01% ========================================== Files 700 700 Lines 17503 17503 Branches 4565 4595 +30 ========================================== + Hits 14423 14425 +2 + Misses 3027 2870 -157 - Partials 53 208 +155 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

eudoroolivares2016 commented 1 month ago

Closing this its being done in the swodlr work