Skip to content

Conversation

hyunnaye
Copy link
Contributor

Description
This PR changes the bucket key format to YYYY-MM-DD/HH/deliveryid instead of YYYY-MM-DD/deliveryid such that we can resubmit events by the hour

Issue
https://ucsc-cgl.atlassian.net/browse/SEAB-6452

Security
If there are any concerns that require extra attention from the security team, highlight them here.

Please make sure that you've checked the following before submitting your pull request. Thanks!

  • Ensure that the PR targets the correct branch. Check the milestone or fix version of the ticket.

@hyunnaye hyunnaye self-assigned this Jun 26, 2024
Copy link
Contributor

@svonworl svonworl left a comment

Choose a reason for hiding this comment

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

This works fine, but gonna put this other thing out there:
Including parts of the date (previously the year/month/day, and here, the hour) in the keys helps us to retrieve the events that correspond to our target time range, without downloading lots of other irrelevant stuff. However, if we engineer the "resubmitter" processing correctly, we need not resubmit the entire set of downloaded events: we can examine the created_at date of each downloaded event, and only submit the subset that corresponds to the exact time range for which we want to resubmit.

const uploadDate = date.getDate().toString().padStart(2, "0"); // ex. get 05 instead of 5 for the 5th date
const bucketPath = `${uploadYear}-${uploadMonth}-${uploadDate}/${deliveryId}`;
const uploadHour = date.getHours().toString().padStart(2, "0"); // ex. get 05 instead of 5 for the 5th hour
const bucketPath = `${uploadYear}-${uploadMonth}-${uploadDate}/${uploadHour}/${deliveryId}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

Apologies, I should have noted this in the previous PR, but why not separate each date component by a slash? That way they'd be more browseable.

Also, would recommend changing Date to Day, more specific.

@hyunnaye hyunnaye merged commit a9df2b9 into develop Jun 26, 2024
@denis-yuen denis-yuen deleted the feature/SEAB-6452 branch June 26, 2024 21:22
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.

5 participants