-
Notifications
You must be signed in to change notification settings - Fork 213
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
Add a sqitch check command that prints changes in plan for which script has changed #477
Conversation
will be more efficient when sqitchers/sqitch#477 lands
At a glance, it looks pretty complete, thanks! It will likely be a week or so before I can look at it in detail due to a super busy work week.
Sounds like the |
It's the |
will be more efficient when sqitchers/sqitch#477 lands
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 like a great start, thank you! I have most of my feedback in comments on this PR; I don't think it'll take you long to tweak and refactor; if you're new to Perl I can't tell!
One thing more it needs, however, is tests. Once you move the actual checks to the Engine module, I suggest adding them to t/engine.t
, following the examples there for testing the verify
method to test the new check
method. Then add tests for the command module itself to a new test file t/check.t
, and borrow from t/verify.t
to get some nice test coverage.
Is that work you'd be able to do, @matthieu-foucault? This is awesome, and I'm excited to such a great new contribution.
Thank you!
Thanks for the review @theory ! I'll have time to work on it this week, and add the |
Both |
@theory There are still tests running on TavisCI, but I think this is good for a review 🎉 |
It seems that the windows build can't find |
Thanks for that update. Reviewing this PR is on my list, but not sure when I will get to it. Life pretty bananas right now…appreciate your patience. |
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.
Apologies for the delay in review, Matthieu. This looks great! Just a few minor tweaks and I think it's ready to go. Amazing work, really appreciate it!
sub options { | ||
return qw( | ||
onto-change|onto=s | ||
upto-change|upto=s | ||
revised! |
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.
I don't think we want this to be negate-able; the !
means that there is also a --no-revised
option, which doesn't seem necessary. Am I missing something?
return -1; | ||
} | ||
|
||
sub planned_deployed_common_ancestor_id { |
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.
I didn't see a test for this method, or for _find_planned_deployed_divergence_idx
. Are they implicit in the tests for check
?
@@ -63,6 +65,13 @@ L<sqitchchanges> for the various ways in which changes can be specified. | |||
Specify the deployment change. Defaults to the last point in the plan. See | |||
L<sqitchchanges> for the various ways in which changes can be specified. | |||
|
|||
=item C<--revised> | |||
|
|||
Finds the change to revert onto based on the output of L<sqitch-check>. 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.
Not sure this is accurate: based on the output of L<sqitch-check>
. Is there output from sqitch check
when you run this? I thought it was simply that it would rebase on the last change that does not conflict between the plan and the deployed changes. I think you can omit the part about the output of sqitch check from this description.
|
||
=head1 Description | ||
|
||
Runs various checks on the state of the working directory and the database. |
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.
Is it "various checks" at this point? Seems like there's just the one at the moment; perhaps mention that more may be added in the future?
Hey @matthieu-foucault, would you give me permission to push to your branch? Details here. I've rebased it and made a few tweaks. If I can push to your branch, it will keep this PR in-tact, which is nice for history, and I can get it merged post-haste. Thanks! |
Hi @theory , thanks for taking over that PR. |
Bummer. Guess I'll have to close this PR and make a new one. :-( |
Re #475
I'm thinking about adding a
--redeploy
option that would revert to the appropriate change and deploy the plan again, so that the database has deployed changes matching the working directoy.It's my first time writing in Perl, so let me know if I am missing some language idioms, or if there are some lines in there that look horribly wrong.
It's still a draft. I haven't written any test yet, and I am sure I am missing a lot of edge cases.
Happy to receive feedback either way :)