Skip to content

Setting DefaultLocale's default value to "en-US"#1170

Merged
yao-msft merged 2 commits intomicrosoft:masterfrom
palenshus:patch-3
Jun 30, 2021
Merged

Setting DefaultLocale's default value to "en-US"#1170
yao-msft merged 2 commits intomicrosoft:masterfrom
palenshus:patch-3

Conversation

@palenshus
Copy link
Copy Markdown
Contributor

@palenshus palenshus commented Jun 15, 2021

Nice to have a default value, and enables our codegen'd object model to have a default value set for this property

Microsoft Reviewers: Open in CodeFlow

Nice to have a default value, and enables our codegen'd object model to have a default value set for this property
@palenshus palenshus requested a review from a team as a code owner June 15, 2021 04:52
@palenshus
Copy link
Copy Markdown
Contributor Author

@denelon, thoughts?

@denelon
Copy link
Copy Markdown
Collaborator

denelon commented Jun 15, 2021

I've seen one or two packages submitted with other defaultLocale values. I don't mind having a default as long as the user can change it if they wish.

@JohnMcPMS
Copy link
Copy Markdown
Member

Nice to have a default value, and enables our codegen'd object model to have a default value set for this property

I don't think we actually do want a default here; I would rather it be required to be provided rather than accidentally forgotten (and then potentially wrong).

@palenshus
Copy link
Copy Markdown
Contributor Author

I don't think we actually do want a default here; I would rather it be required to be provided rather than accidentally forgotten (and then potentially wrong).

Setting a default doesn't mean it's not required, validation will still fail if the property is missing altogether. This just gives a nice default value to codegen tools like ours

@JohnMcPMS
Copy link
Copy Markdown
Member

I don't think we actually do want a default here; I would rather it be required to be provided rather than accidentally forgotten (and then potentially wrong).

Setting a default doesn't mean it's not required, validation will still fail if the property is missing altogether. This just gives a nice default value to codegen tools like ours

Did you verify that validate still properly fails when a file is missing this value?

@yao-msft
Copy link
Copy Markdown
Contributor

I don't think we actually do want a default here; I would rather it be required to be provided rather than accidentally forgotten (and then potentially wrong).

Setting a default doesn't mean it's not required, validation will still fail if the property is missing altogether. This just gives a nice default value to codegen tools like ours

Did you verify that validate still properly fails when a file is missing this value?

IIRC, the default field is not used during schema validation. So it won't break the "validate". We have semantic validation that the DefaultLocale field in version manifest must match PackageLocale field in defaultLocale manifest. Shall we update the defaultLocale schema to default to en-US to be consistent too?

@palenshus
Copy link
Copy Markdown
Contributor Author

@yao-msft is correct, we have many other default values already, which winget validate complains if they aren't set (for example, ManifestType, ManifestVersion, etc). And Yao yes I think it would make sense to default the PackageLocale to that as well

@palenshus
Copy link
Copy Markdown
Contributor Author

@yao-msft, @JohnMcPMS, @denelon, ping

@denelon
Copy link
Copy Markdown
Collaborator

denelon commented Jun 30, 2021

@palenshus I don't see this as a problem, we just need to be very careful about schema changes, and we're currently working on the v1.1 schema so we should make sure to be consistent across all of the product area.

@yao-msft
Copy link
Copy Markdown
Contributor

@yao-msft, @JohnMcPMS, @denelon, ping

@palenshus, can you send a new commit changing the defaultLocale schema to default to en-US as well, so I can just approve and merge?

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