Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: identify scratch orgs if hub is known during auth #148
feat: identify scratch orgs if hub is known during auth #148
Changes from all commits
0caaa78
2a15217
94c5c34
0e0c20e
cde6c44
4023911
39c852f
9cc16ce
87f9489
0f5df91
4e9a1ab
86279b6
e8a224b
b70c417
9eca74d
c502206
754d860
86380bd
bfb68df
74f93f4
0b01070
377b2c3
5e32c89
706eca8
c914648
123444c
bd85a41
f80129d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
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.
@mshanemc feels like this could get expensive; API limits, time, etc.
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.
it scales with the number of devhubs you have. So for most users, fairly mild. We'd ask one hub about one ScratchOrgInfo.
If you did have a lot of hubs, we're still only one query per hub (re: limits) and executing in parallel (re: time)
What's a better alternative when the requirement is "at auth time, identify the hub for an org that may be a scratch org?"
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.
@mshanemc no good answer really, maybe this will get better as we move towards sf, with a combined auth file.
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 an expensive operation. Any alternatives?
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.
I couldn't come up with any other way to figure out what auths are hubs.
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 approach limits the # of orgs that get queried in the above
Promise.all
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 fastest alternative would be to read the auth files directly (not go through core) but that opens up its own set of problems.
We could also add a method in core to deliver the raw auth file contents as json instead of AuthInfos. It's still potentially a lot of fs, but we could parallelize the read/parse better than core does today
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.
one more idea (kinda hacky) is to filter out obvious scratch-org-type names (foo@example.com, that thing where a timestamp is added to the main user to create secondary users, etc).