Closed albertteoh closed 4 years ago
Add missing build-ui dependencies to make targets that depend on UI assets, e.g. build-all-in-one should have a dependency on UI assets, but why only build-all-in-one-linux takes the build-ui dependency?
I can answer this one: build-ui
is incredibly expensive to run, takes several minutes, and is actually rarely needed unless it's part of the CI run. If the target itself was sensitive to changes in the jaeger-ui
directory, then it would probably be ok to add it as dependency in many places.
Add
git submodule update --init --recursive
as part of thebuild-ui
target
I am not in favor of this. A target that verifies that jaeger-ui submodule has been initialized would be preferable. Doing a forced update makes it difficult to test small UI changes where the submodule may not be on the committed version.
Maybe there are good reasons to having
git submodule update..
andmake build-ui
as explicit prerequisite steps that I have overlooked?
afaik they were not prerequisites, but just included under "how to build UI" sections.
What is the reason for requiring
make test
as a prerequisite?
I think it generally validates that the local environment is properly set up. After all we're talking about contributing to Jaeger, if someone can't run 'make test' for whatever reason, they are probably not ready to contribute (we do not want to encourage using Travis for testing little fixes). For comparison, jaeger-ui project even has a commit hook that forces you to run yarn test
before committing.
+1 on most suggestions.
This proposal is motivated by a PR comment originally posted by @yurishkuro in https://github.com/jaegertracing/jaeger/pull/2548#discussion_r502507111.
Requirement - what kind of business use case are you trying to solve?
make build-ui
does under the hood, which contains valuable information for contributors.build-ui
when UI assets are required.build-ui
dependency to the most specific targets.build-ui
dependencies to make targets that depend on UI assets, e.g.build-all-in-one
should have a dependency on UI assets, but why onlybuild-all-in-one-linux
takes thebuild-ui
dependency?Problem - what in Jaeger blocks you from solving the requirement?
contributing.md currently requires these prerequisite steps:
git submodule update --init --recursive
andmake build-ui
are specific to UI builds. Instead of making these prerequisites, could we make these an explicit dependency within ourMakefile
and only run them when performing UI-related builds?This has the added benefit of automating these steps where required and, IMHO, is more correct. Consider the following scenarios:
Proposal - what do you suggest to solve the problem or improve the existing situation?
Reinstate what
make build-ui
does under the hood (which was removed in #2548) within the Makefile as part of thebuild-ui
target, similar to theproto
make target.Add
build-ui
dependency to the "lowest common denominator" make targets, namelybuild-query
,build-all-in-one
andrun-all-in-one
.yarn install
andyarn build
steps take well over a minute to complete even after prior calls, which is particularly undesirable for something likemake run-all-in-one
.build-ui
idempotent by checking for existence of the asset files (cmd/query/app/ui/*/gen_assets.go
). If there's a need to force UI asset rebuilds, either delete asset files via theclean
target (this sounds nicer?) or introduce abuild-ui-force
option target.As above, move
build-ui
dependency frombuild-all-in-one-linux
to the more generalbuild-all-in-one
target to fix other OS builds.Add
git submodule update --init --recursive
as part of thebuild-ui
target given their fates are tied to one another (unless if I'm mistaken). This call is idempotent and so is relatively quick to complete after making the initial call. Added benefit of ensuring the correct commit is used in each build/run if it was modified in the upstream master.Remove redundant
build-ui
fromdocker
target given it is introduced as a dependency inbuild-query
(build-binaries-linux
->build-platform-binaries
->build-query
->build-ui
).Simplify the contributing.md Prerequisites section down to:
Any open questions to address
git submodule update...
andmake build-ui
as explicit prerequisite steps that I have overlooked?make test
as a prerequisite?