changelog: Internal, Analytics, Fix weekly protocols report#11406
Merged
changelog: Internal, Analytics, Fix weekly protocols report#11406
Conversation
mitchellhenke
approved these changes
Oct 28, 2024
| def perform(date = Time.zone.yesterday.end_of_day) | ||
| return unless IdentityConfig.store.s3_reports_enabled | ||
|
|
||
| self.report_date = report_date |
Contributor
There was a problem hiding this comment.
I'd remove the initializer just in case and use the attr_accessor for specs
Contributor
Author
There was a problem hiding this comment.
the ReportMailerPreview needs the date added via initializer, since it bypasses the perform method :(
Contributor
There was a problem hiding this comment.
I think we could do
report = Reports::ProtocolsReport.new.tap { |r| r.report_date = date }
Contributor
|
The previous PR is here: #11369 |
zachmargolis
approved these changes
Oct 28, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 Summary of changes
Last week's update of the ProtocolsReport led to an Argument Error when the cron job attempted to run.
I'm not totally sure how the GoodJob cron jobs work, but I believe it's because I added an
initializermethod for the Mailer Preview feature, and that the report_date argument was being passed into that rather than theperformmethod. There may be a different way to solve this, but I wasn't sure how to test it.