Skip to content

feat!: Refactor request context#4151

Merged
gmlewis merged 7 commits intogoogle:masterfrom
stevehipwell:request-context-refactor
Apr 24, 2026
Merged

feat!: Refactor request context#4151
gmlewis merged 7 commits intogoogle:masterfrom
stevehipwell:request-context-refactor

Conversation

@stevehipwell
Copy link
Copy Markdown
Contributor

@stevehipwell stevehipwell commented Apr 14, 2026

BREAKING CHANGE: All internal calls now provide Context via the Request itself.

Closes #4127

This PR makes the following changes:

  • Switch to using http.NewRequestWithContext so we no longer need the withContext helper
  • Refactor all HTTP calls to use client.BareDo to get benefits such as rate limit support

Comment thread github/actions_artifacts.go Outdated
@gmlewis gmlewis added NeedsReview PR is awaiting a review before merging. Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). labels Apr 14, 2026
@stevehipwell stevehipwell marked this pull request as draft April 14, 2026 13:08
@stevehipwell
Copy link
Copy Markdown
Contributor Author

@gmlewis I'm going to completely rebase this PR as I need to split it into 3.

@stevehipwell
Copy link
Copy Markdown
Contributor Author

#4152 replaces the app engine removal part of this PR.

Signed-off-by: Steve Hipwell <steve.hipwell@gmail.com>
@stevehipwell stevehipwell force-pushed the request-context-refactor branch from 361db80 to 9785804 Compare April 21, 2026 10:17
@stevehipwell stevehipwell marked this pull request as ready for review April 21, 2026 10:18
@stevehipwell
Copy link
Copy Markdown
Contributor Author

@gmlewis I've rebased this PR and it should be ready for review now.

@stevehipwell
Copy link
Copy Markdown
Contributor Author

@gmlewis I had to update the extraneousnew linter now that client.Do only has 2 args, could you please pay particular attention to that change as I don't have the full context there.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

❌ Patch coverage is 99.86928% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.69%. Comparing base (0f881f5) to head (c28d689).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
test/fields/fields.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4151      +/-   ##
==========================================
+ Coverage   93.20%   93.69%   +0.49%     
==========================================
  Files         210      210              
  Lines       24622    19741    -4881     
==========================================
- Hits        22948    18497    -4451     
+ Misses       1478     1048     -430     
  Partials      196      196              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

In case a force-push is performed, I'm going to stop my review here before examining the remaining 182 files.

Comment thread github/github.go
Comment thread github/github.go
Comment thread github/github.go
Comment thread github/github.go
@stevehipwell
Copy link
Copy Markdown
Contributor Author

@gmlewis I won't force push this, I only force pushed to realign after we split the PR up and I did provide a warning that I was doing it. Could you possibly review the linter, the only real changes are there and in github.go.

@gmlewis
Copy link
Copy Markdown
Collaborator

gmlewis commented Apr 21, 2026

@gmlewis I won't force push this, I only force pushed to realign after we split the PR up and I did provide a warning that I was doing it. Could you possibly review the linter, the only real changes are there and in github.go.

OK, the linter LGTM.

@stevehipwell
Copy link
Copy Markdown
Contributor Author

@gmlewis I've made the requested docs changes.

Copy link
Copy Markdown
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

One question, otherwise LGTM.

cc: @alexandear - @zyfy29 - @Not-Dhananjay-Mishra - @munlicode

Comment thread github/github_test.go
Copy link
Copy Markdown
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@Not-Dhananjay-Mishra Not-Dhananjay-Mishra left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@stevehipwell
Copy link
Copy Markdown
Contributor Author

@gmlewis how do you want me to resolve the conflict?

@gmlewis
Copy link
Copy Markdown
Collaborator

gmlewis commented Apr 22, 2026

@stevehipwell - apologies, but could you please resolve conflicts before I merge?
Oh, and we need to hear from @alexandear too.

@stevehipwell
Copy link
Copy Markdown
Contributor Author

@gmlewis how do you want me to resolve the conflict?

@gmlewis I'd normally rebase to fix a conflict like this, but I know you don't like the commits to be modified.

@gmlewis
Copy link
Copy Markdown
Collaborator

gmlewis commented Apr 22, 2026

@gmlewis I'd normally rebase to fix a conflict like this, but I know you don't like the commits to be modified

  1. Go to your master branch and git pull
  2. Go to your branch and git merge master
  3. Manually resolve conflicts or git mergetool if you have already set up a tool like kdiff3
  4. git push ... to this PRs branch

@stevehipwell
Copy link
Copy Markdown
Contributor Author

@gmlewis merge commit it is, was just checking.

@gmlewis
Copy link
Copy Markdown
Collaborator

gmlewis commented Apr 22, 2026

Although if you have a better mechanism, I am fine with that in this huge PR.

@stevehipwell
Copy link
Copy Markdown
Contributor Author

@gmlewis assuming that you're squash merging and you'd rather the commits aren't modified, a merge commit is likely to be the best compromise.

@stevehipwell
Copy link
Copy Markdown
Contributor Author

@gmlewis it should be ready again.

@stevehipwell
Copy link
Copy Markdown
Contributor Author

@alexandear I think we're just waiting on you now?

@stevehipwell
Copy link
Copy Markdown
Contributor Author

@gmlewis I think we're ready to merge now.

Comment thread github/rate_limit.go
@stevehipwell
Copy link
Copy Markdown
Contributor Author

@alexandear I think this is waiting for your approval.

@gmlewis
Copy link
Copy Markdown
Collaborator

gmlewis commented Apr 24, 2026

@alexandear I think this is waiting for your approval.

Yes, please, since you made a request after your last approval. Thanks.

@alexandear
Copy link
Copy Markdown
Contributor

Already approved. LGTM.

@gmlewis gmlewis removed waiting for reply NeedsReview PR is awaiting a review before merging. labels Apr 24, 2026
@gmlewis gmlewis merged commit 9fbf4be into google:master Apr 24, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request context question

4 participants