Skip to content

Commit

Permalink
Fix range of changes printed in deploy debug output
Browse files Browse the repository at this point in the history
The debug output of deploy (added with commit 06daffc) starts with
the currently deployed change or the last planned change if nothing
is deployed yet.  Fix this by starting with the first change after
the current plan position.
  • Loading branch information
ewie authored and theory committed Sep 9, 2023
1 parent 257c8eb commit 5724e0a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Revision history for Perl extension App::Sqitch
- Fixed the output of the list of changes to be deployed or reverted to
actually require `--verbose` twice, as described in the v1.4.0 changes,
and not just once. Thanks to Erik Wienhold for the PR (#785)!
- Removed the duplicate change name from the output of the list of
changes to be deployed or reverted with `-VV`. Thanks to Erik Wienhold
for the PR (#787)!

1.4.0 2023-08-01T23:37:30Z
- Fixed Snowflake warehouse and role setup to properly quote identifiers
Expand Down
2 changes: 1 addition & 1 deletion lib/App/Sqitch/Engine.pm
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ sub deploy {
);

$sqitch->debug(__ "Will deploy the following changes:");
foreach my $will_deploy_position ($plan->position .. $to_index) {
foreach my $will_deploy_position (($plan->position + 1) .. $to_index) {
$sqitch->debug($plan->change_at($will_deploy_position)->format_name_with_tags);
}

Expand Down
12 changes: 11 additions & 1 deletion t/engine.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use strict;
use warnings;
use 5.010;
use utf8;
use Test::More tests => 780;
use Test::More tests => 781;
# use Test::More 'no_plan';
use App::Sqitch;
use App::Sqitch::Plan;
Expand Down Expand Up @@ -1169,6 +1169,7 @@ is_deeply +MockOutput->get_info, [
], 'Should have emitted deploy announcement and successes';

# Make sure we can deploy everything by change.
MockOutput->clear;
$latest_change_id = undef;
$plan->reset;
$plan->add( name => 'lolz', note => 'ha ha' );
Expand Down Expand Up @@ -1208,6 +1209,15 @@ is_deeply +MockOutput->get_info_literal, [
[' + lolz ..', '.........', ' '],
], 'Should have seen the output of the deploy to the end';

is_deeply +MockOutput->get_debug, [
[__ 'Will deploy the following changes:' ],
['roles'],
['users @alpha'],
['widgets @beta'],
['lolz'],
], 'Debug output should show what will be deployed';


# If we deploy again, it should be up-to-date.
$latest_change_id = $changes[-1]->id;
ok $engine->deploy, 'Should return success for deploy to up-to-date DB';
Expand Down

0 comments on commit 5724e0a

Please sign in to comment.