From f7302149d0652515d440fc593001d03c3acd63e0 Mon Sep 17 00:00:00 2001 From: Timur Olzhabayev Date: Thu, 1 Sep 2022 15:53:38 +0200 Subject: [PATCH] Fix: Adjusting plugin.json schema regex (#54515) --- docs/sources/developers/plugins/plugin.schema.json | 4 ++-- pkg/coremodel/pluginmeta/coremodel.cue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/sources/developers/plugins/plugin.schema.json b/docs/sources/developers/plugins/plugin.schema.json index cfc36694748..706ee19229b 100644 --- a/docs/sources/developers/plugins/plugin.schema.json +++ b/docs/sources/developers/plugins/plugin.schema.json @@ -146,7 +146,7 @@ "grafanaDependency": { "type": "string", "description": "Required Grafana version for this plugin. Validated using https://github.com/npm/node-semver.", - "pattern": "^(<=|>=|<|>|=|~|\\^)?([0-9]+)(\\.[0-9x\\*]+)(\\.[0-9x\\*])?(\\s(<=|>=|<|=>)?([0-9]+)(\\.[0-9x]+)(\\.[0-9x]))?$" + "pattern": "^(<=|>=|<|>|=|~|\\^)?([0-9]+)(\\.[0-9x\\*]+)(\\.[0-9x\\*]+)?(\\s(<=|>=|<|=>)?([0-9]+)(\\.[0-9x]+)(\\.[0-9x]+))?$" }, "plugins": { "type": "array", @@ -303,7 +303,7 @@ "version": { "type": "string", "description": "Project version of this commit, e.g. `6.7.x`.", - "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*$|\\%VERSION\\%)" + "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)|(\\%VERSION\\%)$" } } }, diff --git a/pkg/coremodel/pluginmeta/coremodel.cue b/pkg/coremodel/pluginmeta/coremodel.cue index 170a59565d4..e725a63fa7d 100644 --- a/pkg/coremodel/pluginmeta/coremodel.cue +++ b/pkg/coremodel/pluginmeta/coremodel.cue @@ -142,7 +142,7 @@ seqs: [ // Required Grafana version for this plugin. Validated using // https://github.com/npm/node-semver. - grafanaDependency: =~"^(<=|>=|<|>|=|~|\\^)?([0-9]+)(\\.[0-9x\\*]+)(\\.[0-9x\\*])?(\\s(<=|>=|<|=>)?([0-9]+)(\\.[0-9x]+)(\\.[0-9x]))?$" + grafanaDependency: =~"^(<=|>=|<|>|=|~|\\^)?([0-9]+)(\\.[0-9x\\*]+)(\\.[0-9x\\*]+)?(\\s(<=|>=|<|=>)?([0-9]+)(\\.[0-9x]+)(\\.[0-9x]+))?$" // An array of required plugins on which this plugin depends. plugins?: [...#Dependency] @@ -220,7 +220,7 @@ seqs: [ updated?: =~"^(\\d{4}-\\d{2}-\\d{2}|\\%TODAY\\%)$" // Project version of this commit, e.g. `6.7.x`. - version?: =~"^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*$|\\%VERSION\\%)" + version?: =~"^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)|(\\%VERSION\\%)$" } #BuildInfo: {