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

Add support for remote post serve action #1123

Conversation

kapishmalik
Copy link
Collaborator

@kapishmalik kapishmalik commented Apr 3, 2024

Incorporated following changes:

  • Added support for remote post serve action
  • Unit Tests
  • Integration Tests
  • Documentation

@kapishmalik kapishmalik requested a review from tommysitu April 3, 2024 19:25
@kapishmalik kapishmalik self-assigned this Apr 3, 2024
Copy link
Member

@tommysitu tommysitu left a comment

Choose a reason for hiding this comment

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

Looks great 👍, only one comment.

Also could we include the following in the next PR please?

  • Log a message saying a (local/remote) post-serve-action is set, I think we have done the same for middleware.
  • Update the Journal entry to indicate the request has triggered a callback, for example:
"response": {
        "status": 200,
        "body": "Hello World",
        "encodedBody": false,
        "headers": {
          "Content-Length": [
            "11"
          ]
        }
      },
"postServeAction": {
        "name": "outbound-http",
        "invoked": "2024-04-07T10:51:25.428+08:00",
        "completed": "2024-04-07T10:51:26.428+08:00",
        "correlationId": "1ce7ea0c-7b0d-4cc5-9f7c-4a406b0e3c48",
        "httpStatus": 200
 },

We need to include correlationId and httpStatus code for remote action only:
correlationId - a randomly generated UUID passed as X-CORRELATION-ID header to the remote action endpoint, user can use it for e2e tracing.
httpStatus - the response status code from the remote action endpoint.

Thanks!

core/action/action.go Outdated Show resolved Hide resolved
@kapishmalik kapishmalik requested a review from tommysitu April 7, 2024 06:11
@kapishmalik kapishmalik merged commit eb31e77 into SpectoLabs:master Apr 7, 2024
3 checks passed
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.

2 participants