Skip to content

Commit 30aac77

Browse files
authored
Merge pull request StackStorm#617 from StackStorm/validate_example_configs
Validate example pack configs against schema during builds.
2 parents 0aacb01 + a375d6b commit 30aac77

File tree

12 files changed

+20
-17
lines changed

12 files changed

+20
-17
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ flake8: requirements .flake8
2929
pylint: requirements .clone_st2_repo .pylint
3030

3131
.PHONY: configs-check
32-
configs-check: requirements .configs-check
32+
configs-check: requirements .clone_st2_repo .configs-check
3333

3434
.PHONY: metadata-check
3535
metadata-check: requirements .metadata-check
@@ -64,6 +64,7 @@ packs-tests: requirements .clone_st2_repo .packs-tests
6464
@echo
6565
. $(VIRTUALENV_DIR)/bin/activate; if [ ! "${CHANGED_YAML}" ]; then echo No files have changed, skipping run...; fi; for file in $(CHANGED_YAML); do if [ -n "$$file" ]; then st2-check-validate-yaml-file $$file || exit 1 ; fi; done
6666
. $(VIRTUALENV_DIR)/bin/activate; if [ ! "${CHANGED_JSON}" ]; then echo No files have changed, skipping run...; fi; for file in $(CHANGED_JSON); do if [ -n "$$file" ]; then st2-check-validate-json-file $$file || exit 1 ; fi; done
67+
. $(VIRTUALENV_DIR)/bin/activate; if [ ! "${CHANGED_PACKS}" ]; then echo No packs have changed, skipping run...; fi; for pack in $(CHANGED_PACKS); do if [ -n "$$pack" ]; then st2-check-validate-pack-example-config $$pack || exit 1 ; fi; done
6768

6869
.PHONY: .metadata-check
6970
.metadata-check:

packs/astral/astral.yaml.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
# For North and East, use positive values
3-
latitude: "38.31"
4-
longitude: "-122.54"
3+
latitude: 38.31
4+
longitude: -122.54
55
timezone: "US/Pacific"

packs/consul/config.schema.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
default: "127.0.0.1"
88
port:
99
description: "Consul server port. Default 8500"
10-
type: "string"
10+
type: "integer"
1111
secret: false
1212
required: true
13-
default: "8500"
13+
default: 8500
1414
token:
1515
description: "Consul API token"
1616
type: "string"

packs/elasticsearch/config.schema.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
required: true
77
port:
88
description: "Elasticsearch port - default 9200"
9-
type: "string"
9+
type: "integer"
1010
secret: false
1111
required: false
12-
default: "9200"
12+
default: 9200
1313
query_window:
1414
description: "Rolling window size in seconds. Default 30s"
1515
type: "integer"

packs/gpg/config.schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
required: false
1313
debug:
1414
description: "Optional debug flag - set to True to enable debug mode"
15-
type: "string"
15+
type: "boolean"
1616
secret: false
1717
required: false
1818
default: false

packs/jmx/config.schema.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
default: "localhost"
88
port:
99
description: "JMX service port. Default 7199"
10-
type: "string"
10+
type: "integer"
1111
secret: false
1212
required: true
13-
default: "7199"
13+
default: 7199
1414
username:
1515
description: "Optional JMX username"
1616
type: "string"
@@ -34,5 +34,7 @@
3434
attribute_keys:
3535
description: "A list of attribute keys for compound attributes"
3636
type: "string"
37+
items:
38+
type: "string"
3739
secret: false
3840
required: false

packs/nest/nest.yaml.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
username: ""
33
password: ""
4-
structure: 0
5-
device: 0
4+
structure: "0"
5+
device: "0"

packs/rackspace/config.schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
required: true
1717
debug:
1818
description: "Optional debug flag. Set to True to enable additional logging."
19-
type: "string"
19+
type: "boolean"
2020
secret: false
2121
required: false
2222
default: false

packs/salt/config.schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
default: pam
2323
verify_ssl:
2424
description: "Whether ST2 should verify the Salt NetAPI SSL certificate or not"
25-
type: "string"
25+
type: "boolean"
2626
secret: false
2727
required: false
2828
default: true

packs/sensu/config.schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
required: true
2323
ssl:
2424
description: "Whether ST2 should verify the Sensu API SSL certificate or not"
25-
type: "string"
25+
type: "boolean"
2626
secret: false
2727
required: false
2828
default: false

packs/vault/config.schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
required: false
1717
verify:
1818
description: "Whether to verify the SSL certificate or not"
19-
type: "string"
19+
type: "boolean"
2020
secret: false
2121
default: true

packs/victorops/config.schema.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
required: true
1212
debug:
1313
description: "Debug flag used for debugging"
14-
type: "string"
14+
type: "boolean"
1515
secret: false
1616
required: false
1717
default: false

0 commit comments

Comments
 (0)