Skip to content
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

Use CheckHTTP in Go SDK #1971

Merged
merged 10 commits into from
May 22, 2023
Merged

Use CheckHTTP in Go SDK #1971

merged 10 commits into from
May 22, 2023

Conversation

sbienkow-ninja
Copy link
Contributor

@sbienkow-ninja sbienkow-ninja commented May 17, 2023

Closes: #1650

Summary by OpenAI

New Feature:
- Added HTTP middleware for flow control in Aperture Go SDK
- Introduced new `middlewares` package and moved related functions
- Implemented `StartHTTPFlow` method in the `Client` interface

Bug fix:
- Added null check before closing response body in `checkhttp`

Documentation:
- Updated documentation for using HTTP middleware with Aperture Go SDK
- Provided examples for setting up middleware on an HTTP server

🎉 A middleware we've brought, to control the flow,
In Aperture Go SDK, it's now set to go.
With patterns and checks, our requests find their way,
Celebrate this PR, for a brighter day! 🌟

@github-actions
Copy link
Contributor

github-actions bot commented May 17, 2023

🤖 OpenAI

Here is the summary of changes:

The diff introduces a new package middlewares and moves existing middleware-related code to it. It adds an HTTP middleware using CheckHTTP from the Aperture library for flow control in the Go SDK. The changes also include updates to the Flow interface, addition of a new method StartHTTPFlow, and documentation on how to use the middleware with examples.

Files Summary
.pre-commit-config.yaml Updates Python version used by the black hook configuration.
api/Makefile, cmd/sdk-validator/main.go Adds a new directory checkhttp, copies files into it, and adds a null check before closing the response body.
sdks/aperture-go/sdk/middlewares/grpc.go, sdks/aperture-go/sdk/middlewares/http.go, ... Introduces a new package middlewares, moves existing middleware-related code to it, and adds new functions for gRPC and HTTP middlewares.
sdks/aperture-go/example/main.go, sdks/aperture-go/sdk/client.go, ... Adds a new method StartHTTPFlow, updates the Flow interface, and implements middleware for HTTP requests using CheckHTTP.
docs/content/get-started/integrations/flow-control/sdk/go/manual.md, ... Adds documentation for using HTTP middleware with the Aperture Go SDK, provides examples, updates the Dockerfile, and explains how to set middleware for an HTTP server with and without regexp patterns.

Chat with 🤖 OpenAI Bot (@openai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @openai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Ignoring further reviews

  • Type @openai: ignore anywhere in the PR description to ignore further reviews from the bot.

Files ignored due to filter (8)

Ignored files

  • sdks/aperture-go/gen/proto/flowcontrol/checkhttp/v1/checkhttp.pb.go
  • sdks/aperture-go/gen/proto/flowcontrol/checkhttp/v1/checkhttp.pb.gw.go
  • sdks/aperture-go/gen/proto/flowcontrol/checkhttp/v1/checkhttp.pb.json.go
  • sdks/aperture-go/gen/proto/flowcontrol/checkhttp/v1/checkhttp.pb.validate.go
  • sdks/aperture-go/gen/proto/flowcontrol/checkhttp/v1/checkhttp_deepcopy.gen.go
  • sdks/aperture-go/gen/proto/flowcontrol/checkhttp/v1/checkhttp_grpc.pb.go
  • sdks/aperture-go/go.mod
  • sdks/aperture-go/go.sum

In the recent run, only the files that changed from the base of the PR and between 56d3a8639c7b2fb557460e8d8cb31c2a601af954 and c571c22717da8741b9c68a7f0e241e82b54fa330 commits were reviewed.

Files not reviewed due to simple changes (6)

Skipped review in the recent run

  • .pre-commit-config.yaml
  • cmd/sdk-validator/main.go
  • docs/content/get-started/integrations/flow-control/sdk/go/manual.md
  • sdks/aperture-go/Dockerfile
  • sdks/aperture-go/sdk/flowstatus.go
  • sdks/aperture-go/sdk/middlewares/utils.go

@sbienkow-ninja sbienkow-ninja changed the title checkhttp Use CheckHTTP in Go SDK May 18, 2023
@sbienkow-ninja sbienkow-ninja marked this pull request as ready for review May 18, 2023 09:13
@sbienkow-ninja sbienkow-ninja requested review from a team as code owners May 18, 2023 09:13
Copy link
Contributor

@hdkshingala hdkshingala left a comment

Choose a reason for hiding this comment

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

As discussed with @IridiumOxide for Java SDK, we should also add an example for use of CheckHTTP and have helper method for CheckHTTPRequest generation. Ref - https://fluxninja.slack.com/archives/C043WKQ6212/p1684498268031049

But this can go in a separate PR later.

@sbienkow-ninja sbienkow-ninja enabled auto-merge (squash) May 22, 2023 10:35
@sbienkow-ninja sbienkow-ninja merged commit c0b861d into main May 22, 2023
@sbienkow-ninja sbienkow-ninja deleted the checkhttp branch May 22, 2023 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use aperture.flowcontrol.checkhttp.v1 in Aperture Go SDK middlewares
2 participants