Skip to content
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 overriding base path for UI/API routes; rm --query.prefix #748

Merged
merged 7 commits into from Mar 23, 2018

Conversation

Projects
None yet
5 participants
@yurishkuro
Copy link
Member

commented Mar 20, 2018

Resolves #745 Provide a means to define a path-prefix for the UI
Resolves #746 Remove --query.prefix option

@yurishkuro yurishkuro requested a review from black-adder Mar 20, 2018

@yurishkuro yurishkuro requested review from pavolloffay and vprithvi as code owners Mar 20, 2018

@wafflebot wafflebot bot added the review label Mar 20, 2018

@yurishkuro yurishkuro changed the title Allow overriding base path for UI/API routes Allow overriding base path for UI/API routes; rm --query.prefix Mar 20, 2018

@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<base href="/" data-inject-target="BASE_URL"/>

This comment has been minimized.

Copy link
@yurishkuro

yurishkuro Mar 20, 2018

Author Member

@tiffon this models the compiled index.html from UI assets.

Q: is it possible that babel/webpack would reorder the href and data-inject-target attributes? Because if it does, the search&replace in the query service won't work

This comment has been minimized.

Copy link
@tiffon

tiffon Mar 20, 2018

Member

@yurishkuro It should not change the order of the attributes.

@coveralls

This comment has been minimized.

Copy link

commented Mar 20, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling 7a019df on fix-745-support-base-path into 37e6430 on master.

@jpkrohling
Copy link
Member

left a comment

LGTM, but would be awesome to have the user notified when the HTML on disk is not what is being served to clients. Also, it would perhaps be worth adding some piece of documentation about this (when to use/why/how)

options.BasePath = "/"
}
if options.BasePath != "/" {
if !strings.HasPrefix(options.BasePath, "/") || strings.HasSuffix(options.BasePath, "/") {

This comment has been minimized.

Copy link
@jpkrohling

jpkrohling Mar 20, 2018

Member

Is it possible to add a log statement notifying that what people see in the HTML is not what will be served to clients?

This comment has been minimized.

Copy link
@yurishkuro

yurishkuro Mar 20, 2018

Author Member

could you elaborate why you think this would be useful? We're modifying the internal file of the app, not something that users provide.

This comment has been minimized.

Copy link
@jpkrohling

jpkrohling Mar 20, 2018

Member

Mainly because it's deviating from what is "expected": if I had a problem with the static resources (like the original problem this PR is solving) and were to check the HTML, I would wonder why it's not the same as what my browser is seeing. A log entry at debug level would suffice, IMO.

This comment has been minimized.

Copy link
@yurishkuro

yurishkuro Mar 20, 2018

Author Member

well, still not convinced why someone needs to know what happens internally, e.g. we also override the config, and in both cases we only do that when requested via cli arguments.

Let's do it separately, because the constructor doesn't take a logger and the unit tests explicitly verify that nothing is logged, so it's not as trivial a change as it sounds for a feature that seems rather marginal.

@yurishkuro

This comment has been minimized.

Copy link
Member Author

commented Mar 20, 2018

Docs would be updated in a separate PR in the docs repo.

yurishkuro added some commits Mar 19, 2018

Allow overriding base path for UI/API routes
Signed-off-by: Yuri Shkuro <ys@uber.com>
Allow overriding base path for UI/API routes
Signed-off-by: Yuri Shkuro <ys@uber.com>
Add tests
Signed-off-by: Yuri Shkuro <ys@uber.com>
Remove unnecessary test
Signed-off-by: Yuri Shkuro <ys@uber.com>
clean-up tests
Signed-off-by: Yuri Shkuro <ys@uber.com>
Fix error msg
Signed-off-by: Yuri Shkuro <ys@uber.com>
Bump ui
Signed-off-by: Yuri Shkuro <ys@uber.com>

@yurishkuro yurishkuro force-pushed the fix-745-support-base-path branch from 90f4635 to 7a019df Mar 23, 2018

@yurishkuro yurishkuro merged commit 83d06da into master Mar 23, 2018

4 of 5 checks passed

License Compliance 3 issues found.
Details
DCO All commits have a DCO sign-off from the author
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 100.0%
Details

@wafflebot wafflebot bot removed the review label Mar 23, 2018

@yurishkuro yurishkuro deleted the fix-745-support-base-path branch Mar 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.