Skip to content

Feat: update CLI plan command's create environment message#3397

Merged
treysp merged 10 commits intomainfrom
trey/cli-ux-create-env
Dec 3, 2024
Merged

Feat: update CLI plan command's create environment message#3397
treysp merged 10 commits intomainfrom
trey/cli-ux-create-env

Conversation

@treysp
Copy link
Contributor

@treysp treysp commented Nov 19, 2024

The sqlmesh plan command's output includes a message about creating environments.

The message can be confusing, so this PR updates it to be consistent and clear.

For different plan scenarios, the old and new messages are:

Create prod env

  • Old
    New environment prod will be created from prod
    Summary of differences against prod:
  • New
    prod environment will be initialized

Create dev env without first creating prod

  • Old
    New environment dev will be created from prod
    Summary of differences against dev:
  • New
    dev environment will be initialized

New env with changes

  • Old
    New environment dev will be created from prod
    Summary of differences against dev:
  • New
    New environment dev will be created from prod
    Differences from the prod environment:

Existing env with changes

  • Old
    Summary of differences against dev:
  • New
    Differences from the dev environment:

Plan with no changes (existing environment)

  • Old
    No differences when compared to prod
  • New
    No changes to plan: project files match the prod environment

Plan with no changes (new environment)

  • Old
    Error: No changes were detected. Make a change or run with --include-unmodified to create a new environment without changes.
  • New
    Error: Creating a new environment requires a change, but project files match the prod environment. Make a change or use the --include-unmodified flag to create a new environment without changes.

Plan with --create-from environment that doesn't exist

  • Old
    New environment dev will be created from doesnotexist
    Summary of differences against dev:
  • New
    WARNING - The environment name 'doesnotexist' was passed to the plan command's --create-from argument, but 'doesnotexist' does not exist. Initializing new environment 'dev' from scratch.
    dev environment will be initialized

@treysp treysp force-pushed the trey/cli-ux-create-env branch from cad6cae to cd82e47 Compare November 19, 2024 23:23
@treysp treysp force-pushed the trey/cli-ux-create-env branch 2 times, most recently from f5e829f to 05b1083 Compare November 20, 2024 21:40
@treysp treysp force-pushed the trey/cli-ux-create-env branch from 4fc6a4a to 97e3ed3 Compare November 22, 2024 22:43
@treysp treysp marked this pull request as ready for review November 22, 2024 23:15
@treysp treysp force-pushed the trey/cli-ux-create-env branch from a632ca2 to 54f31d4 Compare November 22, 2024 23:26
Copy link
Contributor

@georgesittas georgesittas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of suggestions and a question. Feel free to ignore the suggestions if there's already alignment on the messaging.

Great work 👍

@treysp treysp force-pushed the trey/cli-ux-create-env branch from e752489 to 40719ec Compare December 3, 2024 17:04
@treysp treysp force-pushed the trey/cli-ux-create-env branch from b4ac75a to 06b471a Compare December 3, 2024 17:14
@treysp treysp force-pushed the trey/cli-ux-create-env branch from 06b471a to 7f484c6 Compare December 3, 2024 17:26
@treysp treysp merged commit cb64bcc into main Dec 3, 2024
@treysp treysp deleted the trey/cli-ux-create-env branch December 3, 2024 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants