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

ui: unbreak make watch #25871

Merged
merged 1 commit into from
May 23, 2018
Merged

ui: unbreak make watch #25871

merged 1 commit into from
May 23, 2018

Conversation

vilterp
Copy link
Contributor

@vilterp vilterp commented May 23, 2018

By telling Webpack to proxy the path / through to the Cockroach process.
Webpack used to serve / itself from a static file, but as of #25195 we
generate / dynamically in Go, so we can use it to pass login state to
the UI.

Fixes #25858

Release note: None

@vilterp vilterp requested a review from a team May 23, 2018 19:42
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@couchand couchand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, seems to fix the problem. Thanks!

proxy: {
// Note: this shouldn't require a custom bypass function to work;
// docs say that setting `index: ''` is sufficient to proxy `/`.
// However, that did not work, and may require upgrading ty webpack 4.x.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/ty/to/

secure: false,
target: process.env.TARGET,
bypass: (req) => {
if (req.path === "/") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it worth putting "/" in proxyPrefixes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be a special case because if it were treated as a prefix, it'd match everything. Will move logic to shouldProxy though.

@vilterp
Copy link
Contributor Author

vilterp commented May 23, 2018

bors r+

@nvanbenschoten
Copy link
Member

Looks like this is hitting a lint error that failed the bors CI.

@craig
Copy link
Contributor

craig bot commented May 23, 2018

Build failed (retrying...)

By telling Webpack to proxy the path `/` through to the Cockroach process.
Webpack used to serve `/` itself from a static file, but as of cockroachdb#25195 we
generate `/` dynamically in Go, so we can use it to pass login state to
the UI.

Fixes cockroachdb#25858

Release note: None
@craig
Copy link
Contributor

craig bot commented May 23, 2018

Canceled

@vilterp
Copy link
Contributor Author

vilterp commented May 23, 2018

Whoops! Fixed. Looks like bors split out the other PRs and tried to merge them individually, which is cool.

bors r+

@craig
Copy link
Contributor

craig bot commented May 23, 2018

Build failed (retrying...)

craig bot pushed a commit that referenced this pull request May 23, 2018
25868: sql: Log event for TRUNCATE TABLE r=a-robinson a=a-robinson

Fixes #25867

Release note (sql change): TRUNCATE TABLE commands are now logged in the
event log.

25871: ui: unbreak `make watch` r=vilterp a=vilterp

By telling Webpack to proxy the path `/` through to the Cockroach process.
Webpack used to serve `/` itself from a static file, but as of #25195 we
generate `/` dynamically in Go, so we can use it to pass login state to
the UI.

Fixes #25858

Release note: None

25875: ui: fix action names broken by #25823 r=couchand a=couchand

In that PR, I mechanically replaced identifiers when there were new
warnings about shadowing, but in two places I accidentally changed
semantics due to the shorthand form of object literals.  🤦‍♂️

Release note: None

Co-authored-by: Alex Robinson <[email protected]>
Co-authored-by: Pete Vilter <[email protected]>
Co-authored-by: Andrew Couch <[email protected]>
@craig
Copy link
Contributor

craig bot commented May 23, 2018

Build succeeded

@craig craig bot merged commit 16c1df7 into cockroachdb:master May 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants