-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Validate Conversation ID #7238
Validate Conversation ID #7238
Conversation
Co-authored-by: Alexandre Miguel <[email protected]>
Co-authored-by: Rômulo Souza <[email protected]>
Co-authored-by: Alexandre Miguel <[email protected]>
Thanks for submitting a pull request 🚀 @JustinaPetr will take a look at it as soon as possible ✨ |
@JustinaPetr I assigned myself as @aleronupe were already taking here about it @aleronupe Will give it a review later today or tomorrow 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR and sorry for the late review! I really appreciate your initiative and contribution 💪
Can we please also add unit tests for the new changes?
Let me know if I can help somehow!
@@ -776,6 +797,7 @@ async def trigger_intent(request: Request, conversation_id: Text) -> HTTPRespons | |||
@app.post("/conversations/<conversation_id:path>/predict") | |||
@requires_auth(app, auth_token) | |||
@ensure_loaded_agent(app) | |||
@ensure_conversation_exists(app) | |||
async def predict(request: Request, conversation_id: Text) -> HTTPResponse: | |||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of the scope of your PR / optional: We should actually use the lockstore
here as processor.predict_next
persists the updated tracker.
…S/rasa into validate_conversation_id
Co-authored-by: Rômulo Souza <[email protected]>
Co-authored-by: Alexandre Miguel <[email protected]>
Co-authored-by: Rômulo Souza <[email protected]>
Hello @wochinge, we've just made the required changes and added the unit tests for the new functionalities. Would you please take a look at it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Added a few more comments, but nothing critical 👍🏻
tests/test_server.py
Outdated
async def test_predict_without_conversation_id(rasa_app: SanicASGITestClient): | ||
_, response = await rasa_app.post("/conversations/non_existent_id/predict") | ||
|
||
assert response.status == 404 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert response.status == 404 | |
assert response.status == HTTPStatus.NOT_FOUND |
tests/test_server.py
Outdated
"/conversations/non_existent_id/execute", json=data | ||
) | ||
|
||
assert response.status == 404 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert response.status == 404 | |
assert response.status == HTTPStatus.NOT_FOUND |
tests/test_server.py
Outdated
|
||
_, response = await rasa_app.get(url) | ||
|
||
assert response.status == 404 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert response.status == 404 | |
assert response.status == HTTPStatus.NOT_FOUND |
Co-authored-by: Alexandre Miguel <[email protected]>
Co-authored-by: Alexandre Miguel <[email protected]>
529aeb5
to
4618354
Compare
Hi @wochinge, we've made the required changes. Can you please take a look? |
@aleronupe Can we wrap this up? Happy to help 🙌🏻 |
Co-authored-by: Alexandre Miguel <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯 thanks a lot @aleronupe
Re the failing windows tests: Windows testing is a bit flakey atm. Re-running the tests should hep 🤞🏻 |
Co-authored-by: Rômulo Souza <[email protected]>
@wochinge we've fixed the URL error but windows tests keep failing on a different section of the code. Is there any other change we should make to fix this? |
Can you please merge the latest |
@wochinge we’ve updated The branch and now all the testes are passing |
@aleronupe It's out of date again. Can you somehow make it that I can push to your repo as well? Then i can update the branch as well for you. |
@wochinge Our repo is on an organization from our university, so I think it won’t be possible, but we’ve just updated the branch |
Merged 🎉 Thanks for your patience! |
Proposed changes:
Status (please check what you already did):
black
(please check Readme for instructions)