Skip to content

Issue/112#180

Open
tloubrieu-jpl wants to merge 34 commits into
developfrom
issue/112
Open

Issue/112#180
tloubrieu-jpl wants to merge 34 commits into
developfrom
issue/112

Conversation

@tloubrieu-jpl
Copy link
Copy Markdown
Contributor

@tloubrieu-jpl tloubrieu-jpl commented May 20, 2026

Fixes Github Issue: #140

Description

Summarize the ticket here

Overview of work done

Summarize the work you did

Overview of verification done

Summarize the testing and verification you've done. This includes unit tests or testing with specific data

Overview of integration done

Explain how this change was integration tested. Provide screenshots or logs if appropriate.

PR checklist:

  • Linted
  • Updated unit tests
  • Updated changelog
  • Integration testing

See Pull Request Review Checklist for pointers on reviewing this pull request

@tloubrieu-jpl tloubrieu-jpl marked this pull request as ready for review June 2, 2026 18:39
@tloubrieu-jpl tloubrieu-jpl requested a review from jackiryan June 2, 2026 18:40
Copy link
Copy Markdown
Contributor

@jackiryan jackiryan left a comment

Choose a reason for hiding this comment

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

Overall this is a reasonable change but the biggest thing is that the lambda name for the token dispenser is hardcoded and there is an account number hidden in a cassette. Also consider moving the two new cassettes into the tests directory.

Comment thread bignbit/utils.py

# Invoke the Lambda synchronously and get the token
response = lambda_client.invoke(
FunctionName='sndbx-launchpad_token_dispenser',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this always the name for the token dispenser lambda? The sndbx designation seems suspicious. Should this be configured in terraform?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a reason why the two cassettes in the cassettes directory are not in tests/cassettes? You should move them into the tests directory

body:
string: '<?xml version="1.0" encoding="UTF-8"?>

<Error><Code>AccessDenied</Code><Message>User: arn:aws:iam::536711851782:user/NGAPShApplicationDeveloper-bcwong1-580
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Account number and ARN for a user are exposed, this should be removed from the cassette file.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is good to see the cassette can be a lot simpler. I verified the tests pass on my end so I must have been overspecifying information.

Comment thread tests/test_utils.py
mock_boto.return_value = mock_lambda

result = get_harmony_client('PROD')
# 👇 double-encoded JSON (required by function)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove emoji in comment, this is just a style thing.

Comment thread tests/test_utils.py
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sonar Cube is dinging you for only having 68% coverage on the lines you added to utils.py, the minimum bar it sets is >=80%. You could add more unit tests but it's not required, we can merge with SonarCube "failing"

@jackiryan
Copy link
Copy Markdown
Contributor

One more thing @DavidVWoodSr this code fails in SIT with the following error at the Submit Harmony Job step:

"errorMessage": "An error occurred (InvalidRequestContentException) when calling the Invoke operation: Could not parse request body into json: Could not parse payload into json: Unrecognized token 'foobarbaz': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 1]"

Sounds like you can't pass the token as just a string, it has to be like {"token": "blah"} or the Authorization: Bearer thing. Do you have a way of testing in SIT? Our GH action is tied to the podaac SIT account, so you probably can't access that. Is there an ASDC SIT you can deploy to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants