Skip to content
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

Sqitch Status command on a new plan with a new change does not work as expected. #614

Open
slowmonkey opened this issue Mar 4, 2022 · 3 comments

Comments

@slowmonkey
Copy link

Steps to reproduce:

  1. Create a new plan file. eg. sqitch init with a new folder and sqitch project.
  2. Add a sql change. eg. New file added to the sqitch plan
  3. Type sqitch status

Expected result:

  1. Shows the new file has not been deployed as is to be deployed.
  2. Error code is 0.

Actual result:

  1. Shows "No changes deployed"
  2. 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.

@theory
Copy link
Collaborator

theory commented Mar 12, 2022

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.

@slowmonkey
Copy link
Author

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.

@theory
Copy link
Collaborator

theory commented Mar 18, 2022

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…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants