-
Notifications
You must be signed in to change notification settings - Fork 1
Added TODO #2 #1
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
base: main
Are you sure you want to change the base?
Conversation
…deleting by default and --preview to delete previews
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements explicit deployment type targeting for environment variable commands by adding a --prod flag alongside the existing --preview flag. The goal is to require users to explicitly specify whether they're operating on production or preview deployments, particularly for the env rm command to prevent accidental deletions.
Key changes:
- Added
--prodflag to explicitly target production deployments - Added validation to prevent using both
--prodand--previewsimultaneously - Required explicit flag specification for
env rmcommand
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| cmd/root.go | Declares the new prodFlag boolean variable |
| cmd/env.go | Adds --prod flag registration and validation logic across env subcommands (add, rm, pull, push) |
| TODO | Marks the TODO item as DONE |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if prodFlag && previewFlag { | ||
| ui.Error("Cannot use both --prod and --preview") | ||
| return fmt.Errorf("conflicting flags") | ||
| } |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The runEnvPull function doesn't check if neither --prod nor --preview is specified, unlike runEnvRm. This creates inconsistent behavior - runEnvPull will default to production when no flag is specified, while runEnvRm requires an explicit flag. For consistency and to prevent accidental production operations, runEnvPull should also require an explicit flag specification.
| } | |
| } | |
| if !prodFlag && !previewFlag { | |
| ui.Error("Please specify either --prod or --preview") | |
| return fmt.Errorf("no environment specified") | |
| } |
| if prodFlag && previewFlag { | ||
| ui.Error("Cannot use both --prod and --preview") | ||
| return fmt.Errorf("conflicting flags") | ||
| } |
Copilot
AI
Dec 18, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The runEnvPush function doesn't check if neither --prod nor --preview is specified, unlike runEnvRm. This creates inconsistent behavior - runEnvPush will default to production when no flag is specified, while runEnvRm requires an explicit flag. For consistency and to prevent accidental production operations, runEnvPush should also require an explicit flag specification.
| } | |
| } | |
| if !prodFlag && !previewFlag { | |
| ui.Error("You must specify either --prod or --preview") | |
| return fmt.Errorf("missing required environment flag") | |
| } |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Env vars should now use --prod to delete prod instead of deleting by default and --preview to delete previews