Skip to content

(fix) internal/civisibility: add some checks before performing the http requests.#3087

Merged
tonyredondo merged 1 commit into
mainfrom
tony/civisibility-add-some-checks
Jan 15, 2025
Merged

(fix) internal/civisibility: add some checks before performing the http requests.#3087
tonyredondo merged 1 commit into
mainfrom
tony/civisibility-add-some-checks

Conversation

@tonyredondo

@tonyredondo tonyredondo commented Jan 15, 2025

Copy link
Copy Markdown
Member

What does this PR do?

This PR add some checks before performing the http requests and also add support for sending code coverage data in a different format.

PR for V2: #3088

Motivation

I saw some http client response with status code 400 when testing on a Go project without a git repo.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.
  • For internal contributors, a matching PR should be created to the v2-dev branch and reviewed by @DataDog/apm-go.

Unsure? Have a question? Request a review!

…quests and also add support for sending code coverage data in a different format.
@datadog-datadog-prod-us1

Copy link
Copy Markdown

Datadog Report

Branch report: tony/civisibility-add-some-checks
Commit report: 35117b6
Test service: dd-trace-go

✅ 0 Failed, 5170 Passed, 70 Skipped, 2m 35.36s Total Time

@pr-commenter

pr-commenter Bot commented Jan 15, 2025

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2025-01-15 13:23:03

Comparing candidate commit eec56c7 in PR branch tony/civisibility-add-some-checks with baseline commit c8fce21 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 59 metrics, 0 unstable metrics.

Comment on lines +47 to +63
if format == FormatMessagePack {
coverageEvent = FormFile{
FieldName: "coveragex",
Content: ciTestCovPayload,
FileName: "filecoveragex.msgpack",
ContentType: ContentTypeMessagePack,
}
} else if format == FormatJSON {
coverageEvent = FormFile{
FieldName: "coveragex",
Content: ciTestCovPayload,
FileName: "filecoveragex.json",
ContentType: ContentTypeJSON,
}
} else {
return fmt.Errorf("unsupported format: %s", format)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: this could be a bit cleaner with a switch.

@tonyredondo
tonyredondo merged commit 20be179 into main Jan 15, 2025
@tonyredondo
tonyredondo deleted the tony/civisibility-add-some-checks branch January 15, 2025 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants