Skip to content
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

Workaround invalid schema metric name regex pattern #179

Merged
merged 8 commits into from
Nov 13, 2024
Merged

Workaround invalid schema metric name regex pattern #179

merged 8 commits into from
Nov 13, 2024

Conversation

vduseev
Copy link
Collaborator

@vduseev vduseev commented Nov 13, 2024

Summary

Fixes #178

What's done

  1. Migrated off deprecated jsonschema RefResolver.
  2. Ignore invalid regex pattern during schema validation. Still check everything else.

Testing

Normal extension written with schema 1.291 in mind

dt-cli on  dev [!⇕] is 📦 v1.6.20 via 🐍 v3.10.13 (.venv) 
❯ ./.venv/bin/dt ext validate-schema --instance ~/Projects/Extensions/python-fortigate/extension/extension.yaml --schema-entrypoint schemas/1.295.0/extension.schema.json

dt-cli on  dev [!⇕] is 📦 v1.6.20 via 🐍 v3.10.13 (.venv) took 3s 
❯ ./.venv/bin/dt ext validate-schema --instance ~/Projects/Extensions/python-fortigate/extension/extension.yaml --schema-entrypoint schemas/1.304.0/extension.schema.json

Latest extension written using schema 1.304

dt-cli on  dev [!⇕] is 📦 v1.6.20 via 🐍 v3.10.13 (.venv) 
❯ ./.venv/bin/dt ext validate-schema --instance ~/Projects/Extensions/otel-collector-prometheus-postgres/src/extension/extension.yaml --schema-entrypoint schemas/1.304.0/extension.schema.json

Purposefully introduced a mistake in the extension.yaml to see if validation still works

dt-cli on  dev [!⇕] is 📦 v1.6.20 via 🐍 v3.10.13 (.venv) took 5s 
❯ ./.venv/bin/dt ext validate-schema --instance ~/Projects/Extensions/otel-collector-prometheus-postgres/src/extension/extension.yaml --schema-entrypoint schemas/1.304.0/extension.schema.json
---------- error 0 ----------
line: 0, column: 0
path: 
cause: 'minDynatraceVersion' is a required property
---------- error 1 ----------
line: 0, column: 0
path: 
cause: Additional properties are not allowed ('minDynatraceVersions' was unexpected)
------------------------------
Error: 2 validation errors total, aborting!

@vduseev vduseev self-assigned this Nov 13, 2024
Copy link

@vduseev vduseev merged commit 04affa3 into main Nov 13, 2024
16 checks passed
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.

extension validate-schema is incompatible with schemas > 1.290.0
1 participant