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-3757: FOR MASTER - Update granule upsert logic to allow updating collection info #3901

Merged
merged 9 commits into from
Jan 14, 2025

Conversation

Nnaga1
Copy link
Contributor

@Nnaga1 Nnaga1 commented Jan 10, 2025

Summary: Summary of changes

Addresses CUMULUS-XX: Develop amazing new feature

Changes

  • Detailed list or prose of changes
  • ...

PR Checklist

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

@Nnaga1 Nnaga1 changed the title CUMULUS-3757: Update granule upsert logic to allow updating collection info CUMULUS-3757: FOR MASTER - Update granule upsert logic to allow updating collection info Jan 10, 2025
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.

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.

@@ -602,6 +613,74 @@ export const associateExecutionWithGranule = async (params: {
});
};

/**
* Bulk update granules' collectionId to a payload-specified collectionId in postgres
Copy link
Member

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?

Copy link
Contributor Author

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');
Copy link
Member

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?

@@ -354,3 +356,26 @@ export const getGranulesByGranuleId = async (
.where({ granule_id: granuleId });
return records;
};

/**
* Get granules from table where granule_id matches provided granuleId
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

unintentional copying, fixed

* Get granules from table where granule_id matches provided granuleId
*
* @param {Knex} knex - DB client or transaction
* @param {string} granuleId - Granule ID
Copy link
Member

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.

Copy link
Contributor Author

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 ^

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 @Nnaga1 🎉 Thanks for addressing the docstring concerns.

Approving assuming deploy/manual testing has been done/units from prior work are satisfied in CI.

@Nnaga1 Nnaga1 merged commit 3244680 into master Jan 14, 2025
3 checks passed
@Nnaga1 Nnaga1 deleted the CUMULUS-3757-forward-port branch January 14, 2025 16:01
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