Fix: default interval on AnalyticsTrendsParameter to satisfy live API - #631
Merged
Merged
Conversation
GET /v1/analytics/trends/tests rejects requests with a 422 when `interval` is omitted, even though the docs list it as optional with a default of 1d. Default it client-side to match the documented behavior, the same way TestResultParameter.Builder already defaults `size`. Verified against the live API (both start/end and time_range paths); this was breaking the getTestTrendsTest integration test in CI on every PR since #629 merged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
9 tasks
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
diemol
enabled auto-merge (squash)
September 16, 2026 14:39
diemol
disabled auto-merge
September 16, 2026 14:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
GET /v1/analytics/trends/tests(InsightsEndpoint.getTestTrends,AnalyticsTrendsParameter) rejects requests with422 Unprocessable Entitywhenintervalisn't set:{"detail":[{"type":"missing","loc":["query","interval"],"msg":"Field required","input":null}]}...despite the Insights API docs listing
intervalas optional with a default of1d. This PR defaults it client-side inAnalyticsTrendsParameter.Builder.build()when not explicitly set, the same wayTestResultParameter.Builder.build()already defaultssizeto10.Motivation and Context
This is currently failing CI's live "Integration Tests" job on every PR (introduced in #629, the Insights API PR):
InsightsEndpointTest.getTestTrendsTestfails on bothUS_WESTandEU_CENTRALwith the 422 above. I found it while checking CI status on an unrelated PR (#630) and confirmed the root cause and the fix against the live API withcurl.How Has This Been Tested?
https://api.us-west-1.saucelabs.com/v1/analytics/trends/testswithcurl, using real credentials, both with and withoutinterval— confirmed addinginterval=1dresolves it.mvn test -Dtest=AnalyticsTrendsParameterTest— added a regression test (testToMapDefaultsIntervalWhenNotSet) plus the existing tests, all pass.mvn test -Dtest=InsightsEndpointTest#getTestTrendsTest— the live integration test that was failing now passes against bothUS_WESTandEU_CENTRAL.mvn test -Dtest=com.saucelabs.saucerest.unit.**— full unit suite passes.Types of changes
Screenshots (if appropriate):
N/A
Checklist
Further comments
Filed as its own small PR rather than folding it into #630, since it's an unrelated pre-existing bug on
mainrather than part of the Performance API work.🤖 Generated with Claude Code