feat: Add additional parameters to groups in composition files#1338
feat: Add additional parameters to groups in composition files#1338laurentsenta merged 14 commits intomasterfrom
Conversation
85f705b to
6694035
Compare
2017ec4 to
2d4e5bb
Compare
2d4e5bb to
f1d694f
Compare
pkg/build/docker_go.go
Outdated
| RUN cp /tmp/go.mod /tmp/go.sum ${PLAN_DIR}/ | ||
|
|
||
| # Copy again the modfiles in case there where overwritten. | ||
| COPY /plan/${MODFILE} ${PLAN_DIR}/go.mod |
There was a problem hiding this comment.
Are lines 629 - 632 necessary? Since lines 635-636 will overwrite the go.mod and go.sum, I don't see the point in copying the files to /tmp/, and then back again.
There was a problem hiding this comment.
FYI, GitHub supports multiline comments so in cases like this it's best to comment on all the lines that you mention or link to the ones that are outside the preview - ie. https://docs.google.com/document/d/1mVXsDw74rjFPTu-SAbTOWd0F-5VoIZbHStxJNwWC3ns/edit# in this case.
Good question though - I'm a bit confused about it too. I'll let @laurentsenta answer the original question.
There was a problem hiding this comment.
Nice catch, it's fixed, thanks for the note!
It looks like this now:
https://github.com/testground/testground/pull/1338/files#diff-9b5fa505e6278f70a7479cc5cc065c37fd0c374023b8b89b124d948ffc1025e7R630-R632
We do keep a backup of the modfile, instead of overwriting it.
Because earlier in the Dockerfile, when we go mod download, the command might have updated the go.mod file with the effective module versions.
There was a problem hiding this comment.
I see, the /tmp backup makes sense then!
This one might needs some explanation: the go tool assumes that every sub-directory is part of the project, except the folders that contain a `go.mod` file or have a name that starts with `_` (or `.` or `testdata`). In the case of the integrations tests, we DON'T want to use a `go.mod` because the point of the test is to verify that GOMOD rewrites are working. This is why the "best" solution here is to prefix integration with a `_`.
f1d694f to
7a9a81b
Compare
Fixes #1337
This PR allows build_config override in groups (in composition files). See the example below which has a group with a custom docker build image.
It also introduces a
modfileoption for the docker:go builder that lets you override the go.mod (and go.sum) used to build the application, similar to the-modfileoption in go build tools.Todo