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

HARMONY-1958: Allow service chains to skip validating variables exist in the CMR #684

Merged
merged 8 commits into from
Jan 27, 2025

Conversation

chris-durbin
Copy link
Contributor

@chris-durbin chris-durbin commented Jan 27, 2025

Jira Issue ID

HARMONY-1958

Description

Allows service chains to skip validating variables exist in the CMR. This was requested by the Giovanni team to support their future time and area averaging services.

Local Test Steps

Since no service chains are currently configured to skip validation you will need to manually modify one of the service chains.

First test without changing services.yml to make sure you get a validation error with something like:
http://localhost:3000/C1233800302-EEDTEST/ogc-api-coverages/1.0.0/collections/bad_var/coverage/rangeset?subset=lat(20%3A60)&subset=lon(-140%3A-50)&granuleId=G1233800343-EEDTEST&outputCrs=EPSG%3A31975&format=image%2Fpng&subset=time(%222002-09-15T00%3A00%3A00.000Z%22%3A%222022-09-25T00%3A00%3A00Z%22)

{
	"code": "harmony.RequestValidationError",
	"description": "Error: Coverages were not found for the provided variables: bad_var"
}

Then modify the harmony-service-example chain for UAT and add validate_variables: false to the service chain definition. Repeat the request. This time the request should be accepted and you should see it in the workflow-ui. It will fail because the service will not be able to find bad_var, but does confirm that the validation is being skipped.

PR Acceptance Checklist

  • Acceptance criteria met
  • Tests added/updated (if needed) and passing
  • Documentation updated (if needed)
  • Harmony in a Box tested? (if changes made to microservices)

@chris-durbin chris-durbin requested review from indiejames, ygliuvt and vinnyinverso and removed request for indiejames and ygliuvt January 27, 2025 12:39
Copy link
Member

@ygliuvt ygliuvt left a comment

Choose a reason for hiding this comment

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

Tested successfully locally.

Copy link
Contributor

@indiejames indiejames left a comment

Choose a reason for hiding this comment

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

Tested locally

* in most cases the sequence of minimum longitude, minimum latitude,
* maximum longitude and maximum latitude.
*/
function parseBbox(value: string | string[] | number[]): number[] | null {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I don't think this function ever returns null

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went to change it, but if the value is null/undefined/empty it will not return a value, which I think means it returns null. It's the same signature as a similar function used elsewhere for parsing an EDR bbox.

@chris-durbin chris-durbin merged commit b453d9c into main Jan 27, 2025
5 checks passed
@chris-durbin chris-durbin deleted the harmony-1958 branch January 27, 2025 20:19
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.

3 participants