fix(internal/civisibility): fix known-tests API pagination#4824
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
🚀 New features to boost your workflow:
|
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: b7356c7 | Docs | Datadog PR Page | Give us feedback! |
BenchmarksBenchmark execution time: 2026-06-01 08:44:05 Comparing candidate commit b7356c7 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 297 metrics, 2 unstable metrics, 1 flaky benchmarks without significant changes.
|
E2E Test Report: SUCCESSTested by: Shepherd Agent (autonomous QA for Datadog Test Optimization) Test Environment
Results
Request Shape VerificationMockdog request recordings confirmed:
Span VerificationThe executed gin test span for the multi-page and second-page-error runs had no Issues FoundNo dd-trace-go regressions found in this pass. One local command invocation initially failed because a shell regex alternation was not quoted; it was rerun with a shell-safe single-test regex and passed. Datadog UI VerificationNot applicable for this request: the behavior under test is dd-trace-go's known-tests client pagination contract and error handling using mockdog as the CI Visibility backend. Test Methodology
This E2E test was performed by Shepherd - autonomous QA agent for Datadog Test Optimization. |
|
/merge |
|
View all feedbacks in Devflow UI.
This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
The expected merge time in
|
2e14100
into
main
### What does this PR do? Moves known-tests pagination metadata into the JSON API attributes payload for both requests and responses. The known-tests client now sends `data.attributes.page_info` on the initial request and uses `data.attributes.page_info.page_state` for follow-up requests. It also reads `cursor` and `has_next` from `data.attributes.page_info` in backend responses, so it continues paginating after page 1. The regression test now asserts that `page_info` is not emitted at the top level, verifies the attributes-level request shape, and exercises cursor-based follow-up requests without sending a page size. ### Motivation DataDog/shepherd#46 Go was modeling `page_info` as a sibling of `data`, while the known-tests API contract used by the backend and other tracers places pagination under `data.attributes`. With a contract-correct backend response, Go could parse the first page of tests but missed `has_next` and stopped without requesting subsequent pages. ### Testing - [x] `go test ./internal/civisibility/utils/net` - [x] `go test ./internal/civisibility/...` - [x] `git diff --check -- internal/civisibility/utils/net/known_tests_api.go internal/civisibility/utils/net/known_tests_api_test.go` Co-authored-by: tonyredondo <[email protected]>
### What does this PR do? Moves known-tests pagination metadata into the JSON API attributes payload for both requests and responses. The known-tests client now sends `data.attributes.page_info` on the initial request and uses `data.attributes.page_info.page_state` for follow-up requests. It also reads `cursor` and `has_next` from `data.attributes.page_info` in backend responses, so it continues paginating after page 1. The regression test now asserts that `page_info` is not emitted at the top level, verifies the attributes-level request shape, and exercises cursor-based follow-up requests without sending a page size. ### Motivation DataDog/shepherd#46 Go was modeling `page_info` as a sibling of `data`, while the known-tests API contract used by the backend and other tracers places pagination under `data.attributes`. With a contract-correct backend response, Go could parse the first page of tests but missed `has_next` and stopped without requesting subsequent pages. ### Testing - [x] `go test ./internal/civisibility/utils/net` - [x] `go test ./internal/civisibility/...` - [x] `git diff --check -- internal/civisibility/utils/net/known_tests_api.go internal/civisibility/utils/net/known_tests_api_test.go` Co-authored-by: tonyredondo <[email protected]>
What does this PR do?
Moves known-tests pagination metadata into the JSON API attributes payload for both requests and responses.
The known-tests client now sends
data.attributes.page_infoon the initial request and usesdata.attributes.page_info.page_statefor follow-up requests. It also readscursorandhas_nextfromdata.attributes.page_infoin backend responses, so it continues paginating after page 1.The regression test now asserts that
page_infois not emitted at the top level, verifies the attributes-level request shape, and exercises cursor-based follow-up requests without sending a page size.Motivation
https://github.com/DataDog/shepherd/issues/46
Go was modeling
page_infoas a sibling ofdata, while the known-tests API contract used by the backend and other tracers places pagination underdata.attributes. With a contract-correct backend response, Go could parse the first page of tests but missedhas_nextand stopped without requesting subsequent pages.Testing
go test ./internal/civisibility/utils/netgo test ./internal/civisibility/...git diff --check -- internal/civisibility/utils/net/known_tests_api.go internal/civisibility/utils/net/known_tests_api_test.go