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

EDSC-3797: Added an option for concatenation for custom downloads via Harmony #1693

Merged
merged 30 commits into from
Nov 16, 2023

Conversation

bnp26
Copy link
Collaborator

@bnp26 bnp26 commented Nov 8, 2023

Overview

What is the feature?

Added an option for concatenation for custom downloads via Harmony
Please summarize the feature or fix.
Added checkbox for concatenation option as well as setting the checkbox to be checked if defaultConcatenation is true in the cmr request.

What is the Solution?

  • Added a new accessMethod options associated with the Harmony service.
    • supportsConcatenation (whether the option should show up)
    • defaultConcatenation (whether the option should be checked by default)
  • Implemented the new checkbox in AccessMethod
  • Implemented changes in the constructOrderPayload so concatenate is set to true if enableConcatenateDownload is true.

What areas of the application does this impact?

List impacted areas.

Testing

Reproduction steps

  • Environment for testing: UAT
  • Collection to test with: C1245618475-EEDTEST
  1. Navigate to (http://localhost:8080/search?ee=uat)
  2. Put in C1245618475-EEDTEST as the collection in the search box and search.
  3. Click on the collection and then select 6 granules before clicking download.
  4. Click on the 2nd radio button in the data access methods list
  5. Observe the combine data customization option come up with default = false so the combine data option should be off.
  6. click on the checkbox and then click download.
  7. Observe the download going through successfully.

Attachments

Screenshot 2023-11-09 at 1 22 25 PM

Checklist

  • I have added automated tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Copy link

codecov bot commented Nov 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5cd33a3) 91.90% compared to head (951248d) 91.90%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1693   +/-   ##
=======================================
  Coverage   91.90%   91.90%           
=======================================
  Files         724      726    +2     
  Lines       19361    19404   +43     
  Branches     4550     4570   +20     
=======================================
+ Hits        17793    17834   +41     
- Misses       1432     1434    +2     
  Partials      136      136           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@trevorlang
Copy link
Collaborator

Do you plan on adding reproduction steps? What collection did you use for testing? I'd like to take a look locally at some point today.

1 similar comment
@trevorlang
Copy link
Collaborator

Do you plan on adding reproduction steps? What collection did you use for testing? I'd like to take a look locally at some point today.

Copy link
Contributor

@macrouch macrouch left a comment

Choose a reason for hiding this comment

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

Agree with Trevor, reproduction steps need to be added. Those are also useful when you end up writing the test session

@daniel-zamora
Copy link
Contributor

approved per changes mentioned in the PR meeting

Copy link
Contributor

@macrouch macrouch left a comment

Choose a reason for hiding this comment

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

When checking the Enable Concatenation checkbox and refreshing the page, the form is not remembering the selected checkbox like it does with the other form fields. You need to be sure to put the value into the URL and populate it from the URL.

@bnp26
Copy link
Collaborator Author

bnp26 commented Nov 13, 2023

When checking the Enable Concatenation checkbox and refreshing the page, the form is not remembering the selected checkbox like it does with the other form fields. You need to be sure to put the value into the URL and populate it from the URL.

I added this as well as tests for it.

bnp26 and others added 3 commits November 14, 2023 15:28
Copy link
Contributor

@macrouch macrouch left a comment

Choose a reason for hiding this comment

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

@bnp26 bnp26 requested a review from macrouch November 16, 2023 15:24
Copy link
Contributor

@rushgeo rushgeo 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 to me.

When running locally, the submission to Harmony fails because SQS isn't mocked in our dev environment.
After following the steps in the description, I followed these steps to submit the order to Harmony:

  1. Make an event.json file that looks like this:
{
    "Records": [
        {
            "body": {
                "accessToken": "",
                "id": 
            }
        }
    ]
}
  1. Using TableTool or similar connected to your local Postgres DB, copy the token value from the last (newest) row in the retrievals table. Paste it into the empty quotes for accessToken in the JSON.
  2. Copy the id value from the last row of the retrieval_orders table. Paste it into event.json as the value for id. Save the event.json file.
  3. The value for body needs to be stringified, but everything outside of that needs to be valid JSON. Run these commands to make that conversion:
export body=$(jq -r '.Records[0].body' event.json)
jq -r '.Records[0].body = env.body' event.json | sed 's/\\n//g' > event_string.json
  1. Run the local lambda for submitting the Harmony order with that JSON payload:
npm run invoke-local -- --function submitHarmonyOrder --path ./event_string.json
  1. Confirm the order was submitted at https://harmony.uat.earthdata.nasa.gov/workflow-ui

@bnp26 bnp26 dismissed macrouch’s stale review November 16, 2023 18:58

Addressed the requested change

@bnp26 bnp26 merged commit 12f13a6 into main Nov 16, 2023
@bnp26 bnp26 deleted the EDSC-3797 branch November 16, 2023 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants