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

Refresh EndpointConfig request headers #12904

Merged
merged 7 commits into from
Oct 10, 2023

Conversation

ancalita
Copy link
Member

@ancalita ancalita commented Oct 9, 2023

Proposed changes:

  • Refresh headers used in requests (e.g. action server requests) made by EndpointConfig using its headers attribute.
  • This is particularly relevant when the tracing context is propagated from rasa-plus to the action server.

Status (please check what you already did):

  • added some tests for the functionality
  • updated the documentation
  • updated the changelog (please check changelog for instructions)
  • reformat files using black (please check Readme for instructions)

@ancalita ancalita changed the title Debug action endpoint headers Refresh EndpointConfig request headers Oct 9, 2023
@ancalita ancalita marked this pull request as ready for review October 9, 2023 15:07
@ancalita ancalita requested a review from a team as a code owner October 9, 2023 15:07
@ancalita ancalita requested review from vcidst and removed request for a team October 9, 2023 15:07
@github-actions
Copy link
Contributor

🚀 A preview of the docs have been deployed at the following URL: https://12904--rasahq-docs-rasa-v2.netlify.app/docs/rasa

@@ -149,6 +149,9 @@ async def request(
headers.update(kwargs["headers"])
Copy link
Contributor

Choose a reason for hiding this comment

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

Will the changes done to the headers here be "undone" by your changes?

Copy link
Contributor

Choose a reason for hiding this comment

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

There is a possibility that the similar keys get overwritten here. Do you have any ideas what can be done to minimise this risk, perhaps only add the tracing related header key?

Copy link
Member Author

Choose a reason for hiding this comment

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

It depends what could be in the self.headers, in the tracing scenarios it only contains the traceparent key-value pair. I've had a look at where this EndpointConfig.request() method is used in the codebase, and only in the rasa interactive code it is used in two places with headers keyword argument with value {"Accept": "application/json"} , let me know if you're interested and I can share the links.

Copy link
Member Author

Choose a reason for hiding this comment

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

only add the tracing related header key

yep sure, we can restrict to this only, however I think the risk is low for overwriting keys based on the code usage I could find of headers keyword argument (see reply above). Let me know before making the commit if I should go ahead?

Copy link
Contributor

Choose a reason for hiding this comment

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

If you've looked into it already then it's cool. I'm good with it

@ancalita ancalita merged commit f155c6c into 3.6.x Oct 10, 2023
99 checks passed
@ancalita ancalita deleted the debug-action-endpoint-headers-0910 branch October 10, 2023 12:20
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.

None yet

2 participants