-
Notifications
You must be signed in to change notification settings - Fork 269
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
handle restore of multiple asset manifests on rollback #226
handle restore of multiple asset manifests on rollback #226
Conversation
Thanks for the PR! This project lacks automated tests, which makes reviewing and approving PRs somewhat difficult. Please make sure that your contribution has not broken backwards compatibility or introduced any risky changes. Here's an example of a CHANGELOG.md entry (place it immediately under the * [#226](https://github.com/capistrano/rails/pull/226): handle restore of multiple asset manifests on rollback - [@lennart](https://github.com/lennart) Generated by 🚫 Danger |
since this is neither a user-facing change nor can I see how to "test" this (apart from using this, and it seems to work). is it possible to merge this pr? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for the PR and sorry for the lack of a timely response.
The reason this is a hard PR for me to review is that even though I am a maintainer, I do not use the "rollback" feature of Capistrano. That makes it hard for me to intuitively judge if this change is needed and whether it works as intended.
That said, your explanation of why -f
fails makes sense, and your code is easy to follow. Thanks for that!
Before I merge, could you post output of a cap rollback that demonstrates this code working? I don't have a means of testing it at the moment.
@mattbrictson I resolved the issues you had in code and made a demo-run of deploy and rollback handling multiple-manifest files without breakage, see: https://gist.github.com/lennart/d2eab716d5b589da869a7c6f86ec6cc2 |
um, when I take a look at this now, I realize there's a bug. targets and sources are mixed up... I'll fix this |
ok, so now, starting at: https://gist.github.com/lennart/d2eab716d5b589da869a7c6f86ec6cc2#file-capistrano-deploy-and-rollback-log-L511 it lists the files in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. Thanks for your patience and for following up!
I have one more small change to request before merging this. Let me know what you think.
Co-authored-by: Matt Brictson <mattbrictson@users.noreply.github.com>
@mattbrictson sounds good, I accepted your suggestion! |
Handle multiple manifest files gracefully.
Related to #123 this PR will fix issues with multiple sprockets asset manifest files lying around in
#{shared_path}/public/assets/
and#{release_path}/assets_manifest_backup
oncap <stage> deploy:rollback
.Currently this will fail due to multiple filepaths being interpolated into a single shell
if
condition:see https://github.com/capistrano/rails/blob/master/lib/capistrano/tasks/assets.rake#L93 and #204 (comment)
To deal with this
restore_manifest
will explicitly copy each of these files in a separatecp
command.Feedback on how to improve this PR is very welcome!