How to resolve a broken deploy --verify #697
Replies: 3 comments 11 replies
-
Good question. This is part of the distinction that Sqitch draws between development and release. I myself has made this sort of mistake with revert scripts many times in the past --- but never in a released (tagged) version of a project, only when doing development and I'm constantly deploying and reverting (or rebasing) to find exactly issues like this. more than once I've dropped a database and started over from scratch when the state got screwed up. That said, it should not have logged |
Beta Was this translation helpful? Give feedback.
-
Okay, taking myself back 10 years to when we added verification, I think the thinking was that verification failure was considered the same as deploy failure, so we never logged the deploy sqitch/lib/App/Sqitch/Engine.pm Lines 972 to 974 in ef7767d The
In the meantime, manually applying the revert script on verify failure is the workaround. |
Beta Was this translation helpful? Give feedback.
-
Actually I lied: It already works that way. Here's an example where both the verify and revert scripts fail for change baz:
Note that after it reports the verify script failing on line 6, it then also reports that the revert failed on line 7. In short, if verify fails, it rolls back logging the deploy then runs the revert, ignoring it its failure. IOW, I think this already works how you'd like. Trouble is, if your revert doesn't do what you want, you will need to modify it and run it manually. |
Beta Was this translation helpful? Give feedback.
-
I ran into the following case when using
sqitch
. I had a validdeploy
(so it completed successfully), but I ransqitch deploy --verify foo
andfoo
's verification raised an exception, sosqitch
tried to apply the relevantrevert
. But, therevert
was written poorly (bad order of operations) so it failed to execute. I fixed therevert
order of operations and tried to runsqitch revert foo
but was informed that$ sqitch revert foo Change not deployed: "foo"
I ended up resolving this by running
psql postgresql://postgres@localhost/gypsy -f sqitch/revert/foo.sql
but I didn't like that solution.How should I handle this inside of
sqitch
?Beta Was this translation helpful? Give feedback.
All reactions