-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Yaml manifest schemaheader validation for V.1.10.0 and above #5126
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
Merged
Madhusudhan-MSFT
merged 18 commits into
microsoft:master
from
Madhusudhan-MSFT:user/masudars/yaml_manifest_schemaheader_validation
Jan 17, 2025
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
8b9fce6
Add schema header validation for YAML manifests V.1.10.0 and above
Madhusudhan-MSFT 4db7583
Treat schema header validation errors as warnings for 'winget validat…
Madhusudhan-MSFT c60d267
Add tests for YAML Manifest schema header validations
Madhusudhan-MSFT c8e69e3
Extend Add schema header validation tests for WinGet CLI Validation c…
Madhusudhan-MSFT 8065a7a
Update error message in ManifestV1_10 test case
Madhusudhan-MSFT f594f1b
Fix typo in test manifest file path in two test files
Madhusudhan-MSFT 1d27243
Enhance YAML manifest schema header validation
Madhusudhan-MSFT bd4fd24
Fix casing in YAML language server schema URL comment
Madhusudhan-MSFT 4b18e9e
Fix casing in YAML language server schema URL to address ValidateV1_1…
Madhusudhan-MSFT 097ee92
Addressing PR review comments: Simplify schema header validation erro…
Madhusudhan-MSFT 7d9c4f2
Fix formatting issues in ValidateCommand.cs
Madhusudhan-MSFT ea00978
[PRFeedback:] Refactor YAML schema header handling
Madhusudhan-MSFT 8607fbb
Fix typo in AddSchemaHeader parameter name
Madhusudhan-MSFT 91f1fb2
Fix visual studio editor introduced encoding character issue with the…
Madhusudhan-MSFT ad62417
Revert chagnes ValidateCommand.cs and replacing it with orginal file …
Madhusudhan-MSFT 001e610
Bring back validatecommand schema header tests.
812f547
PRFeedback: Refactor YAML schema handling and improve maintainability
Madhusudhan-MSFT db264b6
Optimize YamlParser with move semantics
Madhusudhan-MSFT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/AppInstallerCLIE2ETests/TestData/Manifests/TestGoodManifestV1_10-SchemaHeader.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # yaml-language-server: $schema=https://aka.ms/winget-manifest.singleton.1.10.0.schema.json | ||
| PackageIdentifier: AppInstallerCliTest.SchemaHeader | ||
| PackageVersion: 1.0.0.0 | ||
| PackageLocale: en-US | ||
| PackageName: AppInstaller Test Schema Header | ||
| Publisher: Microsoft Corporation | ||
| License: Test | ||
| ShortDescription: This manifest with schema header | ||
|
|
||
| Installers: | ||
| - Architecture: x86 | ||
| InstallerUrl: https://ThisIsNotUsed | ||
| InstallerType: msi | ||
| InstallerSha256: 65DB2F2AC2686C7F2FD69D4A4C6683B888DC55BFA20A0E32CA9F838B51689A3B | ||
| ManifestType: singleton | ||
| ManifestVersion: 1.10.0 |
16 changes: 16 additions & 0 deletions
16
...InstallerCLIE2ETests/TestData/Manifests/TestWarningManifestV1_10-SchemaHeaderInvalid.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # yaml-language-server= $schema=https://aka.ms/winget-manifest.singleton.1.10.0.schema.json | ||
| PackageIdentifier: AppInstallerCliTest.SchemaHeaderInvalid | ||
| PackageVersion: 1.0.0.0 | ||
| PackageLocale: en-US | ||
| PackageName: AppInstaller Test Schema Header Invalid | ||
| Publisher: Microsoft Corporation | ||
| License: Test | ||
| ShortDescription: This manifest has an invalid schema header | ||
|
|
||
| Installers: | ||
| - Architecture: x86 | ||
| InstallerUrl: https://ThisIsNotUsed | ||
| InstallerType: msi | ||
| InstallerSha256: 65DB2F2AC2686C7F2FD69D4A4C6683B888DC55BFA20A0E32CA9F838B51689A3B | ||
| ManifestType: singleton | ||
| ManifestVersion: 1.10.0 |
16 changes: 16 additions & 0 deletions
16
...2ETests/TestData/Manifests/TestWarningManifestV1_10-SchemaHeaderManifestTypeMismatch.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.10.0.schema.json | ||
| PackageIdentifier: AppInstallerCliTest.SchemaHeaderManifestTypeMismatch | ||
| PackageVersion: 1.0.0.0 | ||
| PackageLocale: en-US | ||
| PackageName: AppInstaller Test Schema Header ManifestType Mismatch | ||
| Publisher: Microsoft Corporation | ||
| License: Test | ||
| ShortDescription: This manifest has a mismatched ManisfestType in the schema header | ||
|
|
||
| Installers: | ||
| - Architecture: x86 | ||
| InstallerUrl: https://ThisIsNotUsed | ||
| InstallerType: msi | ||
| InstallerSha256: 65DB2F2AC2686C7F2FD69D4A4C6683B888DC55BFA20A0E32CA9F838B51689A3B | ||
| ManifestType: singleton | ||
| ManifestVersion: 1.10.0 |
15 changes: 15 additions & 0 deletions
15
...nstallerCLIE2ETests/TestData/Manifests/TestWarningManifestV1_10-SchemaHeaderNotFound.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| PackageIdentifier: AppInstallerCliTest.SchemaHeaderNotFound | ||
| PackageVersion: 1.0.0.0 | ||
| PackageLocale: en-US | ||
| PackageName: AppInstaller Test Schema Header Not Found | ||
| Publisher: Microsoft Corporation | ||
| License: Test | ||
| ShortDescription: This manifest has a missing schema header | ||
|
|
||
| Installers: | ||
| - Architecture: x86 | ||
| InstallerUrl: https://ThisIsNotUsed | ||
| InstallerType: msi | ||
| InstallerSha256: 65DB2F2AC2686C7F2FD69D4A4C6683B888DC55BFA20A0E32CA9F838B51689A3B | ||
| ManifestType: singleton | ||
| ManifestVersion: 1.10.0 |
16 changes: 16 additions & 0 deletions
16
...IE2ETests/TestData/Manifests/TestWarningManifestV1_10-SchemaHeaderURLPatternMismatch.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # yaml-language-server: $schema=https://aka.ms/winget-manifest-invalid.singleton.1.10.0.schema.json | ||
| PackageIdentifier: AppInstallerCliTest.SchemaHeaderURLPatternMismatch | ||
| PackageVersion: 1.0.0.0 | ||
| PackageLocale: en-US | ||
| PackageName: AppInstaller Test Schema Header URL Pattern Mismatch | ||
| Publisher: Microsoft Corporation | ||
| License: Test | ||
| ShortDescription: This manifest has a mismatched schema header URL pattern | ||
|
|
||
| Installers: | ||
| - Architecture: x86 | ||
| InstallerUrl: https://ThisIsNotUsed | ||
| InstallerType: msi | ||
| InstallerSha256: 65DB2F2AC2686C7F2FD69D4A4C6683B888DC55BFA20A0E32CA9F838B51689A3B | ||
| ManifestType: singleton | ||
| ManifestVersion: 1.10.0 |
16 changes: 16 additions & 0 deletions
16
...rCLIE2ETests/TestData/Manifests/TestWarningManifestV1_10-SchemaHeaderVersionMismatch.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # yaml-language-server: $schema=https://aka.ms/winget-manifest.singleton.1.9.0.schema.json | ||
| PackageIdentifier: AppInstallerCliTest.SchemaHeaderVersionMismatch | ||
| PackageVersion: 1.0.0.0 | ||
| PackageLocale: en-US | ||
| PackageName: AppInstaller Test Schema Header ManifestVersion Mismatch | ||
| Publisher: Microsoft Corporation | ||
| License: Test | ||
| ShortDescription: This manifest has a mismatched ManisfestVersion in the schema header | ||
|
|
||
| Installers: | ||
| - Architecture: x86 | ||
| InstallerUrl: https://ThisIsNotUsed | ||
| InstallerType: msi | ||
| InstallerSha256: 65DB2F2AC2686C7F2FD69D4A4C6683B888DC55BFA20A0E32CA9F838B51689A3B | ||
| ManifestType: singleton | ||
| ManifestVersion: 1.10.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/AppInstallerCLITests/TestData/ManifestV1_10-Bad-SchemaHeaderInvalid.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # yaml-language-server= $schema=https://aka.ms/winget-manifest.singleton.1.10.0.schema.json | ||
| PackageIdentifier: AppInstallerCliTest.SchemaHeaderInvalid | ||
| PackageVersion: 1.0.0.0 | ||
| PackageLocale: en-US | ||
| PackageName: AppInstaller Test Schema Header Invalid | ||
| Publisher: Microsoft Corporation | ||
| License: Test | ||
| ShortDescription: This manifest has an invalid schema header | ||
|
|
||
| Installers: | ||
| - Architecture: x86 | ||
| InstallerUrl: https://ThisIsNotUsed | ||
| InstallerType: msi | ||
| InstallerSha256: 65DB2F2AC2686C7F2FD69D4A4C6683B888DC55BFA20A0E32CA9F838B51689A3B | ||
| ManifestType: singleton | ||
| ManifestVersion: 1.10.0 |
16 changes: 16 additions & 0 deletions
16
src/AppInstallerCLITests/TestData/ManifestV1_10-Bad-SchemaHeaderManifestTypeMismatch.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.10.0.schema.json | ||
| PackageIdentifier: AppInstallerCliTest.SchemaHeaderManifestTypeMismatch | ||
| PackageVersion: 1.0.0.0 | ||
| PackageLocale: en-US | ||
| PackageName: AppInstaller Test Schema Header ManifestType Mismatch | ||
| Publisher: Microsoft Corporation | ||
| License: Test | ||
| ShortDescription: This manifest has a mismatched ManisfestType in the schema header | ||
|
|
||
| Installers: | ||
| - Architecture: x86 | ||
| InstallerUrl: https://ThisIsNotUsed | ||
| InstallerType: msi | ||
| InstallerSha256: 65DB2F2AC2686C7F2FD69D4A4C6683B888DC55BFA20A0E32CA9F838B51689A3B | ||
| ManifestType: singleton | ||
| ManifestVersion: 1.10.0 |
16 changes: 16 additions & 0 deletions
16
src/AppInstallerCLITests/TestData/ManifestV1_10-Bad-SchemaHeaderManifestVersionMismatch.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # yaml-language-server: $schema=https://aka.ms/winget-manifest.singleton.1.9.0.schema.json | ||
| PackageIdentifier: AppInstallerCliTest.SchemaHeaderVersionMismatch | ||
| PackageVersion: 1.0.0.0 | ||
| PackageLocale: en-US | ||
| PackageName: AppInstaller Test Schema Header ManifestVersion Mismatch | ||
| Publisher: Microsoft Corporation | ||
| License: Test | ||
| ShortDescription: This manifest has a mismatched ManisfestVersion in the schema header | ||
|
|
||
| Installers: | ||
| - Architecture: x86 | ||
| InstallerUrl: https://ThisIsNotUsed | ||
| InstallerType: msi | ||
| InstallerSha256: 65DB2F2AC2686C7F2FD69D4A4C6683B888DC55BFA20A0E32CA9F838B51689A3B | ||
| ManifestType: singleton | ||
| ManifestVersion: 1.10.0 |
15 changes: 15 additions & 0 deletions
15
src/AppInstallerCLITests/TestData/ManifestV1_10-Bad-SchemaHeaderNotFound.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| PackageIdentifier: AppInstallerCliTest.SchemaHeaderNotFound | ||
| PackageVersion: 1.0.0.0 | ||
| PackageLocale: en-US | ||
| PackageName: AppInstaller Test Schema Header Not Found | ||
| Publisher: Microsoft Corporation | ||
| License: Test | ||
| ShortDescription: This manifest has a missing schema header | ||
|
|
||
| Installers: | ||
| - Architecture: x86 | ||
| InstallerUrl: https://ThisIsNotUsed | ||
| InstallerType: msi | ||
| InstallerSha256: 65DB2F2AC2686C7F2FD69D4A4C6683B888DC55BFA20A0E32CA9F838B51689A3B | ||
| ManifestType: singleton | ||
| ManifestVersion: 1.10.0 |
16 changes: 16 additions & 0 deletions
16
src/AppInstallerCLITests/TestData/ManifestV1_10-Bad-SchemaHeaderURLPatternMismatch.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # yaml-language-server: $schema=https://aka.ms/winget-manifest-invalid.singleton.1.10.0.schema.json | ||
| PackageIdentifier: AppInstallerCliTest.SchemaHeaderURLPatternMismatch | ||
| PackageVersion: 1.0.0.0 | ||
| PackageLocale: en-US | ||
| PackageName: AppInstaller Test Schema Header URL Pattern Mismatch | ||
| Publisher: Microsoft Corporation | ||
| License: Test | ||
| ShortDescription: This manifest has a mismatched schema header URL pattern | ||
|
|
||
| Installers: | ||
| - Architecture: x86 | ||
| InstallerUrl: https://ThisIsNotUsed | ||
| InstallerType: msi | ||
| InstallerSha256: 65DB2F2AC2686C7F2FD69D4A4C6683B888DC55BFA20A0E32CA9F838B51689A3B | ||
| ManifestType: singleton | ||
| ManifestVersion: 1.10.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...tallerCLITests/TestData/MultiFileManifestV1_10/ManifestV1_10-MultiFile-DefaultLocale.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.