-
Notifications
You must be signed in to change notification settings - Fork 107
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-3757: FOR MASTER - Update granule upsert logic to allow updating collection info #3901
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey Naga - a couple of questions/inconsistencies, but this should be quickly approve-able once they're sorted.
Please note, I verified tests/content matched #3891, and am relying on approved units for functionality in this review. If you'd like a deploy/full test, please let me know.
packages/api-client/src/granules.ts
Outdated
@@ -602,6 +613,74 @@ export const associateExecutionWithGranule = async (params: { | |||
}); | |||
}; | |||
|
|||
/** | |||
* Bulk update granules' collectionId to a payload-specified collectionId in postgres |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This docstring is different than #3891, is that intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unintentional, I just copied wrong probably, will change to what is in 3757
@@ -58,7 +58,7 @@ const { getBucketsConfigKey } = require('@cumulus/common/stack'); | |||
const { getDistributionBucketMapKey } = require('@cumulus/distribution-utils'); | |||
const { constructCollectionId } = require('@cumulus/message/Collections'); | |||
|
|||
const { create, patch, patchGranule } = require('../../endpoints/granules'); | |||
const { create, patch, patchGranuleAndReturnStatus } = require('../../endpoints/granules'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for followup: why is 'del' gone in main?
packages/db/src/lib/granule.ts
Outdated
@@ -354,3 +356,26 @@ export const getGranulesByGranuleId = async ( | |||
.where({ granule_id: granuleId }); | |||
return records; | |||
}; | |||
|
|||
/** | |||
* Get granules from table where granule_id matches provided granuleId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This docstring doesn't match the 18.5.3 docstring, is that intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unintentional copying, fixed
packages/db/src/lib/granule.ts
Outdated
* Get granules from table where granule_id matches provided granuleId | ||
* | ||
* @param {Knex} knex - DB client or transaction | ||
* @param {string} granuleId - Granule ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This param is incorrect, and doesn't match 18.5.3
Nit: Also..... we shouldn't type the docstrings in .ts for already annotated params, for both PRs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed 👍 due to copying probably ^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @Nnaga1 🎉 Thanks for addressing the docstring concerns.
Approving assuming deploy/manual testing has been done/units from prior work are satisfied in CI.
Summary: Summary of changes
Addresses CUMULUS-XX: Develop amazing new feature
Changes
PR Checklist