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

[ATO-1315] Flows yaml schema #12901

Merged
merged 30 commits into from
Oct 16, 2023
Merged

[ATO-1315] Flows yaml schema #12901

merged 30 commits into from
Oct 16, 2023

Conversation

Urkem
Copy link
Contributor

@Urkem Urkem commented Oct 6, 2023

Proposed changes:

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)

@Urkem Urkem requested a review from ancalita October 6, 2023 14:50
@Urkem Urkem marked this pull request as ready for review October 9, 2023 13:50
@Urkem Urkem requested a review from a team as a code owner October 9, 2023 13:50
@Urkem Urkem requested review from a team and twerkmeister and removed request for a team October 9, 2023 13:52
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.

Looks great 💯 I'd advise to open a companion PR in financial llm demo bot pinning rasa to this branch to test your PR 🙏🏻

rasa/shared/utils/validation.py Outdated Show resolved Hide resolved
rasa/shared/core/flows/flows_yaml_schema.json Outdated Show resolved Hide resolved
@Urkem
Copy link
Contributor Author

Urkem commented Oct 10, 2023

@ancalita The validation itself seems to fail on financial llm demo bot... (the flows got loaded. Still not sure if the flow name is a required field for a flow)
Screenshot 2023-10-10 at 13 26 59

The training works if I do skip validation (this does not skip checking the schema):
Screenshot 2023-10-10 at 13 24 54

@ancalita
Copy link
Member

The validation itself seems to fail on financial llm demo bot

I think that's because pattern_code_change is missing a name, I think this should be part of the schema and should be mandatory, in which case schema validation should fail.

@Urkem Urkem requested a review from ancalita October 10, 2023 13:09
@Urkem
Copy link
Contributor Author

Urkem commented Oct 10, 2023

I think that's because pattern_code_change is missing a name, I think this should be part of the schema and should be mandatory, in which case schema validation should fail.

Added name as required and pattern_code_change is a part of OSS so I updated it accordingly.

Copy link
Contributor

@twerkmeister twerkmeister left a comment

Choose a reason for hiding this comment

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

Overall looks good to me. Good job on the json schema!

One remaining question regarding flow names being required... In my recent PR I added a default for the name attribute of flow that basically converts the id and removes the underscores from it to form a name if none is present. In the names you added this is exactly the same pattern. I find it quite redundant to always duplicate the id in the name. I think we can go with the name = id (with underscores replaced) default and then people can adjust the name if they still want to.

@Urkem Urkem force-pushed the ATO-1315-improve-yaml-validation branch from 8ef2870 to 47c596c Compare October 12, 2023 11:33
tests/test_validator.py Outdated Show resolved Hide resolved
@Urkem Urkem requested a review from twerkmeister October 12, 2023 13:28
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.

Awesome 🙌🏻 I left a few questions, I'd add some more tests to check for each step type and potential values given to each step's different properties (valid and invalid values). Also I'd add another test for testing whether random keys can be added to a flow or flow steps.

rasa/shared/core/flows/flows_yaml_schema.json Outdated Show resolved Hide resolved
rasa/shared/core/flows/flows_yaml_schema.json Show resolved Hide resolved
rasa/shared/core/flows/flows_yaml_schema.json Outdated Show resolved Hide resolved
@Urkem Urkem requested a review from ancalita October 12, 2023 18:14
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.

LGTM 💯 Approving to unblock you, but on condition that the passing e2e tests for demo bot are all good 😄 I also left 2 questions for clarification.

},
{
"required": [
"intent"
Copy link
Member

Choose a reason for hiding this comment

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

Just double-checking if this is still in use yet, or if it's been discarded, i thought we removed the need for steps of type user message, unless this is something different and related to coexistence?

Copy link
Contributor Author

@Urkem Urkem Oct 13, 2023

Choose a reason for hiding this comment

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

Added because of the flow spec specifically 3. Flow Rules 3rd point it's not used anywhere (that I found) same with nlu_trigger maybe they are used for same thing...

Copy link
Member

Choose a reason for hiding this comment

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

Ok, yeah I was also under the impression that we don't use the intent step any longer, but nlu_trigger might be useful in coexistence. Best to check with Daksh/Engine on Slack if this part of the schema is correct.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes we use nlu_trigger now. Although that property hasn't been implemented yet. @twerkmeister would know the implementation details of this.

Copy link
Contributor Author

@Urkem Urkem Oct 13, 2023

Choose a reason for hiding this comment

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

Thanks for the clarification @dakshvar22 removed the intent step from the schema, the nlu_trigger is already part of the schema here (structure is the same as in the flows spec)

rasa/shared/core/flows/flows_yaml_schema.json Show resolved Hide resolved
@Urkem
Copy link
Contributor Author

Urkem commented Oct 13, 2023

@twerkmeister @ancalita running the e2e tests on the demo bot (with the default flow change and without the change) is 50pass 18fail always is that the expected ratio or do all tests pass?

Screenshot 2023-10-13 at 14 42 50

Rasa Version      :         3.8.0a11
Minimum Compatible Version: 3.5.0
Rasa SDK Version  :         3.8.0a1
Python Version    :         3.10.10
Operating System  :         macOS-13.6-arm64-arm-64bit
Python Path       :         /Users/urosmilovanovic/.pyenv/versions/3.10.10/envs/dm2-1-demo/bin/python
Rasa Plus Version  :         3.8.0a11

@github-actions
Copy link
Contributor

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

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug C 5 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 49 Code Smells

0.0% 0.0% Coverage
0.9% 0.9% Duplication

warning The version of Java (11.0.20) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

@Urkem Urkem merged commit 463c703 into dm2 Oct 16, 2023
97 checks passed
@Urkem Urkem deleted the ATO-1315-improve-yaml-validation branch October 16, 2023 07:45
@ancalita
Copy link
Member

@twerkmeister @ancalita running the e2e tests on the demo bot (with the default flow change and without the change) is 50pass 18fail always is that the expected ratio or do all tests pass?

Hey @Urkem Apologies, I missed this message on Friday, if the same tests fail without the schema change, I'd advise to open a ticket with the details about failing tests and alert Dan about it, should be investigated what change caused those tests to fail since the tests labelled as passing always passed (68 out of 68).

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.

4 participants