-
Notifications
You must be signed in to change notification settings - Fork 291
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
Add command to list environments #889
Conversation
2d69ebd
to
e780a68
Compare
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.
Looks good!
} | ||
|
||
const rows = hydrogenStorefront.environments | ||
.filter(({type}) => type !== 'PREVIEW') |
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.
Why do we need to filter out preview types? 🤔
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.
This is a great question! I'm filtering it because it looks a little odd in the table because it doesn't have a branch or URL:
Name Branch URL
────────── ────────────────── ────────────────────────────────────────
Production main https://example.com
Staging staging https://staging-123.myshopify.dev
Preview
So it looks like it's dangling off the side. Maybe if I added something instead of empty strings?
Name Branch URL
────────── ────────────────── ────────────────────────────────────────
Production main https://example.com
Staging staging https://staging-123.myshopify.dev
Preview - -
Actually that kind of looks good!
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.
Ah I see. But what would be the "branch" that we need to specify in this case in --branch
? I guess we just omit it?
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.
Exactly, Preview
is the default. Right now environment names aren't unique so if you had multiple Staging
branches there'd be no way to differentiate between them. Branches are unique on environments which is why we're using that field and making Preview default.
e780a68
to
195d2f3
Compare
195d2f3
to
970d721
Compare
Force Push Patch Notes
|
970d721
to
77f4cbd
Compare
Force Push Patch Notes
|
77f4cbd
to
66eb74e
Compare
Force Push Patch Notes
|
WHY are these changes introduced?
We're introducing the ability for developers to specify an environment to use variables from (#883) but they'd need to open the admin to see which branches are assigned to which environments in order to do so.
WHAT is this pull request doing?
Introduces a new
env list
command that will list all of the environments on the linked Hydrogen storefront that have abranch
.HOW to test your changes?
cli
directorynpm run build
cd ../../templates/demo-store
h2 env list
(note: ifh2
is unavailable runnpx shopify hydrogen shortcut
first) to see a list of your environmentsChecklist