-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 support to localhost urls while debugging #3664
base: main
Are you sure you want to change the base?
Conversation
8905af3
to
260cd12
Compare
@@ -919,6 +919,11 @@ export class Container { | |||
|
|||
@memoize() | |||
private get baseGkDevUri(): Uri { | |||
if (this.prereleaseOrDebugging) { |
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 suggest instead of this.prereleaseOrDebugging
, to allow the value local
for gitkraken.env
and then checking that here.
And if it is local
and this url is not provided, we should throw because we don't want someone targeting prod and thinking they were on a local setup.
Same with the other cases.
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 started with that local
value for env
, but if I do that and you only want to overwrite 1 URL, you still have to manually put the other ones because env
won't tell you anymore if you're on dev, staging or prod. Which is totally okay if we want to do that and make the developer aware they have to manually set all URLs in config. In fact, my first commit does that, and I could retake it if we want to go down this path and throw instead of setting a default URL, as you said.
However, I found it unconvenient that you had to manually set all URLs if you wanted to overwrite just one, so I switched to a useLocal
boolean that would "enable" the use of URLs, but again it seemed like setting an URL should be enough to specify that it should use it. With that, you would overwrite the desired URL, and leave all the rest up to env
to decide where to point at.
Again, I'm totally up for both options so I appreciate the point of view
Description
These changes will allow testing local development on APIs and backend services of gk-dev. With this, you can now set the following settings in
settings.json
(made up urls for the example):NOTE: URLs will only be applied when
gitkraken.env
is set tolocal
. Also, thelocal
environment has the same restrictions asdev
andstaging
(only available if it's pre-release or debugging).Checklist
Fixes $XXX -
orCloses #XXX -
prefix to auto-close the issue that your PR addresses