-
Notifications
You must be signed in to change notification settings - Fork 4.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
ci: set git user configuration if it is not set #17782
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -673,6 +673,7 @@ def withBeatsEnv(boolean archive, Closure body) { | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, I saw it, the intention is to make the workaround and extend setupAPGitEmail to make a new one more for Beats
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/LGTM
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.