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 warning message if domain yml file is not valid #8926

Merged
merged 12 commits into from
Jul 8, 2021

Conversation

raoulvm
Copy link
Contributor

@raoulvm raoulvm commented Jun 21, 2021

yaml syntax

Issue a logging warning if a domain file is invalid YAML syntax.

We at Deutsche Telekom encountered the issue that somebody put an invalid yaml file in our domain folder. The errors we got were just about missing intents in the domain. We expected to get some warning about the file being ignored due to invalid yaml though.

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)

@raoulvm raoulvm requested a review from a team as a code owner June 21, 2021 15:19
@CLAassistant
Copy link

CLAassistant commented Jun 21, 2021

CLA assistant check
All committers have signed the CLA.

@sara-tagger sara-tagger requested a review from samsucik June 22, 2021 06:00
@sara-tagger
Copy link
Collaborator

Thanks for submitting a pull request 🚀 @samsucik will take a look at it as soon as possible ✨

@samsucik samsucik removed their request for review June 22, 2021 16:48
@TyDunn TyDunn requested a review from ancalita July 5, 2021 09:38
@ancalita ancalita removed the request for review from a team July 6, 2021 16:00
Copy link
Member

@ancalita ancalita left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution 🚀
Could you please share more details on how to replicate the issue - what was the invalid yaml syntax and what command did you run?

Please address the following items:

  • swap to utility function raise_warning as in the comment
  • add a test in tests/shared/core/test_domain.py to replicate the issue and check that the correct warning is raised
  • add a changelog entry (the type should be improvement)

Let me know if you have any q's for me 👍

@raoulvm
Copy link
Contributor Author

raoulvm commented Jul 7, 2021

pytest added to tests/shared/core/test_domain.py

If there is anything missing, please ping me, @ancalita and @erohmensing

@raoulvm
Copy link
Contributor Author

raoulvm commented Jul 7, 2021

ok, I am lost.
The pipeline says

poetry run black --check rasa tests
would reformat /home/runner/work/rasa/rasa/rasa/shared/core/domain.py
would reformat /home/runner/work/rasa/rasa/tests/shared/core/test_domain.py
Oh no! 💥 💔 💥
2 files would be reformatted, 463 files would be left unchanged.

my black says

(rasa) A1146056@T000a53137 rasa % black --check rasa/shared/core/domain.py 
All done! ✨ 🍰 ✨
1 file would be left unchanged.
(rasa) A1146056@T000a53137 rasa % black --check tests/shared/core/test_domain.py 
All done! ✨ 🍰 ✨
1 file would be left unchanged.

however, it suggests to change 79 other files on my pc.
Any specific black settings I should know of?

@raoulvm
Copy link
Contributor Author

raoulvm commented Jul 8, 2021

@ancalita maybe the black version is different? I installed "latest" which was at that time

black, version 21.6b0

What is your pipeline using?

@dakshvar22 dakshvar22 added this to the 2.8 Rasa Open Source milestone Jul 8, 2021
Copy link
Member

@ancalita ancalita left a comment

Choose a reason for hiding this comment

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

💯

@ancalita ancalita merged commit 001320a into RasaHQ:main Jul 8, 2021
@raoulvm raoulvm deleted the warn_domain_yml_invalid branch July 8, 2021 09:44
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.

5 participants