-
Notifications
You must be signed in to change notification settings - Fork 9
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
Organize and cleanup azure blob outputs for Automated Tests #1578
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/AzureBlobOrganizer.java
Outdated
Show resolved
Hide resolved
rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/AzureBlobOrganizer.java
Outdated
Show resolved
Hide resolved
PR Code Suggestions ✨Explore these optional code suggestions:
|
…lobs, imrpoved time zone handling, added logging, more accurately check if blob was moved
/review |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/AzureBlobFileFetcher.java
Show resolved
Hide resolved
rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/AzureBlobOrganizer.java
Outdated
Show resolved
Hide resolved
rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/AzureBlobOrganizer.java
Outdated
Show resolved
Hide resolved
rs-e2e/src/main/java/gov/hhs/cdc/trustedintermediary/rse2e/AzureBlobHelper.java
Show resolved
Hide resolved
*/ | ||
public class AzureBlobFileFetcher implements FileFetcher { | ||
|
||
private static final FileFetcher INSTANCE = new AzureBlobFileFetcher(); | ||
// We're using UTC for now, but we plan to change the timezone to be more realistic to the |
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.
I think we should keep all times in UTC. The working timezones can change and be unknown to future engineers
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.
The actual problem is that the current scheduled time (12am UTC, which is 4pm PT) is still within working ours for people living in the west coast. We have a fair amount of certainty most people working in TI and RS will be within PT and ET timezones given these are US government contracts. The idea is to make sure the tasks run after anything is pushed to the repositories. I think you are right about the timezone though, we can keep UTC. What we need to change is the 12am scheduled time
|
||
public static String buildDatePathPrefix(LocalDate date) { | ||
return String.format( | ||
"%d/%02d/%02d/", date.getYear(), date.getMonthValue(), date.getDayOfMonth()); |
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.
Should we put a comment here to explain this formatting?
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.
Sure, I can do that
.buildClient(); | ||
|
||
AzureBlobOrganizer blobOrganizer = new AzureBlobOrganizer(blobContainerClient); | ||
blobOrganizer.organizeAndCleanupBlobsByDate(RETENTION_DAYS, TIME_ZONE); |
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.
Since it looks like we're now always running cleanup, it might be worth adding a note to the README saying that if folks run this test too close to/right before midnight UTC, they might get some unexpected date issues, and should probably just re-run it a few minutes later if that happens
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.
Hmmm that's a good point. That reminds me why we want to change from UTC to another timezone. I have another story where I'll change the timezone to avoid this kind of issues. That also reminds me I should I add something in the readme about the retention time for the files
Quality Gate passedIssues Measures |
We're currently uploading all the output files for the Automated RS Integration Tests in the root of the Azure container. This PR reorganizes the files to follow a /year/month/day folder structure. Here are the details:
Issue
#1523
#1526