Closed osd42 closed 2 days ago
Thank you for creating the issue @osd42! I appreciate your time and effort!
This is reproducible. I tested it with every schema and the problem with introduced in 1.291, when a new regex, that restricts symbols in metric's displayName
and description
was added.
Here is this regex:
^(([^\\p{Cn}\\p{Cc}\\p{Cf}\\p{Co}\\p{Cs}\\p{Zl}\\p{Zp}]*)|([\\uD83E\\uDD00-\\uD83E\\uDDFF]*))+$
The thing is, there is only one flavor of regex engine, that supports that expression: Java 8+. All other engines, such as Python's re
(used by dt-cli
), Golang, PERL, JavaScript, do not support this expression and would fail trying to compile it.
The expression was added to schema 1.291 in April 2024. There is no way to go back and remove it. And there is no regex library for Python that supports this kind of expression. So, the only way to solve that is to ignore unsupported regex expressions in dt-cli
during schema validation, as if they didn't exist, just like in 1.290.
I'm opening a PR that will do exactly that.
Release v1.6.21 addressing the issue has been published to PyPi.
extension validate-schema with schemas >= 1.291.0 From schema 1.291.0, dt-cli won't validate an extension. I am using dt-cli 1.6.18 (from the latest dt-extensions-sdk[cli]) (1.6.18)
To Reproduce Steps to reproduce the behavior:
dt extension validate-schema --instance extension/extension.yaml --schema-entrypoint ~/.vscode-server/data/User/globalStorage/dynatraceplatformextensions.dynatrace-extensions/1.290.0/extension.schema.json
dt extension validate-schema --instance extension/extension.yaml --schema-entrypoint ~/.vscode-server/data/User/globalStorage/dynatraceplatformextensions.dynatrace-extensions/1.291.0/extension.schema.json
Expected behavior The new schemas (>1.290.0) should be compatible with dt-cli extension validate-schema feature.
Desktop (please complete the following information):
Additional context I am using the validate-schema feature on a CI pipeline because it catches errors that vscode does not. With this bug, we are stuck to extensions using schema 1.290.0 max. Thank your for the dt-cli tool !