Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Fix comparing luis applications bug in lu build - #672

Merged
Fei Chen (feich-ms) merged 6 commits into
masterfrom
feich/P0BugFix
Mar 20, 2020
Merged

Fei Chen (feich-ms) merged 6 commits into
masterfrom
feich/P0BugFix

Conversation

@feich-ms

@feich-ms Fei Chen (feich-ms) commented Mar 16, 2020 •

Copy link
Copy Markdown
Contributor

fix a bug in lu build when comparing apps to decide update app or not. The bug is caused due to the returning application structure of luis exportApplication api changes in version 3.0-preview that I switched recently. The reason why unit tests cannot hit this case is that the returning json from luis portal doesn't change in new API version but the object from luis api changed, so it's hard to detect it by unit tests. Hope this can catch R8 release, otherwise lu build may hit issues when users run lu build for lu files which don't have changes(That's saying lu build will always update luis application to a new version even though the lu files don't change actually). Vishwasena, Emilio Munoz (@munozemilio) could you help?

@feich-ms Fei Chen (feich-ms) added the P0 Must Fix. Release-blocker label Mar 16, 2020
@feich-ms Fei Chen (feich-ms) changed the title Fix P0 bug of lu build Fix P0 bug of lu build when comparing luis applications Mar 16, 2020
@vishwacsena

Copy link
Copy Markdown
Contributor

Not a P0 since the real impact is reimport of application version when there are no changes TO LU file.

Can you please add tests?

@feich-ms

Copy link
Copy Markdown
Contributor Author

OK. It's hard to add unit tests since the structure of returning application from luis api often changes. I think the best way to solve this issue is removing emtpy properties from both lu converted app and api got app since it's not easy to always keep our luis application definition to align with the one from luis API. I will try to fix in this way and add unit tests

@feich-ms Fei Chen (feich-ms) added lu non luis api commands R9 Release 9 - May 15th, 2020 and removed P0 Must Fix. Release-blocker labels Mar 16, 2020
@feich-ms Fei Chen (feich-ms) changed the title Fix P0 bug of lu build when comparing luis applications Fix bug of lu build when comparing luis applications Mar 16, 2020
@vishwacsena

Copy link
Copy Markdown
Contributor

Could you try this rather than lubuild having to maintain this logic?

  1. User input LU - > parse to JSON - > To LU
  2. Exported JSON - > To LU

compare 1 and 2 after you convert both to lower case.?

Might be lesser code in your side. We need to keep #1 and #2 up to date with LUIS APIs in BF-LU any ways.

@feich-ms

Copy link
Copy Markdown
Contributor Author

Good suggestion. Will have a try.

@feich-ms

Fei Chen (feich-ms) commented Mar 17, 2020 •

Copy link
Copy Markdown
Contributor Author

Vishwac Sena Kannan (@vishwacsena) Emilio Munoz (@munozemilio) , I spent much time today on this bug, but made little progress. The json returned from luis api has many unexpected properties or behaviors. e.g. 1. It's phraselists corresponds to model_features in our lu format and it added enabledForAllModels: true automatically in phraselists. 2. It automatically adds useFeaure definition below each intent if there is a phrase list definton in the lu file even though I didn't define anything below those intents. These corner cases make the convertion of luis api json to lu content not align with the one converted from our input. The lu file I'm testing is https://github.com/microsoft/botframework-cli/blob/e6268203df8049db0954c7b3d066e31d9def6dc9/packages/luis/test/fixtures/testcases/lubuild/case-insensitive/lufiles/case-insensitive.lu. Do you have more suggestions?

@vishwacsena

Copy link
Copy Markdown
Contributor

Fei Chen (@feich-ms), we should just fix lu parser so it sets the same defaults on LU to JSON. Can you list the specific things that are set by LUIS automatically as a separate ticket? Let's fix that so you can just compare LU and stay agnostic to the actual JSON representation.

@feich-ms

Fei Chen (feich-ms) commented Mar 18, 2020 •

Copy link
Copy Markdown
Contributor Author

Vishwac Sena Kannan (@vishwacsena), I created a issue here #675 to track the schema disalignments or unexpected behaviors between BF-LU and Luis API. For this bug, I adjusted the schemas and skipped unexpected behaviors when comparing lu content. It can work well now. I also adjusted the test cases in lu build to catch this logic. But the comparison functionality is still weak if we don't align the schemas and behaviors between BF-LU and LUIS API. May be we can let this fix go first and dive deep for the issue above. How to do you think?

@feich-ms Fei Chen (feich-ms) changed the title Fix bug of lu build when comparing luis applications Fix comparing luis applications bug in lu build Mar 18, 2020
@feich-ms
Fei Chen (feich-ms) merged commit 7eb2099 into master Mar 20, 2020
@feich-ms
Fei Chen (feich-ms) deleted the feich/P0BugFix branch March 20, 2020 02:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lu non luis api commands R9 Release 9 - May 15th, 2020

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants