ci: set git user configuration if it is not set#17782
ci: set git user configuration if it is not set#17782kuisathaverat merged 2 commits intoelastic:masterfrom
Conversation
2e8ee2b to
f836269
Compare
|
This appears to be a bug in the generator test. The generator test creates a new git repo. It does run these commands, but too late. beats/generator/common/Makefile Lines 15 to 16 in a846029 These values need to be set after the repo is beats/generator/common/beatgen/beatgen.go Lines 130 to 141 in bbf9d66 |
andrewkroh
left a comment
There was a problem hiding this comment.
I'm good with the workaround. Can you please add something like this so we know to come back and remove it when the Beat Generator is fixed.
// TODO (2020-04-07): This is a work-around to fix the Beat generator tests.
// See https://github.com/elastic/beats/issues/17787.
| sh(label: "Install Go ${GO_VERSION}", script: ".ci/scripts/install-go.sh") | ||
| sh(label: "Install docker-compose ${DOCKER_COMPOSE_VERSION}", script: ".ci/scripts/install-docker-compose.sh") | ||
| sh(label: "Install Mage", script: "make mage") | ||
| setGitConfig() |
There was a problem hiding this comment.
NIT: do we want to add those details to the shared library? We did add a similar one for the apm, see the step setupAPMGitEmail
There was a problem hiding this comment.
yep, I saw it, the intention is to make the workaround and extend setupAPGitEmail to make a new one more for Beats
Jenkinsfile
Outdated
| def setGitConfig(){ | ||
| sh(label: 'check git config', script: ''' | ||
| if [ -z "$(git config --get user.email)" ]; then | ||
| git config user.email "58790750+beatsmachine@users.noreply.github.com" |
There was a problem hiding this comment.
The apm*** user got the same prefix, is 58790750+ correct? I don't know if it's a manual configuration done in GitHub or a coincidence that the email is the same one
There was a problem hiding this comment.
I've made a C&P, the email is not important, it is a no-reply email :)
* ci: set git user configuration if it is not set * Apply suggestions from code review
Backport some features added to Jenkinsfile to 7.x branch: * Dry run option. * Docker login. * Git config for generator tests. * Filter changes using go list. These are the cherry-picked changes: * fix: login into the docker registry (#17620) * feat: filter changes using go list output (#17397) * fix: disable workaround on macos (#17750) * ci: set git user configuration if it is not set (#17782) * fix: mount Docker credentials (#17798) * Review dependency patterns collection in Jenkins (#18004) Co-authored-by: Ivan Fernandez Calvo <kuisathaverat@users.noreply.github.com> Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com> Co-authored-by: Andrew Kroh <andrew.kroh@elastic.co>
What does this PR do?
It checks for git configuration and setup it if there is no configuration.
Why is it important?
It seems needed for some command in the build system.