diff --git a/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/ci/CISpecExtractor.groovy b/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/ci/CISpecExtractor.groovy index fb81c9e0c44..6bddaf73f78 100644 --- a/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/ci/CISpecExtractor.groovy +++ b/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/ci/CISpecExtractor.groovy @@ -29,14 +29,15 @@ class CISpecExtractor { static extract(String ciProviderName) { if ("unknown" == ciProviderName) { - return Arrays.asList(new CISpec(Collections.EMPTY_MAP, Collections.EMPTY_MAP)) + return Arrays.asList(new CISpec(ciProviderName, 0, Collections.EMPTY_MAP, Collections.EMPTY_MAP)) } - List>> spec = JSON_SLURPER.parse(CISpecExtractor.getClassLoader().getResourceAsStream(String.format("ci/%s.json", ciProviderName))) + List>> specs = JSON_SLURPER.parse(CISpecExtractor.getClassLoader().getResourceAsStream(String.format("ci/%s.json", ciProviderName))) def ciSpecs = new ArrayList() - spec.each { - ciSpecs.add(new CISpec(it.get(0), it.get(1))) + for (i in 0.. env private final Map tags - CISpec(env, tags) { + CISpec(providerName, idx, env, tags) { + this.providerName = providerName + this.idx = idx + if (env['DD_TEST_CASE_NAME']) { + this.testCaseName = ' - ' + env['DD_TEST_CASE_NAME'] + } else { + this.testCaseName = '' + } this.env = env this.tags = tags } + String getProviderName() { + return providerName + } + + int getIdx() { + return idx + } + + String getTestCaseName() { + return testCaseName + } + Collection getTagMismatches(Map ciTags) { Collection mismatches = new ArrayList<>() diff --git a/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/ci/CITagsProviderTest.groovy b/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/ci/CITagsProviderTest.groovy index e51a2224f3a..5c0307c005b 100644 --- a/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/ci/CITagsProviderTest.groovy +++ b/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/ci/CITagsProviderTest.groovy @@ -37,7 +37,7 @@ abstract class CITagsProviderTest extends Specification { environmentVariables.clear(System.getenv().keySet() as String[]) } - def "test ci provider info is set properly"() { + def "test ci provider info is set properly: #ciSpec.providerName #ciSpec.idx #ciSpec.testCaseName"() { setup: ciSpec.env.each { environmentVariables.set(it.key, it.value) diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/azurepipelines.json b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/azurepipelines.json index 594da6d147b..d072c2731c6 100644 --- a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/azurepipelines.json +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/azurepipelines.json @@ -650,6 +650,64 @@ "git.tag": "0.0.2" } ], + [ + { + "BUILD_BUILDID": "azure-pipelines-build-id", + "BUILD_DEFINITIONNAME": "azure-pipelines-name", + "BUILD_REPOSITORY_URI": "https://dev.azure.com/fabrikamfiber/repo", + "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", + "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", + "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", + "DD_TEST_CASE_NAME": "http-repository-url-no-git-suffix", + "SYSTEM_JOBID": "azure-pipelines-job-id", + "SYSTEM_TASKINSTANCEID": "azure-pipelines-task-id", + "SYSTEM_TEAMFOUNDATIONSERVERURI": "https://azure-pipelines-server-uri.com/", + "SYSTEM_TEAMPROJECTID": "azure-pipelines-project-id", + "TF_BUILD": "True" + }, + { + "_dd.ci.env_vars": "{\"SYSTEM_TEAMPROJECTID\":\"azure-pipelines-project-id\",\"BUILD_BUILDID\":\"azure-pipelines-build-id\",\"SYSTEM_JOBID\":\"azure-pipelines-job-id\"}", + "ci.job.url": "https://azure-pipelines-server-uri.com/azure-pipelines-project-id/_build/results?buildId=azure-pipelines-build-id&view=logs&j=azure-pipelines-job-id&t=azure-pipelines-task-id", + "ci.pipeline.id": "azure-pipelines-build-id", + "ci.pipeline.name": "azure-pipelines-name", + "ci.pipeline.number": "azure-pipelines-build-id", + "ci.pipeline.url": "https://azure-pipelines-server-uri.com/azure-pipelines-project-id/_build/results?buildId=azure-pipelines-build-id", + "ci.provider.name": "azurepipelines", + "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", + "git.commit.author.name": "azure-pipelines-commit-author", + "git.commit.message": "azure-pipelines-commit-message", + "git.repository_url": "https://dev.azure.com/fabrikamfiber/repo" + } + ], + [ + { + "BUILD_BUILDID": "azure-pipelines-build-id", + "BUILD_DEFINITIONNAME": "azure-pipelines-name", + "BUILD_REPOSITORY_URI": "ssh://host.xz:54321/path/to/repo/", + "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", + "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", + "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", + "DD_TEST_CASE_NAME": "ssh-repository-url-no-git-suffix", + "SYSTEM_JOBID": "azure-pipelines-job-id", + "SYSTEM_TASKINSTANCEID": "azure-pipelines-task-id", + "SYSTEM_TEAMFOUNDATIONSERVERURI": "https://azure-pipelines-server-uri.com/", + "SYSTEM_TEAMPROJECTID": "azure-pipelines-project-id", + "TF_BUILD": "True" + }, + { + "_dd.ci.env_vars": "{\"SYSTEM_TEAMPROJECTID\":\"azure-pipelines-project-id\",\"BUILD_BUILDID\":\"azure-pipelines-build-id\",\"SYSTEM_JOBID\":\"azure-pipelines-job-id\"}", + "ci.job.url": "https://azure-pipelines-server-uri.com/azure-pipelines-project-id/_build/results?buildId=azure-pipelines-build-id&view=logs&j=azure-pipelines-job-id&t=azure-pipelines-task-id", + "ci.pipeline.id": "azure-pipelines-build-id", + "ci.pipeline.name": "azure-pipelines-name", + "ci.pipeline.number": "azure-pipelines-build-id", + "ci.pipeline.url": "https://azure-pipelines-server-uri.com/azure-pipelines-project-id/_build/results?buildId=azure-pipelines-build-id", + "ci.provider.name": "azurepipelines", + "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", + "git.commit.author.name": "azure-pipelines-commit-author", + "git.commit.message": "azure-pipelines-commit-message", + "git.repository_url": "ssh://host.xz:54321/path/to/repo/" + } + ], [ { "BUILD_BUILDID": "azure-pipelines-build-id", @@ -794,7 +852,7 @@ { "BUILD_BUILDID": "azure-pipelines-build-id", "BUILD_DEFINITIONNAME": "azure-pipelines-name", - "BUILD_REPOSITORY_URI": "ssh://user@host.xz:port/path/to/repo.git/", + "BUILD_REPOSITORY_URI": "ssh://user@host.xz:54321/path/to/repo.git/", "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", @@ -815,14 +873,14 @@ "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", "git.commit.author.name": "azure-pipelines-commit-author", "git.commit.message": "azure-pipelines-commit-message", - "git.repository_url": "ssh://host.xz:port/path/to/repo.git/" + "git.repository_url": "ssh://host.xz:54321/path/to/repo.git/" } ], [ { "BUILD_BUILDID": "azure-pipelines-build-id", "BUILD_DEFINITIONNAME": "azure-pipelines-name", - "BUILD_REPOSITORY_URI": "ssh://user:password@host.xz:port/path/to/repo.git/", + "BUILD_REPOSITORY_URI": "ssh://user:password@host.xz:54321/path/to/repo.git/", "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", @@ -843,14 +901,14 @@ "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", "git.commit.author.name": "azure-pipelines-commit-author", "git.commit.message": "azure-pipelines-commit-message", - "git.repository_url": "ssh://host.xz:port/path/to/repo.git/" + "git.repository_url": "ssh://host.xz:54321/path/to/repo.git/" } ], [ { "BUILD_BUILDID": "azure-pipelines-build-id", "BUILD_DEFINITIONNAME": "azure-pipelines-name", - "BUILD_REPOSITORY_URI": "ssh://user:password@1.1.1.1:port/path/to/repo.git/", + "BUILD_REPOSITORY_URI": "ssh://user:password@1.1.1.1:54321/path/to/repo.git/", "BUILD_REQUESTEDFOREMAIL": "azure-pipelines-commit-author-email@datadoghq.com", "BUILD_REQUESTEDFORID": "azure-pipelines-commit-author", "BUILD_SOURCEVERSIONMESSAGE": "azure-pipelines-commit-message", @@ -871,7 +929,7 @@ "git.commit.author.email": "azure-pipelines-commit-author-email@datadoghq.com", "git.commit.author.name": "azure-pipelines-commit-author", "git.commit.message": "azure-pipelines-commit-message", - "git.repository_url": "ssh://1.1.1.1:port/path/to/repo.git/" + "git.repository_url": "ssh://1.1.1.1:54321/path/to/repo.git/" } ] ] diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/bitbucket.json b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/bitbucket.json index 72d47cdff00..bbd8cd37ea6 100644 --- a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/bitbucket.json +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/bitbucket.json @@ -400,6 +400,46 @@ "git.tag": "0.0.2" } ], + [ + { + "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", + "BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "BITBUCKET_GIT_HTTP_ORIGIN": "https://bitbucket.org/DataDog/dogweb", + "BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}", + "BITBUCKET_REPO_FULL_NAME": "bitbucket-repo", + "DD_TEST_CASE_NAME": "http-repository-url-no-git-suffix" + }, + { + "ci.job.url": "https://bitbucket.org/bitbucket-repo/addon/pipelines/home#!/results/bitbucket-build-num", + "ci.pipeline.id": "bitbucket-uuid", + "ci.pipeline.name": "bitbucket-repo", + "ci.pipeline.number": "bitbucket-build-num", + "ci.pipeline.url": "https://bitbucket.org/bitbucket-repo/addon/pipelines/home#!/results/bitbucket-build-num", + "ci.provider.name": "bitbucket", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://bitbucket.org/DataDog/dogweb" + } + ], + [ + { + "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", + "BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "BITBUCKET_GIT_HTTP_ORIGIN": "ssh://host.xz:54321/path/to/repo/", + "BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}", + "BITBUCKET_REPO_FULL_NAME": "bitbucket-repo", + "DD_TEST_CASE_NAME": "ssh-repository-url-no-git-suffix" + }, + { + "ci.job.url": "https://bitbucket.org/bitbucket-repo/addon/pipelines/home#!/results/bitbucket-build-num", + "ci.pipeline.id": "bitbucket-uuid", + "ci.pipeline.name": "bitbucket-repo", + "ci.pipeline.number": "bitbucket-build-num", + "ci.pipeline.url": "https://bitbucket.org/bitbucket-repo/addon/pipelines/home#!/results/bitbucket-build-num", + "ci.provider.name": "bitbucket", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "ssh://host.xz:54321/path/to/repo/" + } + ], [ { "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", @@ -518,7 +558,7 @@ { "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", "BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "BITBUCKET_GIT_HTTP_ORIGIN": "ssh://user@host.xz:port/path/to/repo.git/", + "BITBUCKET_GIT_HTTP_ORIGIN": "ssh://user@host.xz:54321/path/to/repo.git/", "BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}", "BITBUCKET_REPO_FULL_NAME": "bitbucket-repo" }, @@ -530,14 +570,14 @@ "ci.pipeline.url": "https://bitbucket.org/bitbucket-repo/addon/pipelines/home#!/results/bitbucket-build-num", "ci.provider.name": "bitbucket", "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "git.repository_url": "ssh://host.xz:port/path/to/repo.git/" + "git.repository_url": "ssh://host.xz:54321/path/to/repo.git/" } ], [ { "BITBUCKET_BUILD_NUMBER": "bitbucket-build-num", "BITBUCKET_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "BITBUCKET_GIT_HTTP_ORIGIN": "ssh://user:password@host.xz:port/path/to/repo.git/", + "BITBUCKET_GIT_HTTP_ORIGIN": "ssh://user:password@host.xz:54321/path/to/repo.git/", "BITBUCKET_PIPELINE_UUID": "{bitbucket-uuid}", "BITBUCKET_REPO_FULL_NAME": "bitbucket-repo" }, @@ -549,7 +589,7 @@ "ci.pipeline.url": "https://bitbucket.org/bitbucket-repo/addon/pipelines/home#!/results/bitbucket-build-num", "ci.provider.name": "bitbucket", "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "git.repository_url": "ssh://host.xz:port/path/to/repo.git/" + "git.repository_url": "ssh://host.xz:54321/path/to/repo.git/" } ] ] diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/bitrise.json b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/bitrise.json index 6f5b52cdf90..579ace5d2c9 100644 --- a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/bitrise.json +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/bitrise.json @@ -479,6 +479,50 @@ "git.tag": "0.0.2" } ], + [ + { + "BITRISE_BUILD_NUMBER": "bitrise-pipeline-number", + "BITRISE_BUILD_SLUG": "bitrise-pipeline-id", + "BITRISE_BUILD_URL": "https://bitrise-build-url.com//", + "BITRISE_GIT_MESSAGE": "bitrise-git-commit-message", + "BITRISE_TRIGGERED_WORKFLOW_ID": "bitrise-pipeline-name", + "DD_TEST_CASE_NAME": "http-repository-url-no-git-suffix", + "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_REPOSITORY_URL": "https://github.com/DataDog/dogweb" + }, + { + "ci.pipeline.id": "bitrise-pipeline-id", + "ci.pipeline.name": "bitrise-pipeline-name", + "ci.pipeline.number": "bitrise-pipeline-number", + "ci.pipeline.url": "https://bitrise-build-url.com//", + "ci.provider.name": "bitrise", + "git.commit.message": "bitrise-git-commit-message", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://github.com/DataDog/dogweb" + } + ], + [ + { + "BITRISE_BUILD_NUMBER": "bitrise-pipeline-number", + "BITRISE_BUILD_SLUG": "bitrise-pipeline-id", + "BITRISE_BUILD_URL": "https://bitrise-build-url.com//", + "BITRISE_GIT_MESSAGE": "bitrise-git-commit-message", + "BITRISE_TRIGGERED_WORKFLOW_ID": "bitrise-pipeline-name", + "DD_TEST_CASE_NAME": "ssh-repository-url-no-git-suffix", + "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_REPOSITORY_URL": "ssh://host.xz:54321/path/to/repo/" + }, + { + "ci.pipeline.id": "bitrise-pipeline-id", + "ci.pipeline.name": "bitrise-pipeline-name", + "ci.pipeline.number": "bitrise-pipeline-number", + "ci.pipeline.url": "https://bitrise-build-url.com//", + "ci.provider.name": "bitrise", + "git.commit.message": "bitrise-git-commit-message", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "ssh://host.xz:54321/path/to/repo/" + } + ], [ { "BITRISE_BUILD_NUMBER": "bitrise-pipeline-number", @@ -613,7 +657,7 @@ "BITRISE_GIT_MESSAGE": "bitrise-git-commit-message", "BITRISE_TRIGGERED_WORKFLOW_ID": "bitrise-pipeline-name", "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "GIT_REPOSITORY_URL": "ssh://user@host.xz:port/path/to/repo.git/" + "GIT_REPOSITORY_URL": "ssh://user@host.xz:54321/path/to/repo.git/" }, { "ci.pipeline.id": "bitrise-pipeline-id", @@ -623,7 +667,7 @@ "ci.provider.name": "bitrise", "git.commit.message": "bitrise-git-commit-message", "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "git.repository_url": "ssh://host.xz:port/path/to/repo.git/" + "git.repository_url": "ssh://host.xz:54321/path/to/repo.git/" } ], [ @@ -634,7 +678,7 @@ "BITRISE_GIT_MESSAGE": "bitrise-git-commit-message", "BITRISE_TRIGGERED_WORKFLOW_ID": "bitrise-pipeline-name", "GIT_CLONE_COMMIT_HASH": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "GIT_REPOSITORY_URL": "ssh://user:password@host.xz:port/path/to/repo.git/" + "GIT_REPOSITORY_URL": "ssh://user:password@host.xz:54321/path/to/repo.git/" }, { "ci.pipeline.id": "bitrise-pipeline-id", @@ -644,7 +688,7 @@ "ci.provider.name": "bitrise", "git.commit.message": "bitrise-git-commit-message", "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "git.repository_url": "ssh://host.xz:port/path/to/repo.git/" + "git.repository_url": "ssh://host.xz:54321/path/to/repo.git/" } ] ] diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/buddy.json b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/buddy.json index 007cc196652..9c64a199d13 100644 --- a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/buddy.json +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/buddy.json @@ -178,6 +178,68 @@ "git.tag": "v1.0" } ], + [ + { + "BUDDY": "true", + "BUDDY_EXECUTION_BRANCH": "master", + "BUDDY_EXECUTION_ID": "buddy-execution-id", + "BUDDY_EXECUTION_REVISION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "BUDDY_EXECUTION_REVISION_COMMITTER_EMAIL": "mikebenson@buddy.works", + "BUDDY_EXECUTION_REVISION_COMMITTER_NAME": "Mike Benson", + "BUDDY_EXECUTION_REVISION_MESSAGE": "Create buddy.yml", + "BUDDY_EXECUTION_TAG": "v1.0", + "BUDDY_EXECUTION_URL": "https://app.buddy.works/myworkspace/my-project/pipelines/pipeline/456/execution/5d9dc42c422f5a268b389d08", + "BUDDY_PIPELINE_ID": "456", + "BUDDY_PIPELINE_NAME": "Deploy to Production", + "BUDDY_SCM_URL": "https://github.com/buddyworks/my-project", + "DD_TEST_CASE_NAME": "http-repository-url-no-git-suffix" + }, + { + "ci.pipeline.id": "456/buddy-execution-id", + "ci.pipeline.name": "Deploy to Production", + "ci.pipeline.number": "buddy-execution-id", + "ci.pipeline.url": "https://app.buddy.works/myworkspace/my-project/pipelines/pipeline/456/execution/5d9dc42c422f5a268b389d08", + "ci.provider.name": "buddy", + "git.branch": "master", + "git.commit.committer.email": "mikebenson@buddy.works", + "git.commit.committer.name": "Mike Benson", + "git.commit.message": "Create buddy.yml", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://github.com/buddyworks/my-project", + "git.tag": "v1.0" + } + ], + [ + { + "BUDDY": "true", + "BUDDY_EXECUTION_BRANCH": "master", + "BUDDY_EXECUTION_ID": "buddy-execution-id", + "BUDDY_EXECUTION_REVISION": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "BUDDY_EXECUTION_REVISION_COMMITTER_EMAIL": "mikebenson@buddy.works", + "BUDDY_EXECUTION_REVISION_COMMITTER_NAME": "Mike Benson", + "BUDDY_EXECUTION_REVISION_MESSAGE": "Create buddy.yml", + "BUDDY_EXECUTION_TAG": "v1.0", + "BUDDY_EXECUTION_URL": "https://app.buddy.works/myworkspace/my-project/pipelines/pipeline/456/execution/5d9dc42c422f5a268b389d08", + "BUDDY_PIPELINE_ID": "456", + "BUDDY_PIPELINE_NAME": "Deploy to Production", + "BUDDY_SCM_URL": "ssh://host.xz:54321/path/to/repo/", + "DD_TEST_CASE_NAME": "ssh-repository-url-no-git-suffix" + }, + { + "ci.pipeline.id": "456/buddy-execution-id", + "ci.pipeline.name": "Deploy to Production", + "ci.pipeline.number": "buddy-execution-id", + "ci.pipeline.url": "https://app.buddy.works/myworkspace/my-project/pipelines/pipeline/456/execution/5d9dc42c422f5a268b389d08", + "ci.provider.name": "buddy", + "git.branch": "master", + "git.commit.committer.email": "mikebenson@buddy.works", + "git.commit.committer.name": "Mike Benson", + "git.commit.message": "Create buddy.yml", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "ssh://host.xz:54321/path/to/repo/", + "git.tag": "v1.0" + } + ], [ { "BUDDY": "true", @@ -371,7 +433,7 @@ "BUDDY_EXECUTION_URL": "https://app.buddy.works/myworkspace/my-project/pipelines/pipeline/456/execution/5d9dc42c422f5a268b389d08", "BUDDY_PIPELINE_ID": "456", "BUDDY_PIPELINE_NAME": "Deploy to Production", - "BUDDY_SCM_URL": "ssh://user@host.xz:port/path/to/repo.git/" + "BUDDY_SCM_URL": "ssh://user@host.xz:54321/path/to/repo.git/" }, { "ci.pipeline.id": "456/buddy-execution-id", @@ -384,7 +446,7 @@ "git.commit.committer.name": "Mike Benson", "git.commit.message": "Create buddy.yml", "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "git.repository_url": "ssh://host.xz:port/path/to/repo.git/", + "git.repository_url": "ssh://host.xz:54321/path/to/repo.git/", "git.tag": "v1.0" } ], @@ -401,7 +463,7 @@ "BUDDY_EXECUTION_URL": "https://app.buddy.works/myworkspace/my-project/pipelines/pipeline/456/execution/5d9dc42c422f5a268b389d08", "BUDDY_PIPELINE_ID": "456", "BUDDY_PIPELINE_NAME": "Deploy to Production", - "BUDDY_SCM_URL": "ssh://user:password@host.xz:port/path/to/repo.git/" + "BUDDY_SCM_URL": "ssh://user:password@host.xz:54321/path/to/repo.git/" }, { "ci.pipeline.id": "456/buddy-execution-id", @@ -414,7 +476,7 @@ "git.commit.committer.name": "Mike Benson", "git.commit.message": "Create buddy.yml", "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "git.repository_url": "ssh://host.xz:port/path/to/repo.git/", + "git.repository_url": "ssh://host.xz:54321/path/to/repo.git/", "git.tag": "v1.0" } ] diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/buildkite.json b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/buildkite.json index 421904b20e6..86ff170deb8 100644 --- a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/buildkite.json +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/buildkite.json @@ -673,6 +673,70 @@ "git.tag": "0.0.2" } ], + [ + { + "BUILDKITE": "true", + "BUILDKITE_BRANCH": "", + "BUILDKITE_BUILD_AUTHOR": "buildkite-git-commit-author-name", + "BUILDKITE_BUILD_AUTHOR_EMAIL": "buildkite-git-commit-author-email@datadoghq.com", + "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", + "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", + "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "BUILDKITE_JOB_ID": "buildkite-job-id", + "BUILDKITE_MESSAGE": "buildkite-git-commit-message", + "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", + "BUILDKITE_REPO": "https://github.com/DataDog/dogweb", + "BUILDKITE_TAG": "", + "DD_TEST_CASE_NAME": "http-repository-url-no-git-suffix" + }, + { + "_dd.ci.env_vars": "{\"BUILDKITE_BUILD_ID\":\"buildkite-pipeline-id\",\"BUILDKITE_JOB_ID\":\"buildkite-job-id\"}", + "ci.job.url": "https://buildkite-build-url.com#buildkite-job-id", + "ci.pipeline.id": "buildkite-pipeline-id", + "ci.pipeline.name": "buildkite-pipeline-name", + "ci.pipeline.number": "buildkite-pipeline-number", + "ci.pipeline.url": "https://buildkite-build-url.com", + "ci.provider.name": "buildkite", + "git.commit.author.email": "buildkite-git-commit-author-email@datadoghq.com", + "git.commit.author.name": "buildkite-git-commit-author-name", + "git.commit.message": "buildkite-git-commit-message", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://github.com/DataDog/dogweb" + } + ], + [ + { + "BUILDKITE": "true", + "BUILDKITE_BRANCH": "", + "BUILDKITE_BUILD_AUTHOR": "buildkite-git-commit-author-name", + "BUILDKITE_BUILD_AUTHOR_EMAIL": "buildkite-git-commit-author-email@datadoghq.com", + "BUILDKITE_BUILD_ID": "buildkite-pipeline-id", + "BUILDKITE_BUILD_NUMBER": "buildkite-pipeline-number", + "BUILDKITE_BUILD_URL": "https://buildkite-build-url.com", + "BUILDKITE_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "BUILDKITE_JOB_ID": "buildkite-job-id", + "BUILDKITE_MESSAGE": "buildkite-git-commit-message", + "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", + "BUILDKITE_REPO": "ssh://host.xz:54321/path/to/repo/", + "BUILDKITE_TAG": "", + "DD_TEST_CASE_NAME": "ssh-repository-url-no-git-suffix" + }, + { + "_dd.ci.env_vars": "{\"BUILDKITE_BUILD_ID\":\"buildkite-pipeline-id\",\"BUILDKITE_JOB_ID\":\"buildkite-job-id\"}", + "ci.job.url": "https://buildkite-build-url.com#buildkite-job-id", + "ci.pipeline.id": "buildkite-pipeline-id", + "ci.pipeline.name": "buildkite-pipeline-name", + "ci.pipeline.number": "buildkite-pipeline-number", + "ci.pipeline.url": "https://buildkite-build-url.com", + "ci.provider.name": "buildkite", + "git.commit.author.email": "buildkite-git-commit-author-email@datadoghq.com", + "git.commit.author.name": "buildkite-git-commit-author-name", + "git.commit.message": "buildkite-git-commit-message", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "ssh://host.xz:54321/path/to/repo/" + } + ], [ { "BUILDKITE": "true", @@ -872,7 +936,7 @@ "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", - "BUILDKITE_REPO": "ssh://user@host.xz:port/path/to/repo.git/", + "BUILDKITE_REPO": "ssh://user@host.xz:54321/path/to/repo.git/", "BUILDKITE_TAG": "" }, { @@ -887,7 +951,7 @@ "git.commit.author.name": "buildkite-git-commit-author-name", "git.commit.message": "buildkite-git-commit-message", "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "git.repository_url": "ssh://host.xz:port/path/to/repo.git/" + "git.repository_url": "ssh://host.xz:54321/path/to/repo.git/" } ], [ @@ -903,7 +967,7 @@ "BUILDKITE_JOB_ID": "buildkite-job-id", "BUILDKITE_MESSAGE": "buildkite-git-commit-message", "BUILDKITE_PIPELINE_SLUG": "buildkite-pipeline-name", - "BUILDKITE_REPO": "ssh://user:password@host.xz:port/path/to/repo.git/", + "BUILDKITE_REPO": "ssh://user:password@host.xz:54321/path/to/repo.git/", "BUILDKITE_TAG": "" }, { @@ -918,7 +982,7 @@ "git.commit.author.name": "buildkite-git-commit-author-name", "git.commit.message": "buildkite-git-commit-message", "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "git.repository_url": "ssh://host.xz:port/path/to/repo.git/" + "git.repository_url": "ssh://host.xz:54321/path/to/repo.git/" } ], [ diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/circleci.json b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/circleci.json index b9065be3bd6..2a697af349a 100644 --- a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/circleci.json +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/circleci.json @@ -519,6 +519,54 @@ "git.tag": "0.0.2" } ], + [ + { + "CIRCLECI": "circleCI", + "CIRCLE_BUILD_NUM": "circleci-pipeline-number", + "CIRCLE_BUILD_URL": "https://circleci-build-url.com/", + "CIRCLE_JOB": "circleci-job-name", + "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", + "CIRCLE_REPOSITORY_URL": "https://github.com/DataDog/dogweb", + "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id", + "DD_TEST_CASE_NAME": "http-repository-url-no-git-suffix" + }, + { + "_dd.ci.env_vars": "{\"CIRCLE_WORKFLOW_ID\":\"circleci-pipeline-id\",\"CIRCLE_BUILD_NUM\":\"circleci-pipeline-number\"}", + "ci.job.name": "circleci-job-name", + "ci.job.url": "https://circleci-build-url.com/", + "ci.pipeline.id": "circleci-pipeline-id", + "ci.pipeline.name": "circleci-pipeline-name", + "ci.pipeline.url": "https://app.circleci.com/pipelines/workflows/circleci-pipeline-id", + "ci.provider.name": "circleci", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://github.com/DataDog/dogweb" + } + ], + [ + { + "CIRCLECI": "circleCI", + "CIRCLE_BUILD_NUM": "circleci-pipeline-number", + "CIRCLE_BUILD_URL": "https://circleci-build-url.com/", + "CIRCLE_JOB": "circleci-job-name", + "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", + "CIRCLE_REPOSITORY_URL": "ssh://host.xz:54321/path/to/repo/", + "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id", + "DD_TEST_CASE_NAME": "ssh-repository-url-no-git-suffix" + }, + { + "_dd.ci.env_vars": "{\"CIRCLE_WORKFLOW_ID\":\"circleci-pipeline-id\",\"CIRCLE_BUILD_NUM\":\"circleci-pipeline-number\"}", + "ci.job.name": "circleci-job-name", + "ci.job.url": "https://circleci-build-url.com/", + "ci.pipeline.id": "circleci-pipeline-id", + "ci.pipeline.name": "circleci-pipeline-name", + "ci.pipeline.url": "https://app.circleci.com/pipelines/workflows/circleci-pipeline-id", + "ci.provider.name": "circleci", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "ssh://host.xz:54321/path/to/repo/" + } + ], [ { "CIRCLECI": "circleCI", @@ -664,7 +712,7 @@ "CIRCLE_BUILD_URL": "https://circleci-build-url.com/", "CIRCLE_JOB": "circleci-job-name", "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", - "CIRCLE_REPOSITORY_URL": "ssh://user@host.xz:port/path/to/repo.git/", + "CIRCLE_REPOSITORY_URL": "ssh://user@host.xz:54321/path/to/repo.git/", "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id" }, @@ -677,7 +725,7 @@ "ci.pipeline.url": "https://app.circleci.com/pipelines/workflows/circleci-pipeline-id", "ci.provider.name": "circleci", "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "git.repository_url": "ssh://host.xz:port/path/to/repo.git/" + "git.repository_url": "ssh://host.xz:54321/path/to/repo.git/" } ], [ @@ -687,7 +735,7 @@ "CIRCLE_BUILD_URL": "https://circleci-build-url.com/", "CIRCLE_JOB": "circleci-job-name", "CIRCLE_PROJECT_REPONAME": "circleci-pipeline-name", - "CIRCLE_REPOSITORY_URL": "ssh://user:password@host.xz:port/path/to/repo.git/", + "CIRCLE_REPOSITORY_URL": "ssh://user:password@host.xz:54321/path/to/repo.git/", "CIRCLE_SHA1": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "CIRCLE_WORKFLOW_ID": "circleci-pipeline-id" }, @@ -700,7 +748,7 @@ "ci.pipeline.url": "https://app.circleci.com/pipelines/workflows/circleci-pipeline-id", "ci.provider.name": "circleci", "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "git.repository_url": "ssh://host.xz:port/path/to/repo.git/" + "git.repository_url": "ssh://host.xz:54321/path/to/repo.git/" } ] ] diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/codefresh.json b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/codefresh.json index 7b1367b4f09..d719df10592 100644 --- a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/codefresh.json +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/codefresh.json @@ -158,167 +158,5 @@ "git.repository_url": "git@github.com:DataDog/userrepo.git", "git.tag": "0.0.2" } - ], - [ - { - "CF_BUILD_ID": "6410367cee516146a4c4c66e", - "CF_BUILD_URL": "https://g.codefresh.io/build/6410367cee516146a4c4c66e", - "CF_PIPELINE_NAME": "My simple project/Example Java Project Pipeline", - "CF_STEP_NAME": "mah-job-name", - "DD_GIT_REPOSITORY_URL": "https://user:password@github.com/DataDog/dogweb.git" - }, - { - "_dd.ci.env_vars": "{\"CF_BUILD_ID\":\"6410367cee516146a4c4c66e\"}", - "ci.job.name": "mah-job-name", - "ci.pipeline.id": "6410367cee516146a4c4c66e", - "ci.pipeline.name": "My simple project/Example Java Project Pipeline", - "ci.pipeline.url": "https://g.codefresh.io/build/6410367cee516146a4c4c66e", - "ci.provider.name": "codefresh", - "git.repository_url": "https://github.com/DataDog/dogweb.git" - } - ], - [ - { - "CF_BUILD_ID": "6410367cee516146a4c4c66e", - "CF_BUILD_URL": "https://g.codefresh.io/build/6410367cee516146a4c4c66e", - "CF_PIPELINE_NAME": "My simple project/Example Java Project Pipeline", - "CF_STEP_NAME": "mah-job-name", - "DD_GIT_REPOSITORY_URL": "https://user@github.com/DataDog/dogweb.git" - }, - { - "_dd.ci.env_vars": "{\"CF_BUILD_ID\":\"6410367cee516146a4c4c66e\"}", - "ci.job.name": "mah-job-name", - "ci.pipeline.id": "6410367cee516146a4c4c66e", - "ci.pipeline.name": "My simple project/Example Java Project Pipeline", - "ci.pipeline.url": "https://g.codefresh.io/build/6410367cee516146a4c4c66e", - "ci.provider.name": "codefresh", - "git.repository_url": "https://github.com/DataDog/dogweb.git" - } - ], - [ - { - "CF_BUILD_ID": "6410367cee516146a4c4c66e", - "CF_BUILD_URL": "https://g.codefresh.io/build/6410367cee516146a4c4c66e", - "CF_PIPELINE_NAME": "My simple project/Example Java Project Pipeline", - "CF_STEP_NAME": "mah-job-name", - "DD_GIT_REPOSITORY_URL": "https://user:password@github.com:1234/DataDog/dogweb.git" - }, - { - "_dd.ci.env_vars": "{\"CF_BUILD_ID\":\"6410367cee516146a4c4c66e\"}", - "ci.job.name": "mah-job-name", - "ci.pipeline.id": "6410367cee516146a4c4c66e", - "ci.pipeline.name": "My simple project/Example Java Project Pipeline", - "ci.pipeline.url": "https://g.codefresh.io/build/6410367cee516146a4c4c66e", - "ci.provider.name": "codefresh", - "git.repository_url": "https://github.com:1234/DataDog/dogweb.git" - } - ], - [ - { - "CF_BUILD_ID": "6410367cee516146a4c4c66e", - "CF_BUILD_URL": "https://g.codefresh.io/build/6410367cee516146a4c4c66e", - "CF_PIPELINE_NAME": "My simple project/Example Java Project Pipeline", - "CF_STEP_NAME": "mah-job-name", - "DD_GIT_REPOSITORY_URL": "https://user:password@1.1.1.1/DataDog/dogweb.git" - }, - { - "_dd.ci.env_vars": "{\"CF_BUILD_ID\":\"6410367cee516146a4c4c66e\"}", - "ci.job.name": "mah-job-name", - "ci.pipeline.id": "6410367cee516146a4c4c66e", - "ci.pipeline.name": "My simple project/Example Java Project Pipeline", - "ci.pipeline.url": "https://g.codefresh.io/build/6410367cee516146a4c4c66e", - "ci.provider.name": "codefresh", - "git.repository_url": "https://1.1.1.1/DataDog/dogweb.git" - } - ], - [ - { - "CF_BUILD_ID": "6410367cee516146a4c4c66e", - "CF_BUILD_URL": "https://g.codefresh.io/build/6410367cee516146a4c4c66e", - "CF_PIPELINE_NAME": "My simple project/Example Java Project Pipeline", - "CF_STEP_NAME": "mah-job-name", - "DD_GIT_REPOSITORY_URL": "https://user:password@1.1.1.1/DataDog/dogweb.git" - }, - { - "_dd.ci.env_vars": "{\"CF_BUILD_ID\":\"6410367cee516146a4c4c66e\"}", - "ci.job.name": "mah-job-name", - "ci.pipeline.id": "6410367cee516146a4c4c66e", - "ci.pipeline.name": "My simple project/Example Java Project Pipeline", - "ci.pipeline.url": "https://g.codefresh.io/build/6410367cee516146a4c4c66e", - "ci.provider.name": "codefresh", - "git.repository_url": "https://1.1.1.1/DataDog/dogweb.git" - } - ], - [ - { - "CF_BUILD_ID": "6410367cee516146a4c4c66e", - "CF_BUILD_URL": "https://g.codefresh.io/build/6410367cee516146a4c4c66e", - "CF_PIPELINE_NAME": "My simple project/Example Java Project Pipeline", - "CF_STEP_NAME": "mah-job-name", - "DD_GIT_REPOSITORY_URL": "https://user:password@1.1.1.1:1234/DataDog/dogweb.git" - }, - { - "_dd.ci.env_vars": "{\"CF_BUILD_ID\":\"6410367cee516146a4c4c66e\"}", - "ci.job.name": "mah-job-name", - "ci.pipeline.id": "6410367cee516146a4c4c66e", - "ci.pipeline.name": "My simple project/Example Java Project Pipeline", - "ci.pipeline.url": "https://g.codefresh.io/build/6410367cee516146a4c4c66e", - "ci.provider.name": "codefresh", - "git.repository_url": "https://1.1.1.1:1234/DataDog/dogweb.git" - } - ], - [ - { - "CF_BUILD_ID": "6410367cee516146a4c4c66e", - "CF_BUILD_URL": "https://g.codefresh.io/build/6410367cee516146a4c4c66e", - "CF_PIPELINE_NAME": "My simple project/Example Java Project Pipeline", - "CF_STEP_NAME": "mah-job-name", - "DD_GIT_REPOSITORY_URL": "https://user:password@1.1.1.1:1234/DataDog/dogweb_with_@_yeah.git" - }, - { - "_dd.ci.env_vars": "{\"CF_BUILD_ID\":\"6410367cee516146a4c4c66e\"}", - "ci.job.name": "mah-job-name", - "ci.pipeline.id": "6410367cee516146a4c4c66e", - "ci.pipeline.name": "My simple project/Example Java Project Pipeline", - "ci.pipeline.url": "https://g.codefresh.io/build/6410367cee516146a4c4c66e", - "ci.provider.name": "codefresh", - "git.repository_url": "https://1.1.1.1:1234/DataDog/dogweb_with_@_yeah.git" - } - ], - [ - { - "CF_BUILD_ID": "6410367cee516146a4c4c66e", - "CF_BUILD_URL": "https://g.codefresh.io/build/6410367cee516146a4c4c66e", - "CF_PIPELINE_NAME": "My simple project/Example Java Project Pipeline", - "CF_STEP_NAME": "mah-job-name", - "DD_GIT_REPOSITORY_URL": "ssh://user@host.xz:port/path/to/repo.git/" - }, - { - "_dd.ci.env_vars": "{\"CF_BUILD_ID\":\"6410367cee516146a4c4c66e\"}", - "ci.job.name": "mah-job-name", - "ci.pipeline.id": "6410367cee516146a4c4c66e", - "ci.pipeline.name": "My simple project/Example Java Project Pipeline", - "ci.pipeline.url": "https://g.codefresh.io/build/6410367cee516146a4c4c66e", - "ci.provider.name": "codefresh", - "git.repository_url": "ssh://host.xz:port/path/to/repo.git/" - } - ], - [ - { - "CF_BUILD_ID": "6410367cee516146a4c4c66e", - "CF_BUILD_URL": "https://g.codefresh.io/build/6410367cee516146a4c4c66e", - "CF_PIPELINE_NAME": "My simple project/Example Java Project Pipeline", - "CF_STEP_NAME": "mah-job-name", - "DD_GIT_REPOSITORY_URL": "ssh://user:password@host.xz:port/path/to/repo.git/" - }, - { - "_dd.ci.env_vars": "{\"CF_BUILD_ID\":\"6410367cee516146a4c4c66e\"}", - "ci.job.name": "mah-job-name", - "ci.pipeline.id": "6410367cee516146a4c4c66e", - "ci.pipeline.name": "My simple project/Example Java Project Pipeline", - "ci.pipeline.url": "https://g.codefresh.io/build/6410367cee516146a4c4c66e", - "ci.provider.name": "codefresh", - "git.repository_url": "ssh://host.xz:port/path/to/repo.git/" - } ] ] diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/gitlab.json b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/gitlab.json index 400d99c977d..24882c1e859 100644 --- a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/gitlab.json +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/gitlab.json @@ -451,6 +451,88 @@ "git.tag": "0.1.0" } ], + [ + { + "CI_COMMIT_AUTHOR": "John Doe ", + "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", + "CI_COMMIT_REF_NAME": "origin/master", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", + "CI_JOB_ID": "gitlab-job-id", + "CI_JOB_NAME": "gitlab-job-name", + "CI_JOB_STAGE": "gitlab-stage-name", + "CI_JOB_URL": "https://gitlab.com/job", + "CI_PIPELINE_ID": "gitlab-pipeline-id", + "CI_PIPELINE_IID": "gitlab-pipeline-number", + "CI_PIPELINE_URL": "https://foo/repo/-/pipelines/1234", + "CI_PROJECT_DIR": "/foo/bar", + "CI_PROJECT_PATH": "gitlab-pipeline-name", + "CI_PROJECT_URL": "https://gitlab.com/repo", + "CI_REPOSITORY_URL": "http://hostname.com/repo", + "DD_TEST_CASE_NAME": "http-repository-url-no-git-suffix", + "GITLAB_CI": "gitlab" + }, + { + "_dd.ci.env_vars": "{\"CI_PROJECT_URL\":\"https://gitlab.com/repo\",\"CI_PIPELINE_ID\":\"gitlab-pipeline-id\",\"CI_JOB_ID\":\"gitlab-job-id\"}", + "ci.job.name": "gitlab-job-name", + "ci.job.url": "https://gitlab.com/job", + "ci.pipeline.id": "gitlab-pipeline-id", + "ci.pipeline.name": "gitlab-pipeline-name", + "ci.pipeline.number": "gitlab-pipeline-number", + "ci.pipeline.url": "https://foo/repo/-/pipelines/1234", + "ci.provider.name": "gitlab", + "ci.stage.name": "gitlab-stage-name", + "ci.workspace_path": "/foo/bar", + "git.branch": "master", + "git.commit.author.date": "2021-07-21T11:43:07-04:00", + "git.commit.author.email": "john@doe.com", + "git.commit.author.name": "John Doe", + "git.commit.message": "gitlab-git-commit-message", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "http://hostname.com/repo" + } + ], + [ + { + "CI_COMMIT_AUTHOR": "John Doe ", + "CI_COMMIT_MESSAGE": "gitlab-git-commit-message", + "CI_COMMIT_REF_NAME": "origin/master", + "CI_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "CI_COMMIT_TIMESTAMP": "2021-07-21T11:43:07-04:00", + "CI_JOB_ID": "gitlab-job-id", + "CI_JOB_NAME": "gitlab-job-name", + "CI_JOB_STAGE": "gitlab-stage-name", + "CI_JOB_URL": "https://gitlab.com/job", + "CI_PIPELINE_ID": "gitlab-pipeline-id", + "CI_PIPELINE_IID": "gitlab-pipeline-number", + "CI_PIPELINE_URL": "https://foo/repo/-/pipelines/1234", + "CI_PROJECT_DIR": "/foo/bar", + "CI_PROJECT_PATH": "gitlab-pipeline-name", + "CI_PROJECT_URL": "https://gitlab.com/repo", + "CI_REPOSITORY_URL": "ssh://host.xz:54321/path/to/repo/", + "DD_TEST_CASE_NAME": "ssh-repository-url-no-git-suffix", + "GITLAB_CI": "gitlab" + }, + { + "_dd.ci.env_vars": "{\"CI_PROJECT_URL\":\"https://gitlab.com/repo\",\"CI_PIPELINE_ID\":\"gitlab-pipeline-id\",\"CI_JOB_ID\":\"gitlab-job-id\"}", + "ci.job.name": "gitlab-job-name", + "ci.job.url": "https://gitlab.com/job", + "ci.pipeline.id": "gitlab-pipeline-id", + "ci.pipeline.name": "gitlab-pipeline-name", + "ci.pipeline.number": "gitlab-pipeline-number", + "ci.pipeline.url": "https://foo/repo/-/pipelines/1234", + "ci.provider.name": "gitlab", + "ci.stage.name": "gitlab-stage-name", + "ci.workspace_path": "/foo/bar", + "git.branch": "master", + "git.commit.author.date": "2021-07-21T11:43:07-04:00", + "git.commit.author.email": "john@doe.com", + "git.commit.author.name": "John Doe", + "git.commit.message": "gitlab-git-commit-message", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "ssh://host.xz:54321/path/to/repo/" + } + ], [ { "CI_COMMIT_AUTHOR": "John Doe ", diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/jenkins.json b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/jenkins.json index f87cdbd2a36..38d448747b8 100644 --- a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/jenkins.json +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/jenkins.json @@ -666,6 +666,50 @@ "git.tag": "0.0.2" } ], + [ + { + "BUILD_NUMBER": "jenkins-pipeline-number", + "BUILD_TAG": "jenkins-pipeline-id", + "BUILD_URL": "https://jenkins.com/pipeline", + "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_TEST_CASE_NAME": "http-repository-url-no-git-suffix", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_URL_1": "https://github.com/DataDog/dogweb", + "JENKINS_URL": "jenkins", + "JOB_URL": "https://jenkins.com/job" + }, + { + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "ci.pipeline.id": "jenkins-pipeline-id", + "ci.pipeline.number": "jenkins-pipeline-number", + "ci.pipeline.url": "https://jenkins.com/pipeline", + "ci.provider.name": "jenkins", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://github.com/DataDog/dogweb" + } + ], + [ + { + "BUILD_NUMBER": "jenkins-pipeline-number", + "BUILD_TAG": "jenkins-pipeline-id", + "BUILD_URL": "https://jenkins.com/pipeline", + "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_TEST_CASE_NAME": "ssh-repository-url-no-git-suffix", + "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "GIT_URL_1": "ssh://host.xz:54321/path/to/repo/", + "JENKINS_URL": "jenkins", + "JOB_URL": "https://jenkins.com/job" + }, + { + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "ci.pipeline.id": "jenkins-pipeline-id", + "ci.pipeline.number": "jenkins-pipeline-number", + "ci.pipeline.url": "https://jenkins.com/pipeline", + "ci.provider.name": "jenkins", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "ssh://host.xz:54321/path/to/repo/" + } + ], [ { "BUILD_NUMBER": "jenkins-pipeline-number", @@ -799,7 +843,7 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "GIT_URL_1": "ssh://user@host.xz:port/path/to/repo.git/", + "GIT_URL_1": "ssh://user@host.xz:54321/path/to/repo.git/", "JENKINS_URL": "jenkins", "JOB_URL": "https://jenkins.com/job" }, @@ -810,7 +854,7 @@ "ci.pipeline.url": "https://jenkins.com/pipeline", "ci.provider.name": "jenkins", "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "git.repository_url": "ssh://host.xz:port/path/to/repo.git/" + "git.repository_url": "ssh://host.xz:54321/path/to/repo.git/" } ], [ @@ -820,7 +864,7 @@ "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "GIT_URL_1": "ssh://user:password@host.xz:port/path/to/repo.git/", + "GIT_URL_1": "ssh://user:password@host.xz:54321/path/to/repo.git/", "JENKINS_URL": "jenkins", "JOB_URL": "https://jenkins.com/job" }, @@ -831,7 +875,7 @@ "ci.pipeline.url": "https://jenkins.com/pipeline", "ci.provider.name": "jenkins", "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "git.repository_url": "ssh://host.xz:port/path/to/repo.git/" + "git.repository_url": "ssh://host.xz:54321/path/to/repo.git/" } ], [ diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/teamcity.json b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/teamcity.json index 037887c4ae0..086c1c16de1 100644 --- a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/teamcity.json +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/teamcity.json @@ -74,117 +74,5 @@ "git.repository_url": "git@github.com:DataDog/userrepo.git", "git.tag": "0.0.2" } - ], - [ - { - "BUILD_URL": "https://teamcity.com/repo", - "DD_GIT_REPOSITORY_URL": "https://user:password@github.com/DataDog/dogweb.git", - "TEAMCITY_BUILDCONF_NAME": "Test 1", - "TEAMCITY_VERSION": "2022.10 (build 116751)" - }, - { - "ci.job.name": "Test 1", - "ci.job.url": "https://teamcity.com/repo", - "ci.provider.name": "teamcity", - "git.repository_url": "https://github.com/DataDog/dogweb.git" - } - ], - [ - { - "BUILD_URL": "https://teamcity.com/repo", - "DD_GIT_REPOSITORY_URL": "https://user@github.com/DataDog/dogweb.git", - "TEAMCITY_BUILDCONF_NAME": "Test 1", - "TEAMCITY_VERSION": "2022.10 (build 116751)" - }, - { - "ci.job.name": "Test 1", - "ci.job.url": "https://teamcity.com/repo", - "ci.provider.name": "teamcity", - "git.repository_url": "https://github.com/DataDog/dogweb.git" - } - ], - [ - { - "BUILD_URL": "https://teamcity.com/repo", - "DD_GIT_REPOSITORY_URL": "https://user:password@github.com:1234/DataDog/dogweb.git", - "TEAMCITY_BUILDCONF_NAME": "Test 1", - "TEAMCITY_VERSION": "2022.10 (build 116751)" - }, - { - "ci.job.name": "Test 1", - "ci.job.url": "https://teamcity.com/repo", - "ci.provider.name": "teamcity", - "git.repository_url": "https://github.com:1234/DataDog/dogweb.git" - } - ], - [ - { - "BUILD_URL": "https://teamcity.com/repo", - "DD_GIT_REPOSITORY_URL": "https://user:password@1.1.1.1/DataDog/dogweb.git", - "TEAMCITY_BUILDCONF_NAME": "Test 1", - "TEAMCITY_VERSION": "2022.10 (build 116751)" - }, - { - "ci.job.name": "Test 1", - "ci.job.url": "https://teamcity.com/repo", - "ci.provider.name": "teamcity", - "git.repository_url": "https://1.1.1.1/DataDog/dogweb.git" - } - ], - [ - { - "BUILD_URL": "https://teamcity.com/repo", - "DD_GIT_REPOSITORY_URL": "https://user:password@1.1.1.1:1234/DataDog/dogweb.git", - "TEAMCITY_BUILDCONF_NAME": "Test 1", - "TEAMCITY_VERSION": "2022.10 (build 116751)" - }, - { - "ci.job.name": "Test 1", - "ci.job.url": "https://teamcity.com/repo", - "ci.provider.name": "teamcity", - "git.repository_url": "https://1.1.1.1:1234/DataDog/dogweb.git" - } - ], - [ - { - "BUILD_URL": "https://teamcity.com/repo", - "DD_GIT_REPOSITORY_URL": "https://user:password@1.1.1.1:1234/DataDog/dogweb_with_@_yeah.git", - "TEAMCITY_BUILDCONF_NAME": "Test 1", - "TEAMCITY_VERSION": "2022.10 (build 116751)" - }, - { - "ci.job.name": "Test 1", - "ci.job.url": "https://teamcity.com/repo", - "ci.provider.name": "teamcity", - "git.repository_url": "https://1.1.1.1:1234/DataDog/dogweb_with_@_yeah.git" - } - ], - [ - { - "BUILD_URL": "https://teamcity.com/repo", - "DD_GIT_REPOSITORY_URL": "ssh://user@host.xz:port/path/to/repo.git/", - "TEAMCITY_BUILDCONF_NAME": "Test 1", - "TEAMCITY_VERSION": "2022.10 (build 116751)" - }, - { - "ci.job.name": "Test 1", - "ci.job.url": "https://teamcity.com/repo", - "ci.provider.name": "teamcity", - "git.repository_url": "ssh://host.xz:port/path/to/repo.git/" - } - ], - [ - { - "BUILD_URL": "https://teamcity.com/repo", - "DD_GIT_REPOSITORY_URL": "ssh://user:password@host.xz:port/path/to/repo.git/", - "TEAMCITY_BUILDCONF_NAME": "Test 1", - "TEAMCITY_VERSION": "2022.10 (build 116751)" - }, - { - "ci.job.name": "Test 1", - "ci.job.url": "https://teamcity.com/repo", - "ci.provider.name": "teamcity", - "git.repository_url": "ssh://host.xz:port/path/to/repo.git/" - } ] ] diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/usersupplied.json b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/usersupplied.json index 464c4158558..f07f4e37400 100644 --- a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/usersupplied.json +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/usersupplied.json @@ -155,6 +155,56 @@ "git.tag": "0.0.2" } ], + [ + { + "DD_GIT_COMMIT_AUTHOR_DATE": "usersupplied-authordate", + "DD_GIT_COMMIT_AUTHOR_EMAIL": "usersupplied-authoremail", + "DD_GIT_COMMIT_AUTHOR_NAME": "usersupplied-authorname", + "DD_GIT_COMMIT_COMMITTER_DATE": "usersupplied-comitterdate", + "DD_GIT_COMMIT_COMMITTER_EMAIL": "usersupplied-comitteremail", + "DD_GIT_COMMIT_COMMITTER_NAME": "usersupplied-comittername", + "DD_GIT_COMMIT_MESSAGE": "usersupplied-message", + "DD_GIT_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "DD_GIT_REPOSITORY_URL": "https://github.com/DataDog/dogweb", + "DD_TEST_CASE_NAME": "http-repository-url-no-git-suffix" + }, + { + "git.commit.author.date": "usersupplied-authordate", + "git.commit.author.email": "usersupplied-authoremail", + "git.commit.author.name": "usersupplied-authorname", + "git.commit.committer.date": "usersupplied-comitterdate", + "git.commit.committer.email": "usersupplied-comitteremail", + "git.commit.committer.name": "usersupplied-comittername", + "git.commit.message": "usersupplied-message", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "https://github.com/DataDog/dogweb" + } + ], + [ + { + "DD_GIT_COMMIT_AUTHOR_DATE": "usersupplied-authordate", + "DD_GIT_COMMIT_AUTHOR_EMAIL": "usersupplied-authoremail", + "DD_GIT_COMMIT_AUTHOR_NAME": "usersupplied-authorname", + "DD_GIT_COMMIT_COMMITTER_DATE": "usersupplied-comitterdate", + "DD_GIT_COMMIT_COMMITTER_EMAIL": "usersupplied-comitteremail", + "DD_GIT_COMMIT_COMMITTER_NAME": "usersupplied-comittername", + "DD_GIT_COMMIT_MESSAGE": "usersupplied-message", + "DD_GIT_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "DD_GIT_REPOSITORY_URL": "ssh://host.xz:54321/path/to/repo/", + "DD_TEST_CASE_NAME": "ssh-repository-url-no-git-suffix" + }, + { + "git.commit.author.date": "usersupplied-authordate", + "git.commit.author.email": "usersupplied-authoremail", + "git.commit.author.name": "usersupplied-authorname", + "git.commit.committer.date": "usersupplied-comitterdate", + "git.commit.committer.email": "usersupplied-comitteremail", + "git.commit.committer.name": "usersupplied-comittername", + "git.commit.message": "usersupplied-message", + "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", + "git.repository_url": "ssh://host.xz:54321/path/to/repo/" + } + ], [ { "DD_GIT_COMMIT_AUTHOR_DATE": "usersupplied-authordate", @@ -309,7 +359,7 @@ "DD_GIT_COMMIT_COMMITTER_NAME": "usersupplied-comittername", "DD_GIT_COMMIT_MESSAGE": "usersupplied-message", "DD_GIT_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "DD_GIT_REPOSITORY_URL": "ssh://user@host.xz:port/path/to/repo.git/" + "DD_GIT_REPOSITORY_URL": "ssh://user@host.xz:54321/path/to/repo.git/" }, { "git.commit.author.date": "usersupplied-authordate", @@ -320,7 +370,7 @@ "git.commit.committer.name": "usersupplied-comittername", "git.commit.message": "usersupplied-message", "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "git.repository_url": "ssh://host.xz:port/path/to/repo.git/" + "git.repository_url": "ssh://host.xz:54321/path/to/repo.git/" } ], [ @@ -333,7 +383,7 @@ "DD_GIT_COMMIT_COMMITTER_NAME": "usersupplied-comittername", "DD_GIT_COMMIT_MESSAGE": "usersupplied-message", "DD_GIT_COMMIT_SHA": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "DD_GIT_REPOSITORY_URL": "ssh://user:password@host.xz:port/path/to/repo.git/" + "DD_GIT_REPOSITORY_URL": "ssh://user:password@host.xz:54321/path/to/repo.git/" }, { "git.commit.author.date": "usersupplied-authordate", @@ -344,7 +394,7 @@ "git.commit.committer.name": "usersupplied-comittername", "git.commit.message": "usersupplied-message", "git.commit.sha": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", - "git.repository_url": "ssh://host.xz:port/path/to/repo.git/" + "git.repository_url": "ssh://host.xz:54321/path/to/repo.git/" } ] ]