Skip to content

feat: Add query convenience function#92174

Merged
ajay-sentry merged 5 commits into
masterfrom
Ajay/query-convenience-fn
May 28, 2025
Merged

feat: Add query convenience function#92174
ajay-sentry merged 5 commits into
masterfrom
Ajay/query-convenience-fn

Conversation

@ajay-sentry

Copy link
Copy Markdown
Contributor

This PR adds a new function to the Codecovclient which will make it a lot easier to do graphql requests in other parts of the map. It basically just packages everything we need into a single function so all we need to do is pass in a query and the variables into a function everywhere else.

I hardcoded the URL and the token type because we only need to support Github for now.

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.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 23, 2025
@codecov

codecov Bot commented May 23, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #92174      +/-   ##
==========================================
- Coverage   87.91%   87.90%   -0.01%     
==========================================
  Files       10214    10175      -39     
  Lines      585330   584386     -944     
  Branches    22703    22574     -129     
==========================================
- Hits       514602   513733     -869     
+ Misses      70306    70208      -98     
- Partials      422      445      +23     

Comment thread src/sentry/codecov/client.py Outdated
}

return self.post(
"/graphql/sentry/gh",

@adrianviquez adrianviquez May 27, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Optional: would it make sense to have gh/token still variables (maybe even properties of the client?) and have those default to gh/github-token?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah I like that! I can make the change

@matt-codecov matt-codecov force-pushed the mhammerly/feat/codecov-client branch from 8c6d2be to 4c3f7a9 Compare May 27, 2025 23:50
Base automatically changed from mhammerly/feat/codecov-client to master May 28, 2025 15:25
@ajay-sentry ajay-sentry merged commit 9e94f73 into master May 28, 2025
61 checks passed
@ajay-sentry ajay-sentry deleted the Ajay/query-convenience-fn branch May 28, 2025 16:28
andrewshie-sentry pushed a commit that referenced this pull request Jun 2, 2025
This PR adds a new function to the Codecovclient which will make it a
lot easier to do graphql requests in other parts of the map. It
basically just packages everything we need into a single function so all
we need to do is pass in a query and the variables into a function
everywhere else.

I hardcoded the URL and the token type because we only need to support
Github for now.


<!--

  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.

---------

Co-authored-by: Matt Hammerly <matt.hammerly@sentry.io>
Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants