bitflicker64 commented on code in PR #3194:
URL: https://github.com/apache/hugegraph/pull/3194#discussion_r4001043655
##########
docker/bake.hcl:
##########
@@ -19,6 +19,14 @@ variable "MAVEN_ARGS" {
default = ""
}
+variable "MAVEN_PROJECTS" {
+ default =
"hugegraph-server/hugegraph-dist,hugegraph-pd/hg-pd-dist,hugegraph-store/hg-store-dist"
Review Comment:
🧹 This default is now a fifth copy of the module list, and nothing checks it
against the other four. A drift here would go unnoticed.
- `docker-bake-check` diffs the `AS build` stage of the four Dockerfiles, so
a change to `ARG MAVEN_PROJECTS=...` there has to land in all four. It never
compares that ARG with this variable, and its jq assertion on `bake --print`
checks targets, platforms and outputs but not `args`.
- The `docker-build` job runs plain `docker build --build-arg
SOURCE_REVISION=...`, so CI builds with the Dockerfile default.
- `bake` always passes this value, so the images from `bake.hcl` use this
copy.
If someone later adds a module to the Dockerfile list (a new dist, say) and
misses this line, every CI check still passes, but bake builds a different
reactor from the one CI tested. With a module like that, `rm
./hugegraph-*/*.tar.gz` or a runtime `COPY --from=build` could then fail only
in the bake flow.
Requested change: keep one source of truth. Either set `default = null`
here, which makes bake leave the arg unset so the Dockerfile `ARG` default
applies while `MAVEN_PROJECTS=... docker buildx bake` still overrides it, or
add a jq assertion to `docker-bake-check` that `.target.pd.args.MAVEN_PROJECTS`
matches the `ARG MAVEN_PROJECTS` default in `hugegraph-pd/Dockerfile`.
`RUNTIME_DEPS_EPOCH` on line 27 duplicates its default the same way. A drift
there would only cause one extra cache miss, but the same change covers it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]