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

Conversation

@stevkan
Copy link
Contributor

@stevkan stevkan commented Mar 28, 2019

Updates the luisApplication.cs file to set a default endpoint of 'https://westus.api.cognitive.microsoft.com' when no endpoint is supplied.

@stevkan stevkan requested a review from munozemilio March 28, 2019 21:59
@stevkan
Copy link
Contributor Author

stevkan commented Mar 28, 2019

Fix for issue #1387

@cleemullins
Copy link
Contributor

We had a test for this exact behavior, and that test is now failing:
Starting test execution, please wait...
Failed LuisApplication_Construction
Error Message:
Assert.ThrowsException failed. No exception thrown. ArgumentException exception was expected.
Stack Trace:
at Microsoft.Bot.Builder.AI.Luis.Tests.LuisApplicationTests.LuisApplication_Construction() in D:\a\1\s\tests\Microsoft.Bot.Builder.AI.LUIS.Tests\LuisApplicationTests.cs:line 28

Copy link
Contributor

@cleemullins cleemullins left a comment

Choose a reason for hiding this comment

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

Code change - need a test.

Please update the existing test for the new condition.

if (string.IsNullOrWhiteSpace(endpoint))
{
throw new ArgumentException($"\"{endpoint}\" is not a valid LUIS endpoint.");
endpoint = "https://westus.api.cognitive.microsoft.com";
Copy link
Contributor

Choose a reason for hiding this comment

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

To achieve parity with JS I think the endpoint validation should be removed from this file, and the endpoint should be assigned if null or empty in the LuisRecognizer construction. Let me know your thoughts.

Thanks

Copy link
Contributor

@daveta daveta Apr 1, 2019

Choose a reason for hiding this comment

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

Yeah, agree with Emilio - primarily because it's a get/set on the endpoint, and someone could sneak around the validation for fun, after initial creation..
May want to take a look at the other properties as well..


In reply to: 270952889 [](ancestors = 270952889)

Copy link
Contributor

@munozemilio munozemilio left a comment

Choose a reason for hiding this comment

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

Comments in line.

Thanks

@stevkan
Copy link
Contributor Author

stevkan commented Apr 8, 2019

Completed via PR #1626.

@stevkan stevkan closed this Apr 8, 2019
@cleemullins cleemullins deleted the v-stkanb/luis-default-endpoint-fix branch September 12, 2019 22:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants