Closed coury-clark closed 1 month ago
[!WARNING]
Rate limit exceeded
@coury-clark has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 6 seconds before requesting another review.
How to resolve this issue?
After the wait time has elapsed, a review can be triggered using the `@coderabbitai review` command as a PR comment. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit.How do rate limits work?
CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our [FAQ](https://coderabbit.ai/docs/faq) for further information.Commits
Files that changed from the base of the PR and between da24dacc085ae5188f67114a6345dd85d65db609 and 577406f9cef6dc4d9d3978ee9263a787ac30aa87.
The recent changes introduce context handling in the humatest/humatest.go
API methods by adding context parameters. This update includes new methods suffixed with Ctx
that accept a context.Context
parameter. Additionally, the tutorial documentation is updated to demonstrate using custom contexts in Go tests, particularly for scenarios like testing authenticated routes.
Files | Change Summary |
---|---|
humatest/humatest.go | Introduced context handling in API methods by adding context parameters and creating new methods suffixed with Ctx . |
docs/docs/tutorial/writing-tests.md | Added a new section demonstrating sending requests with a custom context.Context in Go tests for specific request scenarios. |
In the land where code does flow,
Context joins the API show.
WithCtx
in place, requests align,
Authenticated routes now shine.
Tests with context, clear and bright,
Guide our journeys, day and night.
🐰✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
LGTM 👍
Attention: Patch coverage is 95.65217%
with 1 line
in your changes missing coverage. Please review.
Project coverage is 92.82%. Comparing base (
158b076
) to head (577406f
). Report is 2 commits behind head on main.
Files | Patch % | Lines |
---|---|---|
humatest/humatest.go | 95.65% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This PR extends the humatest.TestAPI interface to allow for a custom context.Context to be passed into the request. This is useful for applications where the context is used to store / propagate request specific values, such as authentication / authorization information. This is essentially porting a wrapper I had to write internally back into the mainline, it seems universally useful enough to me - let me know if you disagree!
This does introduce a breaking change in the TestAPI interface, which is difficult to avoid given the
humatest.New
function returns the interface. If that isn't acceptable, please let me know!Alternative naming options are similar to
http
package - ie. GetWithContext. Let me know if you'd prefer that style.Thanks for huma!
Summary by CodeRabbit
New Features
Ctx
methods forDo
,Get
,Post
,Put
,Patch
, andDelete
to accept acontext.Context
parameter.Documentation
context.Context
in Go tests for scenarios like testing authenticated routes.