Skip to content

Option to require verify scripts during deployment #799

@ewie

Description

@ewie

It would be great if sqitch deploy had an option to require a verify script for each deploy script. Right now, missing verify scripts are only logged without failing the deployment when running sqitch deploy --verify, for example:

  + foo .. Verify script verify/foo.sql does not exist
ok
  + bar .. ok

I recently had this situation when a team mate accidentally moved some of the verify scripts. The test runner did not fail but luckily I spotted the moved files during code review. A failing test run would've been better in catching this right away.

Of course I can add a step to the test runner to manually check the files. Something like:

for vf in $(find deploy -name '*.sql' | sed 's/deploy/verify/'); do
  if [ ! -f "$vf" ]; then
    echo "not found: $vf"
    exit 1
  fi
done

But I think it's useful if Sqitch can support this out of the box. Also because this script above makes assumptions about the directory layout which is quite flexible in Sqitch.

I'm thinking about a new option --require-verify:

sqitch deploy --verify --require-verify

Maybe even imply --verify when deploying with --require-verify so that it behaves as a stronger variant of --verify. I think the option name fits nicely with the existing --no-verify to allow different verification levels, i.e. --no-verify < --verify < --require-verify.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions