Skip to content

Commit

Permalink
fixup: load targeting in ci
Browse files Browse the repository at this point in the history
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
  • Loading branch information
toddbaert committed Jan 3, 2024
1 parent 2c6e808 commit 005112a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@ gen-schema-json: install-yq

ajv-validate-flagd-schema:
@if ! npm ls ajv-cli; then npm ci; fi
npx ajv compile -s json/flagd-definitions.json
npx ajv compile -s json/targeting.json
# load the targeting json so flagd-definitions.json can reference it
npx ajv compile -r json/targeting.json -s json/flagd-definitions.json
6 changes: 3 additions & 3 deletions json/flagd-definitions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "flagd.dev/schema/flagd-definitions.json",
"$id": "https://flagd.dev/schema/flagd-definitions.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "flagd Flag Configuration",
"description": "Defines flags for use in flagd, including typed variants and rules",
Expand Down Expand Up @@ -46,7 +46,7 @@
"patternProperties": {
"^.{1,}$": {
"$comment": "this relative ref means that targeting.json MUST be in the same dir, or available on the same HTTP path",
"$ref": "./targeting.json#/$defs/targeting"
"$ref": "https://flagd.dev/schema/targeting.json#/$defs/targeting"
}
}
}
Expand All @@ -71,7 +71,7 @@
"type": "string"
},
"targeting": {
"$ref": "./targeting.json#/$defs/targeting"
"$ref": "https://flagd.dev/schema/targeting.json#/$defs/targeting"
}
},
"required": [
Expand Down
8 changes: 4 additions & 4 deletions json/flagd-definitions.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$id: "flagd.dev/schema/flagd-definitions.json"
$id: "https://flagd.dev/schema/flagd-definitions.json"
$schema: http://json-schema.org/draft-07/schema#
title: flagd Flag Configuration
description: Defines flags for use in flagd, including typed variants and rules
Expand All @@ -25,7 +25,7 @@ properties:
- title: Object flag
description: A flag having arbitrary object values.
$ref: "#/$defs/objectFlag"
"$evaluators":
$evaluators:
title: Evaluators
description: 'Reusable targeting rules that can be referenced with "$ref": "myRule"
in multiple flags.'
Expand All @@ -35,7 +35,7 @@ properties:
"^.{1,}$":
$comment: this relative ref means that targeting.json MUST be in the same
dir, or available on the same HTTP path
$ref: "./targeting.json#/$defs/targeting"
$ref: "https://flagd.dev/schema/targeting.json#/$defs/targeting"
"$defs":
flag:
$comment: base flag object; no title/description here, allows for better UX,
Expand All @@ -56,7 +56,7 @@ properties:
if the targeting returns null).
type: string
targeting:
$ref: "./targeting.json#/$defs/targeting"
$ref: "https://flagd.dev/schema/targeting.json#/$defs/targeting"
required:
- state
- defaultVariant
Expand Down
2 changes: 1 addition & 1 deletion json/targeting.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "flagd.dev/schema/targeting.json",
"$id": "https://flagd.dev/schema/targeting.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "flagd Targeting",
"description": "Defines targeting logic for flagd; a extension of JSONLogic, including purpose-built feature-flagging operations.",
Expand Down
2 changes: 1 addition & 1 deletion json/targeting.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$id: "flagd.dev/schema/targeting.json"
$id: "https://flagd.dev/schema/targeting.json"
$schema: http://json-schema.org/draft-07/schema#
title: flagd Targeting
description: Defines targeting logic for flagd; a extension of JSONLogic, including
Expand Down

0 comments on commit 005112a

Please sign in to comment.