-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat: Add path and query params to test-results endpoint #93264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #93264 +/- ##
===========================================
+ Coverage 46.19% 87.98% +41.78%
===========================================
Files 10245 10267 +22
Lines 591310 592188 +878
Branches 23011 23011
===========================================
+ Hits 273157 521019 +247862
+ Misses 317663 70679 -246984
Partials 490 490 |
|
||
variables = { | ||
"owner": owner, | ||
"repo": repository, | ||
"filters": { | ||
"branch": branch, | ||
"branch": request.query_params.get("branch", "main"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would this work w/ master
? I suppose main
captures more than master
these days
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could just pass in a branch name for master, eventually the frontend will be the SOT, we're just defaulting main here so the user doesn't need to pass a branch for most cases
|
||
variables = { | ||
"owner": owner, | ||
"repo": repository, | ||
"filters": { | ||
"branch": branch, | ||
"branch": request.query_params.get("branch", "main"), | ||
"parameter": request.query_params.get("sortBy"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this support every column value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I've seen other tables use sort
instead of sortBy
, thoughts on changing this? We can also adjust in the frontend, but seems consistent to use sort
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it should!
src/sentry/apidocs/parameters.py
Outdated
""", | ||
) | ||
TEST_RESULTS_ORDER_BY = OpenApiParameter( | ||
name="orderBy", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tables I've worked with do sort=-<columnName> (or whatever we choose)
. Just double checking if this is the behaviour you'd expect here, since we don't explicitly seem to provide an orderBy param, the backend seems to infer it from the sort
value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just updated, thanks for the catch
if not first and not last: | ||
first = 20 | ||
if first and last: | ||
return Response( | ||
status=status.HTTP_400_BAD_REQUEST, | ||
data={"details": "Cannot specify both `first` and `last`"}, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we switch these two if statements' ordering? Since the first one can modify first
's value, i think it's more clear the other way around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can do!
This commit adds support for the interval query parameter to the TestResultsAggregates endpoint. Adds a new test to verify the interval parameter is correctly passed to the Codecov client. Fixes an existing test that had an incorrect assertion for git_provider_org. Resolves a linter conflict by renaming the endpoint attribute to endpoint_name in the test class to avoid overriding a base class property. Depends on: #93264
This commit adds support for the interval query parameter to the TestResultsAggregates endpoint. Depends on: #93264
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm just one quick comment`
|
||
variables = { | ||
"owner": owner, | ||
"repo": repository, | ||
"filters": { | ||
"branch": branch, | ||
"branch": request.query_params.get("branch", "main"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, i would think that there's no fallback for branch unless we're just keeping this here for the time that this will be under development
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's right, just keeping it for development. We can remove as soon as query params are hooked up
This commit adds support for the interval query parameter to the TestResultsAggregates endpoint. Depends on: #93264
This PR aims to add and uptake a number of path and query parameters for the first codecov endpoint being called in sentry. First, we're adding both the path parameters: - Repository: string - Owner: string Second, we're adding a number of query paramters: - sortBy: string - filterBy: string - interval: string (date) - branch: string - first: int - last: int If neither first nor last are supplied, the default is 20 You'll notice that for the orderby parameter, sentry opts to use a "-" to denote descending rather than "DESC" like we did on the codecov side, so we had to accommodate for that. Otherwise it's fairly straightforward. This should also update the openAPI spec accordingly. <img width="665" alt="Screenshot 2025-06-10 at 3 17 23 PM" src="https://github.com/user-attachments/assets/5135883e-df48-4121-a07e-8cf2e9b650a0" /> <img width="690" alt="Screenshot 2025-06-10 at 3 19 06 PM" src="https://github.com/user-attachments/assets/e738413c-b70f-4303-804f-9eb50e6c008a" /> <!-- Sentry employees and contractors can delete or ignore the following. --> ### Legal Boilerplate Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
This PR aims to add and uptake a number of path and query parameters for the first codecov endpoint being called in sentry.
First, we're adding both the path parameters:
Second, we're adding a number of query paramters:
If neither first nor last are supplied, the default is 20
You'll notice that for the orderby parameter, sentry opts to use a "-" to denote descending rather than "DESC" like we did on the codecov side, so we had to accommodate for that. Otherwise it's fairly straightforward.
This should also update the openAPI spec accordingly.
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.