sqitch
sqitch copied to clipboard
Sqitch Status command on a new plan with a new change does not work as expected.
Steps to reproduce:
- Create a new plan file. eg. sqitch init with a new folder and sqitch project.
- Add a sql change. eg. New file added to the sqitch plan
- Type
sqitch status
Expected result:
- Shows the new file has not been deployed as is to be deployed.
- Error code is 0.
Actual result:
- Shows "No changes deployed"
- Error code is 1.
sqitch check
command returns Checks Successful with an error code 0 for the above scenario.
The Problem This is problematic as I'm trying to create a deploy workflow that shows what is about to happen before a manual deploy approval is required. The error code 1 and "No changes deployed". Because of the error code the build/deploy step fails.
NOTE: If at least one change file has been deployed to the database the above scenario does not occur. Everything works fine.
It shows that error because the registry does not know about this project, so there is no status at all to show. This can be helpful for the case where you checked the status of the wrong database, for example. But I could see the argument either way; perhaps it would be helpful to add an option to --status
so it returns 0
and a full status instead of the error if the database has no changes for the plan.
I'm happy with either approach.
Only thing is it still doesn't say that it's going to deploy x, y, z on a brand new plan. Was hoping to show what is about to happen to the team before we click the go ahead for deployment in our CI/CD pipeline.
The option would assume you mean to deploy and so would show the list of changes to be deployed as normal.
OTOH, it might make sense to do that with no option, and add a --strict
option or some such to fail if there are no deployments at all. Needs some thinking through…