-
Notifications
You must be signed in to change notification settings - Fork 6
feat: Add manifest validation tool #93
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
base: main
Are you sure you want to change the base?
Conversation
c0f9c6b to
85d48a7
Compare
9ee721e to
b1ed71b
Compare
Pull Request Test Coverage Report for Build 19666892989Details
💛 - Coveralls |
|
Looks good to me |
6ee3a30 to
0f4d9df
Compare
alexandar-mitsev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
now I often get "The MCP validation tool timed out". Seems that it happens mainly if I ask to validate a manifest, complete the task, then edit the manifest and ask to validate again.
Maybe it is related to the mutex log and cache. Or to the ajv tool itself
If I restart VS code, the tool can run again without a timeout. Also it runs smoothly couple of times in the same task. But fails with timeout if it runs in two different tasks in the same window. -
every time when I validate manifest _version: "1.60.0" - I get an error
Error:
Failed to create UI5 manifest validate function: items value must be ["object","boolean"] -
some older manifests are in the mapping, but have no tag for them, e.g. 1.50.0, 1.45.0
we should think of how to improve the tool to handle this. Maybe suggest an upgrade in that case as well? -
there are many logs for format "uri" ignored and format "uri-reference" ignored in the console, but this is not an error. Can be resolved with later update
Fixed it, it was caused by not releasing the mutex when fetching external schemas, particularly the Adaptive cards schema.
The reason behind that is that UI5 Manifest schemas prior 1.68.0 are using older version of the meta schema. Our setup doesn't support it. I have added an error and hint whenever such old version of manifest is encountered, to suggest upgrade to a newer one.
Now, upgrade is suggested if version lower than 1.68.0 is encountered.
Resolved it. There is dedicated package that contains those formats, called "ajv-formats". |
alexandar-mitsev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
@MatthiasSchmalz fyi, in case you have any comments or suggestions we would highly appreciate it. Otherwise we will go forward with this setup CC: @codeworrior |
|
@RandomByte However 1.67.0 is not very old, so a lot of consumers might still use it. |
| const fetchSchemaMutex = new Mutex(); | ||
|
|
||
| let UI5ToManifestVersionMapping: Record<string, string> | null = null; | ||
| const MAPPING_URL = "https://raw.githubusercontent.com/SAP/ui5-manifest/main/mapping.json"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main branch is missing versions >=2
| const MAPPING_URL = "https://raw.githubusercontent.com/SAP/ui5-manifest/main/mapping.json"; | |
| const MAPPING_URL = "https://raw.githubusercontent.com/SAP/ui5-manifest/v2/mapping.json"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assumed that when v2 is productively released, it will go in the main branch and then we will have it. Not sure if we need to use v2 before its stable release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MatthiasSchmalz can you please clarify?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The colleagues also found that https://raw.githubusercontent.com/SAP/ui5-manifest/v2/mapping.json is missing the latest UI5 releases such as 1.142
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RandomByte v2 is currently in the v2 branch, while main still contains v1. We have no explicit timeline yet, when this will be switched as UI5 2 is also not released yet.
Due to this, main branch only maps to v1 schemas. You are right that we might need a better way to map this, Peter recently started a discussion here.
Yes in v2 the mapping does not contain the latest version. In the past we had only added an entry, when a new schema version is available. You can use the rule to take the highest available mapping. But yes, somehow we have entries for 1.139 and 1.138 without a new version as well.
@aleksandr-suvorov do you know why this is the case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that the availability of a manifest version 2.x is not tightly coupled to a UI5 2.x release.
The manifest version is already supported since UI5 1.136 and the best practice is to adjust the manifest to this version.
In general, I'm not happy with such a complex logic to be able to validate a manifest. I would highly appreciate an API from @ui5/manifest that takes care of all of the mentioned logic and specialities. Adding the code here will not only require all other places that want to validate a manifest to add the same logic, but also makes future changes on your end very cumbersome and error prone, especially as there is no versioning (requests are just sent to the branches main / v2).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference, this is the UI5 Language Assistant implementation to support manifest v2: SAP/ui5-language-assistant#754
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RandomByte yes, the release of V2 is now coupled with the releases of legacy free versions, which might not be optimal, I will prepare intermediate versions also.
@matz3 ui5 manifest provides schema validation, but right now this functionality is not exposed in the API. We could reconsider it, expose and use it here, because basically we do it with the same tools and the same way.
matz3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The architecture document should also be updated to reflect the new changes, especially the new dependencies to external services.
| throw new Error( | ||
| errorMessage + | ||
| (supportedVersions ? | ||
| `\nSupported versions are: ${supportedVersions.join(", ")}.` : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gave me the following versions:
Manifest version '1.0.0' is not supported. Please upgrade to a newer one.
Supported versions are: 1.81.0, 1.81.0, 1.80.0, 1.79.0, 1.78.0, 1.77.0, 1.76.0, 1.75.1, 1.73.1, 1.72.3, 1.72.0, 1.70.1, 1.69.0, 1.68.0.
- What about
2.0.0? Isn't that version also supported? It is not listed here. - 1.81.0 is listed twice
Hello @MatthiasSchmalz , The error now looks like This tool focuses on performing validation based on concrete schema. |
7673deb to
6c7eae5
Compare
No description provided.