Rake task registers database path for rake-cleaning#412
Rake task registers database path for rake-cleaning#412jasonkarns wants to merge 1 commit intorubysec:masterfrom
Conversation
Rake ships with clean and clobber tasks out of the box. Now the audit Task can be (optionally) registered for cleaning. It defaults to off so no change from current behavior. If opted-in, the audit-database path is added to rake's CLOBBER collection. Clean is meant to remove temporary and generated files that are the result of "normal" application runs. Clobber is intended to be a more exhaustive clean that returns the application's state to a "fresh cloned" state. With these conventions, the ruby advisory db fits more cleanly (ha) into the "clobber" category.
e1d772d to
fe0b51c
Compare
|
|
|
Right. Temp files would be cleaned by But the database is a generated file. It's expected that after Per rake: Clobber is run very rarely, so the advisory db would still persist effectively all the time. But when a "full reset" is needed, that's what clobber is for. |
Then the keyword argument should be named
The |
Perhaps. Though both The immediate use case I had, was building out our Regardless, as part of updating to latest bundler-audit and moving to bundler-audit's built-in tasks, I needed to consistently iterate by simulating a fresh CI environment. My first inclination in all cases of running rake tasks, is to expect Other folks on the team have been using the clobber task to revert to pristine state in order to do performance auditing. (clobber, then run tasks with profiling to gather performance data). I don't know of any other use cases off hand. That's just what we've been using recently. I should pre-empt the obvious point: doing a simple A few examples of other files we have in our
|
Rake ships with clean and clobber tasks out of the box. Now the audit Task can be (optionally) registered for cleaning.
It defaults to off so no change from current behavior. If opted-in, the audit-database path is added to rake's CLOBBER collection.
Clean is meant to remove temporary and generated files that are the result of "normal" application runs.
Clobber is intended to be a more exhaustive clean that returns the application's state to a "fresh cloned" state.
With these conventions, the ruby advisory db fits more cleanly (ha) into the "clobber" category.
prior art: Bundler's gem tasks itself:
https://github.com/ruby/rubygems/blob/master/bundler/lib/bundler/gem_tasks.rb#L3-L4
Bundler's tasks register the pkg path for clobbering unconditionally, but I think that makes sense given the limited scope of the pkg path. Since the ruby advisory db is written to a path outside of one's project, I believe the task should be more conservative in its deletion. Hence making it opt-in.
This PR does not yet have tests. If this enhancement is a viable candidate, I can add tests and documentation.