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

Schema cleanup and validation #3758

Merged
merged 21 commits into from
Apr 20, 2020
Merged

Schema cleanup and validation #3758

merged 21 commits into from
Apr 20, 2020

Conversation

tomlm
Copy link
Contributor

@tomlm tomlm commented Apr 17, 2020

  • moved dialogManager into dialogs assembly
  • cleanup input schema and comments
  • Add unit tests for validating dialogs/schema (!!!)
  • fix a bunch of schema errors
  • fix a bunch of dialog errors
  • move compnent schema to using botframework-sdk/component.schema
  • get rid of sdk.schema, schema comes from SDK assemblies not from sdk.schema
  • create tests.schema which is active schema for unit tests
  • create testbot.schema which is active schema for testbot

Tom Laird-McConnell added 6 commits April 10, 2020 12:38
renamed Ask.ExpectedOperation to Ask.DefaultOperation
* fix a bunch of schema errors
* fix a bunch of dialog errors
* move compnent schema to using botframework-sdk/component.schema
* get rid of sdk.schema, schema comes from SDK assemblies not from sdk.schema
* create tests.schema which is active schema for unit tests
* create testbot.schema which is active schema for testbot
@tomlm tomlm changed the title Tomlm/misc cleanup Schema cleanup and validation Apr 17, 2020
@tomlm tomlm linked an issue Apr 17, 2020 that may be closed by this pull request
7 tasks
@@ -26,7 +26,7 @@ public static void ClassInitialize(TestContext context)
{
ResourceExplorer = new ResourceExplorer()
Copy link
Member

@johnataylor johnataylor Apr 17, 2020

Choose a reason for hiding this comment

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

did you intend to remove this file? #Closed

// string output = process.StandardOutput.ReadToEnd();

var process = Process.Start(startInfo);
string error = process.StandardError.ReadToEnd();
Copy link
Member

Choose a reason for hiding this comment

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

var

[DynamicData(nameof(Dialogs))]
public async Task TestDialogResourcesAreValidForSchema(IResource resource)
{
FileResource fileResource = resource as FileResource;
Copy link
Member

Choose a reason for hiding this comment

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

var


public override Task<DialogTurnResult> BeginDialogAsync(DialogContext dc, object options = null, CancellationToken cancellationToken = default(CancellationToken))
{
var (arg1, err1) = Expression.Parse(Arg1).TryEvaluate(dc.State);
var (arg2, err2) = Expression.Parse(Arg2).TryEvaluate(dc.State);
var arg1 = Arg1.GetValue(dc.State);
Copy link
Member

Choose a reason for hiding this comment

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

whitespace picked up by tool

* boolProperty => false
* numberProperty = 0
* integerProperty =0
Ordered so default form is first OneOf() array
* BoolProperty => default is bool
* NumberProperty => default is number
* Condition => default is string with pattern
* StringExpression => default is string
etc.
* add checks for $schema exists and is correct.
* fix up all $schema files.
@chrimc62
Copy link
Contributor

Two major things:

  1. I don't think your regex patterns are right?
  2. I'm confused whether we need id and $id. Should I change $id to id and remove them globally?

Copy link
Contributor

@chrimc62 chrimc62 left a comment

Choose a reason for hiding this comment

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

🕐

@tomlm
Copy link
Contributor Author

tomlm commented Apr 19, 2020

    "id": {

resource.id vs dialog.id


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


Refers to: libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Schemas/Actions/Microsoft.BeginDialog.schema:8 in c276987. [](commit_id = c276987, deletion_comment = False)

@tomlm tomlm requested a review from chrimc62 April 19, 2020 21:13
Copy link
Contributor

@chrimc62 chrimc62 left a comment

Choose a reason for hiding this comment

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

:shipit:

@cleemullins
Copy link
Contributor

I suggest we close this PR and break it into smaller PRs that are possible to review. The size of this PR, and the mixture of work, makes it really hard to tell what this is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants