-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: remove generated files from version control #18349
Conversation
0ac1e44
to
89f7db2
Compare
This approach SGTM but don't forget to update CONTRIBUTING.md (and anywhere else we list build requirements). |
46074be
to
8f11f58
Compare
@bdarnell good point, done. |
2a6bff6
to
d917772
Compare
We should get someone who develops on linux to ensure this works. @knz or perhaps @m-schneider. Can one of you see if this works? Reviewed 1 of 6 files at r2, 14 of 18 files at r4, 5 of 6 files at r5, 1 of 1 files at r6. CONTRIBUTING.md, line 26 at r6 (raw file):
Might as well bump yarn to 1.0 + pkg/ui/Makefile, line 38 at r6 (raw file):
For all of these run commands, I'm getting a yarn warning that the Can we check at the start of make that pkg/ui/tslint.json, line 119 at r6 (raw file):
Does our JS pass with these rules? Do these rules matter, since all of our JS is generated? pkg/ui/webpack.vendor.js, line 5 at r6 (raw file):
nit: extra blank line Comments from Reviewable |
Review status: 14 of 20 files reviewed at latest revision, 4 unresolved discussions, some commit checks failed. CONTRIBUTING.md, line 26 at r6 (raw file): Previously, BramGruneir (Bram Gruneir) wrote…
Hmm, ok. Done. pkg/ui/Makefile, line 38 at r6 (raw file): Previously, BramGruneir (Bram Gruneir) wrote…
We definitely don't want to check at the beginning of Make, as it'll slow down no-op compiles by .5s. Let me see if I can come up with something else. pkg/ui/tslint.json, line 119 at r6 (raw file): Previously, BramGruneir (Bram Gruneir) wrote…
Heh, not all of our JS is generated. Specifically, not our JS config files. P.S. this commit is in a standalone PR that's ready to merge after review: #18262 pkg/ui/webpack.vendor.js, line 5 at r6 (raw file): Previously, BramGruneir (Bram Gruneir) wrote…
Intentional separation of first-party and third-party imports, though I guess I'm not sure we actually settled on that as our style moving forward. Comments from Reviewable |
pkg/ui/Makefile, line 38 at r6 (raw file): Previously, benesch (Nikhil Benesch) wrote…
why would checking a version take so bloody long? That's nuts. Comments from Reviewable |
pkg/ui/webpack.vendor.js, line 5 at r6 (raw file): Previously, benesch (Nikhil Benesch) wrote…
Ah, I didn't notice. carry on! Comments from Reviewable |
Review status: 14 of 20 files reviewed at latest revision, 3 unresolved discussions, some commit checks failed. pkg/ui/Makefile, line 38 at r6 (raw file): Previously, BramGruneir (Bram Gruneir) wrote…
Yarn 1.0 is 3 days old. It's reasonable to require non-JS developers to have node installed, but if this is going to require frequent environment updates then we're going to have to rethink this change. Don't increase minimum versions of tools that we don't vendor just to encourage people to keep up to date; only do it when there is a specific reason. (We don't mandate specific versions of gcc/clang, for example, just something that supports c++11) Comments from Reviewable |
Reviewed 1 of 18 files at r4, 6 of 6 files at r7, 6 of 6 files at r8, 1 of 1 files at r9. pkg/ui/Makefile, line 38 at r6 (raw file): Previously, bdarnell (Ben Darnell) wrote…
I had no idea it was so new. And I agree entirely, but I think moving to a 1.0 release over a 0.2 makes sense. To be fair, the only reason I even noticed this was because of the warnings about the change in the run command semantics. Comments from Reviewable |
d917772
to
340cba7
Compare
Review status: 0 of 19 files reviewed at latest revision, 4 unresolved discussions. CONTRIBUTING.md, line 26 at r6 (raw file): Previously, benesch (Nikhil Benesch) wrote…
Actually, this will require rebuilding the builder image, which I'm really not looking forward to doing. If you don't mind, I'll leave this as allowing 0.22 for the moment, and save the bump to 1.0 later. pkg/ui/Makefile, line 38 at r6 (raw file): Previously, BramGruneir (Bram Gruneir) wrote…
Yeah, Comments from Reviewable |
Also, I should mention, I added a commit in here to enforce Yarn/Node versions. The restrictions are loose right now (just what CONTRIBUTING.md dictates), but this gives us a path forward when we need to mandate a version upgrade. Review status: 0 of 19 files reviewed at latest revision, 4 unresolved discussions, some commit checks pending. Comments from Reviewable |
Reviewed 1 of 18 files at r4, 19 of 20 files at r10. CONTRIBUTING.md, line 26 at r6 (raw file): Previously, benesch (Nikhil Benesch) wrote…
Gotcha. Ok, leave it as is. pkg/ui/Makefile, line 38 at r6 (raw file): Previously, benesch (Nikhil Benesch) wrote…
SGTM. Perhaps open an issue for this and the yarn bump? Comments from Reviewable |
I'm getting the following error over here:
|
Once someone with linux tests this, I'll feel a bit better. Reviewed 3 of 18 files at r13, 1 of 6 files at r14, 1 of 1 files at r15. Comments from Reviewable |
It's awesome to see this, @benesch! I'd also point out that developers who rely on the builder image won't need node and yarn installed. |
The error above is due to a missing |
Reviewed 1 of 18 files at r4, 1 of 18 files at r13, 1 of 18 files at r19, 1 of 20 files at r26, 15 of 20 files at r33, 4 of 6 files at r34, 1 of 1 files at r35, 2 of 2 files at r36. Comments from Reviewable |
This is LGTM |
7140e84
to
e49ca16
Compare
e49ca16
to
a10e3e0
Compare
Checking in src/js/protos.js and embedded.go causes several major problems: * Every change to the UI, even if the diff is only one line, entirely rewrites embedded.go, which is upwards of 12MB in size. This adds a lot of weight to the Git repository. * Every commit that touches the UI or protobuf definitions must be serialized, as diffs in protos.js and embedded.go cannot be automatically merged. * Including embedded.go in a pull request breaks GitHub's "request review" feature. Removing these files from version control solves all these problems with only two downsides: * Every developer will need Node and Yarn installed. This seems reasonable to expect of our engineers and external contributors, but not end users. This commit teaches our source archives to include a pre-generated embedded.go so that end users who simply want to build from source without Node and Yarn can do so. * Developers will likely need to rebuild the UI a few times per day as they switch between branches that span UI changes. This commit brings the UI compilation time down to about 5s when only first-party sources have been updated and 30s when UI dependencies are bumped (infrequently), so this also seems reasonable.
For speed, the proxy server no longer notices changes that affect the vendor bundle. This can lead to hard-to-debug errors if the vendor bundle is out-of-date when the proxy server is launched. Solve these errors by requiring the proxy server to be launched via a phony Make target, `make watch`, which can guarantee the vendor target is built before launching the proxy server.
a10e3e0
to
02570d5
Compare
Review status: 6 of 20 files reviewed at latest revision, 7 unresolved discussions, some commit checks failed. Comments from Reviewable |
When NodeJS and Docker are used together, NodeJS manages to infect the container's stdout and stderr streams with non-blocking I/O mode. All future processes launched in the same shell inherit non-blocking mode, but few can handle it. Notably, `go test` drops output on the floor when stdout is non-blocking, and `go-test-teamcity` interprets this as a panic. Work around this by piping all NodeJS commands started by Make through `cat`. Incidentally closes cockroachdb#18378 by removing usage of `yarn run`.
02570d5
to
eb79d4b
Compare
🎉 thanks for the reviews, everyone! Landing this while it's green. |
PR cockroachdb#18349 made it possible to auto-generate these, but forgot to remove them from version control. 🤦
The `go get` ship sailed long ago, when we moved to using our non-Go dependencies' native build systems. PR cockroachdb#18349 pushed us even further in that direction by automatically rebuilding the admin UI as necessary. We might as well remove the generated protobuf code too; the Make rules to generate them on-demand are already in place.
Remove compiled JS protobufs, which were removed in cockroachdb#18349 and accidentally readded in cockroachdb#18930. Also fix some merge skew in server/serverpb/status.pb.go.
Ignore the first commit; that's #18262.
From the last commit message:
Closes #18349.
Closes #18735.