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

CUMULUS-2688: New Granule endpoint GET /:collectionId/:granuleId #2978

Merged

Conversation

npauzenga
Copy link
Contributor

@npauzenga npauzenga commented Jun 6, 2022

Summary:

Addresses CUMULUS-2688: Develop amazing new feature

Changes

This is the endpoint update to allow users to fetch granules by their unique columns (collection_cumulus_id + granule_id).

The new endpoint is /:collectionId/:granuleName where collectionId is in the name___version format, NOT the collection_cumulus_id. It's done this way because we don't appear to index collection_cumulus_id in ES or return it from our LIST endpoint. This means that users/the dashboard aren't likely to have that ID from previous requests.

It would be nicer to use collection_cumulus_id/granule_id as the endpoint to save a Collection query but that seems like it would be less useful.

These changes are only adding the endpoint, not using the new functions elsewhere. I'd like to do those in a separate PR and maybe a separate ticket for some.

What's left:

  • Update granule DELETE, PUT endpoints to also require collectionId (likely need new endpoints like we have here)
  • Update granule bulk update logic to use new functions
  • Update CMR logic to use a collectionId

PR Checklist

  • Update CHANGELOG
  • Unit tests
  • Ad-hoc testing - Deploy changes and test manually
  • Integration tests

@npauzenga npauzenga changed the title WIP: Feature/cumulus 2688 new granule endpoint CUMULUS-2688: New Granule endpoint /:collectionId/:granuleId Jun 8, 2022
@npauzenga npauzenga changed the title CUMULUS-2688: New Granule endpoint /:collectionId/:granuleId CUMULUS-2688: New Granule endpoint GET /:collectionId/:granuleId Jun 8, 2022
Copy link
Member

@Jkovarik Jkovarik left a comment

Choose a reason for hiding this comment

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

Great work! Just a couple of comments/considerations. Let me know what you think, and as always I'm available to pair/discuss anytime.

packages/api-client/src/granules.ts Show resolved Hide resolved
packages/api-client/tests/test-granules.js Outdated Show resolved Hide resolved
packages/db/src/lib/granule.ts Show resolved Hide resolved
packages/db/src/lib/granule.ts Outdated Show resolved Hide resolved
packages/db/src/lib/granule.ts Outdated Show resolved Hide resolved
packages/api/endpoints/granules.js Outdated Show resolved Hide resolved
packages/api/endpoints/granules.js Show resolved Hide resolved
packages/api/tests/endpoints/test-granules.js Show resolved Hide resolved
@npauzenga
Copy link
Contributor Author

Thanks @Jkovarik! I replied to your comments and updated where appropriate.

Copy link
Member

@Jkovarik Jkovarik left a comment

Choose a reason for hiding this comment

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

Thanks for addressing my feedback 👍🏻

@npauzenga npauzenga merged commit 58b442d into feature/rds-phase-3 Jul 19, 2022
@npauzenga npauzenga deleted the feature/CUMULUS-2688-new-granule-endpoint branch July 19, 2022 21:00
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.

2 participants