From f82c9f1bb1842f679915c0a3414e02f40950c2fd Mon Sep 17 00:00:00 2001 From: Nikita Tkachenko Date: Mon, 25 Aug 2025 12:54:47 +0200 Subject: [PATCH 1/2] Add Gitlab set up instructions for Code Coverage product --- content/en/code_coverage/data_collected.md | 9 +++++++++ content/en/code_coverage/setup.md | 20 +++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/content/en/code_coverage/data_collected.md b/content/en/code_coverage/data_collected.md index ac825500f592b..45c6fba4cdfa6 100644 --- a/content/en/code_coverage/data_collected.md +++ b/content/en/code_coverage/data_collected.md @@ -32,6 +32,15 @@ See GitHub's [webhook events and payloads documentation][1] for a detailed descr [1]: https://docs.github.com/en/webhooks/webhook-events-and-payloads +{{% /tab %}} +{{% tab "Gitlab" %}} + +Code Coverage relies on the Gitlab webhooks. None of the webhooks include your source code content; they only include metadata about the merge request, such as title, description, author, labels, and commit SHAs. + +See Gitlab's [webhook events and payloads documentation][1] for a detailed description of the data sent by the webhooks. + +[1]: https://docs.gitlab.com/user/project/integrations/webhook_events/ + {{% /tab %}} {{< /tabs >}} diff --git a/content/en/code_coverage/setup.md b/content/en/code_coverage/setup.md index 7fd3bca921141..71ca8df821b25 100644 --- a/content/en/code_coverage/setup.md +++ b/content/en/code_coverage/setup.md @@ -51,6 +51,13 @@ If everything is configured correctly, a green check mark is displayed in Datado [1]: /integrations/github/#github-apps-1 [2]: https://app.datadoghq.com/integrations/github/configuration +{{% /tab %}} +{{% tab "Gitlab" %}} + +Follow the [Datadog Source Code Integration Guide][1] for instructions on how to connect your Gitlab repositories to Datadog. + +[1]: /integrations/guide/source-code-integration/?tab=gitlabsaasonprem#connect-your-git-repositories-to-datadog + {{% /tab %}} {{< /tabs >}} @@ -315,6 +322,17 @@ steps: {{% /tab %}} +{{% tab "Gitlab" %}} +
+
+test:
+  stage: test
+  script:
+    - ... # run your tests and generate coverage reports
+    - datadog-ci coverage upload . # make sure to add the DD_API_KEY CI/CD variable
+
+
+{{% /tab %}} {{< /tabs >}} The command recursively searches the specified directories for supported coverage report files, so specifying the current directory (`.`) is usually sufficient. @@ -341,7 +359,7 @@ datadog-ci coverage upload --format=lcov \ ### Coverage upload fails with "Format could not be detected" error The `datadog-ci coverage upload` command automatically detects the format of the coverage report files based on their content and file extension. -If the command fails with the following error: +If the command fails with the following error: ``` Invalid coverage report file [...]: format could not be detected ``` From ebf847915a780d15c4d56cac620340fc59ad9c68 Mon Sep 17 00:00:00 2001 From: Nikita Tkachenko <121111529+nikita-tkachenko-datadog@users.noreply.github.com> Date: Mon, 25 Aug 2025 19:59:28 +0200 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: May Lee --- content/en/code_coverage/data_collected.md | 4 ++-- content/en/code_coverage/setup.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/content/en/code_coverage/data_collected.md b/content/en/code_coverage/data_collected.md index 45c6fba4cdfa6..612e3151d8e48 100644 --- a/content/en/code_coverage/data_collected.md +++ b/content/en/code_coverage/data_collected.md @@ -35,9 +35,9 @@ See GitHub's [webhook events and payloads documentation][1] for a detailed descr {{% /tab %}} {{% tab "Gitlab" %}} -Code Coverage relies on the Gitlab webhooks. None of the webhooks include your source code content; they only include metadata about the merge request, such as title, description, author, labels, and commit SHAs. +Code Coverage relies on Gitlab webhooks. The webhooks do not include your source code content. They only include metadata about the merge request, such as the title, description, author, labels, and commit SHAs. -See Gitlab's [webhook events and payloads documentation][1] for a detailed description of the data sent by the webhooks. +See Gitlab's [webhook events and payloads documentation][1] for a detailed description of the data sent by webhooks. [1]: https://docs.gitlab.com/user/project/integrations/webhook_events/ diff --git a/content/en/code_coverage/setup.md b/content/en/code_coverage/setup.md index 71ca8df821b25..b34ea7dc10350 100644 --- a/content/en/code_coverage/setup.md +++ b/content/en/code_coverage/setup.md @@ -54,7 +54,7 @@ If everything is configured correctly, a green check mark is displayed in Datado {{% /tab %}} {{% tab "Gitlab" %}} -Follow the [Datadog Source Code Integration Guide][1] for instructions on how to connect your Gitlab repositories to Datadog. +Follow instructions in the [Datadog Source Code Integration Guide][1] on how to connect your Gitlab repositories to Datadog. [1]: /integrations/guide/source-code-integration/?tab=gitlabsaasonprem#connect-your-git-repositories-to-datadog