diff --git a/delete-adf-items/v2/lib/helpers.spec.ts b/delete-adf-items/v2/lib/helpers.spec.ts index 01528cc..75fb1bf 100644 --- a/delete-adf-items/v2/lib/helpers.spec.ts +++ b/delete-adf-items/v2/lib/helpers.spec.ts @@ -79,6 +79,12 @@ describe("helpers.ts", function () { }); }); + describe("old 'all' functionality", () => { + it("validate 'trigger' with rule '*' => true", () => { + assert.strictEqual(wildcardFilter("trigger", "*"), true); + }); + }); + describe("new RegExp functionality", () => { it("validate 'triggetr' with rule 'trigge.r' => true", () => { assert.strictEqual(wildcardFilter("triggetr", "trigge.r"), true); diff --git a/delete-adf-items/v2/lib/helpers.ts b/delete-adf-items/v2/lib/helpers.ts index 88e7fb1..6c10695 100644 --- a/delete-adf-items/v2/lib/helpers.ts +++ b/delete-adf-items/v2/lib/helpers.ts @@ -111,6 +111,6 @@ export function findDependency(json: any, type: string): string[] { } export function wildcardFilter(value: string, rule: string) { - if (RegExp(/\w\*.*/g).test(rule)) return new RegExp("^" + rule.split("*").join(".*") + "$").test(value); + if (RegExp(/\*$|\w\*.*/g).test(rule)) return new RegExp("^" + rule.split("*").join(".*") + "$").test(value); else return new RegExp(rule).test(value); } diff --git a/delete-adf-items/v2/task.json b/delete-adf-items/v2/task.json index a93b718..92516fb 100644 --- a/delete-adf-items/v2/task.json +++ b/delete-adf-items/v2/task.json @@ -13,7 +13,7 @@ "version": { "Major": "2", "Minor": "3", - "Patch": "2" + "Patch": "3" }, "minimumAgentVersion": "1.100.0", "groups": [ diff --git a/deploy-adf-json/v2/task.json b/deploy-adf-json/v2/task.json index aadf29e..ef5603a 100644 --- a/deploy-adf-json/v2/task.json +++ b/deploy-adf-json/v2/task.json @@ -13,7 +13,7 @@ "version": { "Major": "2", "Minor": "3", - "Patch": "2" + "Patch": "3" }, "minimumAgentVersion": "1.100.0", "groups": [ diff --git a/query-adf-run/task.json b/query-adf-run/task.json index 009ea01..223397d 100644 --- a/query-adf-run/task.json +++ b/query-adf-run/task.json @@ -15,7 +15,7 @@ "version": { "Major": "2", "Minor": "3", - "Patch": "2" + "Patch": "3" }, "instanceNameFormat": "Query Azure Data Factory runs", "groups": [ diff --git a/toggle-adf-trigger/v2/lib/helpers.spec.ts b/toggle-adf-trigger/v2/lib/helpers.spec.ts index 9df4ef0..dcece8a 100644 --- a/toggle-adf-trigger/v2/lib/helpers.spec.ts +++ b/toggle-adf-trigger/v2/lib/helpers.spec.ts @@ -44,6 +44,12 @@ describe("helpers.ts", function () { }); }); + describe("old 'all' functionality", () => { + it("validate 'trigger' with rule '*' => true", () => { + assert.strictEqual(wildcardFilter("trigger", "*"), true); + }); + }); + describe("new RegExp functionality", () => { it("validate 'triggetr' with rule 'trigge.r' => true", () => { assert.strictEqual(wildcardFilter("triggetr", "trigge.r"), true); diff --git a/toggle-adf-trigger/v2/lib/helpers.ts b/toggle-adf-trigger/v2/lib/helpers.ts index 1c280b4..31e2f18 100644 --- a/toggle-adf-trigger/v2/lib/helpers.ts +++ b/toggle-adf-trigger/v2/lib/helpers.ts @@ -29,6 +29,6 @@ "use strict"; export function wildcardFilter(value: string, rule: string) { - if (RegExp(/\w\*.*/g).test(rule)) return new RegExp("^" + rule.split("*").join(".*") + "$").test(value); + if (RegExp(/\*$|\w\*.*/g).test(rule)) return new RegExp("^" + rule.split("*").join(".*") + "$").test(value); else return new RegExp(rule).test(value); } diff --git a/toggle-adf-trigger/v2/task.json b/toggle-adf-trigger/v2/task.json index a122929..1317cb7 100644 --- a/toggle-adf-trigger/v2/task.json +++ b/toggle-adf-trigger/v2/task.json @@ -13,7 +13,7 @@ "version": { "Major": "2", "Minor": "3", - "Patch": "2" + "Patch": "3" }, "minimumAgentVersion": "1.100.0", "groups": [ diff --git a/trigger-adf-pipeline/v2/lib/helpers.spec.ts b/trigger-adf-pipeline/v2/lib/helpers.spec.ts index 9df4ef0..dcece8a 100644 --- a/trigger-adf-pipeline/v2/lib/helpers.spec.ts +++ b/trigger-adf-pipeline/v2/lib/helpers.spec.ts @@ -44,6 +44,12 @@ describe("helpers.ts", function () { }); }); + describe("old 'all' functionality", () => { + it("validate 'trigger' with rule '*' => true", () => { + assert.strictEqual(wildcardFilter("trigger", "*"), true); + }); + }); + describe("new RegExp functionality", () => { it("validate 'triggetr' with rule 'trigge.r' => true", () => { assert.strictEqual(wildcardFilter("triggetr", "trigge.r"), true); diff --git a/trigger-adf-pipeline/v2/lib/helpers.ts b/trigger-adf-pipeline/v2/lib/helpers.ts index 1c280b4..31e2f18 100644 --- a/trigger-adf-pipeline/v2/lib/helpers.ts +++ b/trigger-adf-pipeline/v2/lib/helpers.ts @@ -29,6 +29,6 @@ "use strict"; export function wildcardFilter(value: string, rule: string) { - if (RegExp(/\w\*.*/g).test(rule)) return new RegExp("^" + rule.split("*").join(".*") + "$").test(value); + if (RegExp(/\*$|\w\*.*/g).test(rule)) return new RegExp("^" + rule.split("*").join(".*") + "$").test(value); else return new RegExp(rule).test(value); } diff --git a/trigger-adf-pipeline/v2/task.json b/trigger-adf-pipeline/v2/task.json index a8d3682..be2ff03 100644 --- a/trigger-adf-pipeline/v2/task.json +++ b/trigger-adf-pipeline/v2/task.json @@ -13,7 +13,7 @@ "version": { "Major": "2", "Minor": "3", - "Patch": "2" + "Patch": "3" }, "minimumAgentVersion": "1.100.0", "groups": [ diff --git a/vss-extension.json b/vss-extension.json index f4fa42b..9fea2df 100644 --- a/vss-extension.json +++ b/vss-extension.json @@ -1,7 +1,7 @@ { "manifestVersion": 1, "id": "vsts-publish-adf", - "version": "2.3.2", + "version": "2.3.3", "name": "Azure Data Factory", "publisher": "liprec", "public": true,