Skip to content

ui: unbreak make watch#25871

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
vilterp:fix-wds
May 23, 2018
Merged

ui: unbreak make watch#25871
craig[bot] merged 1 commit intocockroachdb:masterfrom
vilterp:fix-wds

Conversation

@vilterp
Copy link
Copy Markdown
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
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

vilterp commented May 23, 2018

bors r+

@nvb
Copy link
Copy Markdown
Contributor

nvb commented May 23, 2018

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

@craig
Copy link
Copy Markdown
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
Copy Markdown
Contributor

craig bot commented May 23, 2018

Canceled

@vilterp
Copy link
Copy Markdown
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
Copy Markdown
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 <alexdwanerobinson@gmail.com>
Co-authored-by: Pete Vilter <vilterp@cockroachlabs.com>
Co-authored-by: Andrew Couch <andrew@cockroachlabs.com>
@craig
Copy link
Copy Markdown
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