[LG-1488] Move account reset notice into job_configurations.#3062
Merged
[LG-1488] Move account reset notice into job_configurations.#3062
Conversation
5a25553 to
8e799a9
Compare
As part of LG-1113, move the account reset email notification job out of the recurring job controllers and into the built-in app job configurations. **Why**: We are moving away from triggering recurring jobs via lambdas to instead run long-running background jobs using the idp-jobs/job_configurations.rb framework, which allows each idp server to pull jobs and run them as needed, without any external moving parts. This makes adding a new recurring job entirely self-contained within the identity-idp repo, so no interaction with AWS or lambdas or terraform or any other repos is needed. **How**: - Remove lib/lambdas/account_reset_lambda.rb. - Add a new job configuration for the account reset email job to `config/initializers/job_configurations.rb`, running every 5 minutes. - Change the deprecated account reset controller to return HTTP 410, to indicate that the endpoint should not be used. - Add tests of all the job_configurations.rb and fix tests for the changes.
**Why**: We currently output logs to a file. We have no idea when these
events happen unless we add a timestamp.
**How**: Create a custom log formatter class that overrides the default
activesupport formatter. Check if the input appears to be JSON based on
leading/trailing `{}`, and output without any timestamp if so. That
preserves log parsing compatibility with the existing analytics ETL
pipelines.
Contributor
Author
achapm
approved these changes
Jul 2, 2019
Contributor
achapm
left a comment
There was a problem hiding this comment.
assuming that we are OK to launch this without analytics, 👍 LGTM
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.

As part of LG-1488 / LG-1113, move the account reset email notification job out of
the recurring job controllers and into the built-in app job
configurations.
Also add timestamps to the default development.log/production.log
output. Previously this log had no timestamps, which made it extremely
difficult to follow time-sensitive logs.
Why: We are moving away from triggering recurring jobs via lambdas
to instead run long-running background jobs using the
idp-jobs/job_configurations.rb framework, which allows each idp server
to pull jobs and run them as needed, without any external moving parts.
This makes adding a new recurring job entirely self-contained within the
identity-idp repo, so no interaction with AWS or lambdas or terraform or
any other repos is needed.
How:
config/initializers/job_configurations.rb, running every 5 minutes.indicate that the endpoint should not be used.
changes.