Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions gradle/build-scan.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import org.elasticsearch.gradle.OS
import org.elasticsearch.gradle.info.BuildParams
import org.gradle.initialization.BuildRequestMetaData

import java.util.concurrent.TimeUnit
Expand Down Expand Up @@ -76,9 +77,9 @@ buildScan {
value 'Git Branch', branch
tag branch
}
if (System.getenv('GIT_COMMIT')) {
value 'Git Commit ID', System.getenv('GIT_COMMIT')
link 'Source', "https://github.com/elastic/elasticsearch/tree/${System.getenv('GIT_COMMIT')}"
value 'Git Commit ID', BuildParams.gitRevision
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.

value 'Git Changes', changes
Expand Down