File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
dd-java-agent/agent-ci-visibility/src
main/java/datadog/trace/civisibility/ci Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,9 @@ class GitLabInfo implements CIProviderInfo {
4141 public static final String GITLAB_CI_RUNNER_TAGS = "CI_RUNNER_TAGS" ;
4242 public static final String GITLAB_PULL_REQUEST_BASE_BRANCH =
4343 "CI_MERGE_REQUEST_TARGET_BRANCH_NAME" ;
44+ public static final String GITLAB_PULL_REQUEST_BASE_SHA = "CI_MERGE_REQUEST_DIFF_BASE_SHA" ;
45+ public static final String GITLAB_PULL_REQUEST_BASE_HEAD_SHA =
46+ "CI_MERGE_REQUEST_TARGET_BRANCH_SHA" ;
4447 public static final String GITLAB_PULL_REQUEST_COMMIT_HEAD_SHA =
4548 "CI_MERGE_REQUEST_SOURCE_BRANCH_SHA" ;
4649 public static final String GITLAB_PULL_REQUEST_NUMBER = "CI_MERGE_REQUEST_IID" ;
@@ -88,8 +91,8 @@ public CIInfo buildCIInfo() {
8891 public PullRequestInfo buildPullRequestInfo () {
8992 return new PullRequestInfo (
9093 normalizeBranch (environment .get (GITLAB_PULL_REQUEST_BASE_BRANCH )),
91- null ,
92- null ,
94+ environment . get ( GITLAB_PULL_REQUEST_BASE_SHA ) ,
95+ environment . get ( GITLAB_PULL_REQUEST_BASE_HEAD_SHA ) ,
9396 new CommitInfo (environment .get (GITLAB_PULL_REQUEST_COMMIT_HEAD_SHA )),
9497 environment .get (GITLAB_PULL_REQUEST_NUMBER ));
9598 }
Original file line number Diff line number Diff line change 10801080 "CI_JOB_NAME" : " gitlab-job-name" ,
10811081 "CI_JOB_STAGE" : " gitlab-stage-name" ,
10821082 "CI_JOB_URL" : " https://gitlab.com/job" ,
1083+ "CI_MERGE_REQUEST_DIFF_BASE_SHA" : " bf6c156e8c1ec9cf43239162bca38cad22a3f4d2" ,
10831084 "CI_MERGE_REQUEST_IID" : 42 ,
10841085 "CI_MERGE_REQUEST_TARGET_BRANCH_NAME" : " target-branch" ,
1086+ "CI_MERGE_REQUEST_TARGET_BRANCH_SHA" : " eb6dda23983998409db832ad675ec18ec32a8205" ,
10851087 "CI_PIPELINE_ID" : " gitlab-pipeline-id" ,
10861088 "CI_PIPELINE_IID" : " gitlab-pipeline-number" ,
10871089 "CI_PIPELINE_URL" : " https://foo/repo/-/pipelines/1234" ,
11101112 "git.commit.message" : " gitlab-git-commit-message" ,
11111113 "git.commit.sha" : " b9f0fb3fdbb94c9d24b2c75b49663122a529e123" ,
11121114 "git.pull_request.base_branch" : " target-branch" ,
1115+ "git.pull_request.base_branch_head_sha" : " eb6dda23983998409db832ad675ec18ec32a8205" ,
1116+ "git.pull_request.base_branch_sha" : " bf6c156e8c1ec9cf43239162bca38cad22a3f4d2" ,
11131117 "git.repository_url" : " https://gitlab.com/repo/myrepo.git" ,
11141118 "pr.number" : " 42"
11151119 }
You can’t perform that action at this time.
0 commit comments