-
Notifications
You must be signed in to change notification settings - Fork 292
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
Allow specifying an environment to use variable from #883
Conversation
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.
Thanks! Maybe we should wrap the envPull call and improve error messages, since we know the response format:
For example, in the previous situation we could render a human readable "environment not found" error message and mention what they can try to fix the issue (use the "env list" command?).
Also, is "Preview" in the following correct? I think this is our Production branch.
ecb0335
to
845007e
Compare
Force Push Patch Notes
|
I remember looking into this in my original exploration of these commands because we were thinking about returning custom error codes. Unfortunately (or fortunately depending on your perspective!) |
It looks like we can actually pass However, feel free to merge this without that change, it's something we can improve later 👍 |
Force Push Patch Notes
|
Blocked
Currently based off of the work done here:
WHY are these changes introduced?
A follow up to both #861 and #809 that allows developers to specify which environment to use.
When these commands were first added/updated we defaulted to always pulling the
Preview
environment variables but there are cases where developers may want to use a different environment for testing purposes.WHAT is this pull request doing?
We recently shipped the ability to specify a
branchName
argument in the Admin API for theenvironmentVariables
field. This PR hooks into that field and adds a new flag tocommonFlags
to facilitate it.HOW to test your changes?
cli
directorynpm run build
cd ../../templates/demo-store
h2 env pull --branch <BRANCH>
(note: ifh2
is unavailable runnpx shopify hydrogen shortcut
first) to pull your specified environment variables down<BRANCH>
with the branch associated to an environment on your linked shop (e.g.main
for most Production environments)Checklist