Skip to content
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

Support regular expressions in allowlist #660

Merged
merged 4 commits into from
Oct 9, 2020

Conversation

bpo
Copy link
Contributor

@bpo bpo commented Jun 30, 2020

It's common for database connection parameters to be specified as part of the URL (e.g. DATABASE_URL=postgres://foo.bar?pool=16). I'd like to be able to manipulate those connection parameters in my test rig without needing to alter the allowlist.

This patch supports this by letting allowlists optionally be specified as regular expressions.

@codecov
Copy link

codecov bot commented Jun 30, 2020

Codecov Report

Merging #660 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #660   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           19        19           
  Lines          651       666   +15     
=========================================
+ Hits           651       666   +15     
Impacted Files Coverage Δ
lib/database_cleaner/safeguard.rb 100.00% <100.00%> (ø)
spec/database_cleaner/safeguard_spec.rb 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 661fe7e...e4a1fe7. Read the comment docs.

@bpo bpo marked this pull request as ready for review June 30, 2020 19:16
@botandrose
Copy link
Contributor

@bpo Thanks for the PR! I really like this change, and with the switch to ===, I believe that one could even put a proc (or some other callable) in the list, as well, which is pretty cool.

One last thing before I sign off on it: would you please add a changelog entry?

@etagwerker This looks good to me. What do you think?

@bpo
Copy link
Contributor Author

bpo commented Jul 1, 2020

👍 added changelog, and another example using a proc to make sure that functionality sticks around.

Copy link
Member

@etagwerker etagwerker left a comment

Choose a reason for hiding this comment

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

@bpo @botandrose This looks good to me too. Thank you! ❤️

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.

None yet

3 participants