Skip to content

Conversation

@mark-vieira
Copy link
Contributor

When using runbld with --last-good-commit the commit id reported by Jenkins via build environment variables is not guaranteed to be correct, and in most cases, it isn't. This is because runbld performs a second checkout during the build execution of the "last good commit".

This pull request changes the commit id reported in build scans to the real commit, and not what Jenkins is incorrectly reporting.

@mark-vieira mark-vieira added >non-issue :Delivery/Build Build or test infrastructure labels Feb 18, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Build)

link 'Source', "https://github.com/elastic/elasticsearch/tree/${BuildParams.gitRevision}"
if (System.getenv('GIT_PREVIOUS_COMMIT')) {
background {
def changes = "git diff --name-only ${System.getenv('GIT_PREVIOUS_COMMIT')}..${System.getenv('GIT_COMMIT')}".execute().text.trim()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the use of GIT_COMMIT here also be replaced with BuildParams.gitRevision?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't change this because GIT_PREVIOUS_COMMIT is subject to the same "problem". I think if anything we might just want to remove this entirely if it's not guaranteed to be accurate.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So yeah, since we can't rely on GIT_COMMIT or GIT_PREVIOUS_COMMIT from Jenkins being actually correct I've just ditched this entirely.

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Delivery/Build Build or test infrastructure >non-issue Team:Delivery Meta label for Delivery team v7.6.1 v7.7.0 v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants