Skip to content

ConfigSchemaGenerator: Ignore case and support named options#4795

Merged
eerhardt merged 7 commits intomicrosoft:mainfrom
bart-vmware:config-schema-generator-casing-named-options
Jul 11, 2024
Merged

ConfigSchemaGenerator: Ignore case and support named options#4795
eerhardt merged 7 commits intomicrosoft:mainfrom
bart-vmware:config-schema-generator-casing-named-options

Conversation

@bart-vmware
Copy link
Copy Markdown
Contributor

@bart-vmware bart-vmware commented Jul 4, 2024

This PR updates the Config Schema Generator tool to handle casing differences in log categories, config paths, type names, and property names. There's no way to determine the "right" casing, ie: should "One" win over "one"? Therefore I've only made sure that the nodes get unified (so you'll either get "One" or "one", but never both), and that the last occurrence always wins, and capture this behavior in tests:

  • OverwritesLogCategoriesWithDifferentCasing LastUsedCasingOfLogCategoryWins: Casing of the last occurrence wins.
  • MergesPropertiesAtConfigPathWithDifferentCasing LastUsedCasingOfConfigPathWins: Casing of the first last occurrence wins.
  • MergesTypesWithDifferentCasing LastUsedTypeDocumentationWins: Casing Documentation of the last occurrence wins.
  • OverwritesPropertyWithDifferentCasing LastUsedCasingOfPropertyWins: Casing of the last occurrence wins.

Additionally, this PR implements support for named options, as proposed in #4775.

Fixes #4773.
Closes #4775.

/cc @eerhardt

Microsoft Reviewers: Open in CodeFlow

Edit: Renamed tests to clarify their purpose, and ensure the last occurrence always wins.

@ghost ghost added the area-integrations Issues pertaining to Aspire Integrations packages label Jul 4, 2024
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jul 4, 2024
@bart-vmware bart-vmware marked this pull request as ready for review July 4, 2024 14:53
Comment thread tests/ConfigurationSchemaGenerator.Tests/GeneratorTests.cs Outdated
Comment thread tests/ConfigurationSchemaGenerator.Tests/GeneratorTests.cs Outdated
@bart-vmware bart-vmware requested a review from eerhardt July 10, 2024 10:56
Copy link
Copy Markdown
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks again for the great contributions, @bart-vmware!

@eerhardt eerhardt enabled auto-merge (squash) July 10, 2024 17:25
@bart-vmware
Copy link
Copy Markdown
Contributor Author

LGTM. Thanks again for the great contributions, @bart-vmware!

@eerhardt Thanks for timely reviewing and providing good feedback.
Can you please restart the cibuild, so this gets merged?

@eerhardt
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

bart-vmware added a commit to SteeltoeOSS/Steeltoe that referenced this pull request Jul 11, 2024
bart-vmware added a commit to SteeltoeOSS/Steeltoe that referenced this pull request Jul 11, 2024
@eerhardt eerhardt merged commit b770d56 into microsoft:main Jul 11, 2024
@bart-vmware bart-vmware deleted the config-schema-generator-casing-named-options branch July 12, 2024 18:55
bart-vmware added a commit to SteeltoeOSS/Steeltoe that referenced this pull request Jul 15, 2024
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-integrations Issues pertaining to Aspire Integrations packages community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support named options in ConfigSchemaGenerator ConfigSchemaGenerator should ignore casing of configuration keys

2 participants