This repository was archived by the owner on Jan 27, 2023. It is now read-only.
Raise error in RSpec matcher when assessment is outdated#81
Merged
Conversation
b792f6f to
e3aa16b
Compare
* Record all DB fields in YAML report * Mark fields as sensitive or not in report * Fail encrypt_sensitive_fields matcher if report is out of date * Run active_stash:assess task after db:migrate runs * Add quiet arg to active_stash:assess
e3aa16b to
473bb62
Compare
CDThomas
commented
Sep 20, 2022
|
|
||
| Rake::Task["db:migrate"].enhance do | ||
| if ActiveStash::Assess.report_exists? | ||
| Rake::Task["active_stash:assess"].execute({quiet: true}) |
Contributor
Author
There was a problem hiding this comment.
We only want to run active_stash:assess after db:migrate if the assessment file already exists. The intent here is to make life easy for users that have already generated the report, but to not create the file if the user isn't using Assess.
We also suppress output to stdout to avoid extra noise during migrations.
Contributor
There was a problem hiding this comment.
This is a smart way of handling this.
Nice work @CDThomas.
freshtonic
pushed a commit
that referenced
this pull request
Dec 21, 2022
Raise error in RSpec matcher when assessment is outdated
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR updates the
ecrypt_sensitive_fieldsRSpec matcher to raise an error (and fail the test) when the assessment file is outdated.This works by:
Here's an example of the error message for an outdated assessment file:

And here's an example of the new format for the assessment file to support this:
To help prevent outdated assessment files, this change also adds logic for running
active_stash:assessafterdb:migrateruns.