generated from masterpointio/terraform-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: adds the runtime_overrides variable + tests #44
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c0c394e
feat: adds the runtime_overrides variable + tests
Gowiem f593f32
feat: changes type to any and uses jsonschema_validate
Gowiem 486251b
test: adds tests for validating schema
Gowiem c4c5d7e
chore: add tf-docs trunk action + config
Gowiem 015a4ad
chore: updates README with tf-docs
Gowiem f18df2b
chore: appease markdownlint
Gowiem 7f3991f
chore: removes pre-commit-config
Gowiem f10649e
fix: use bpedman/jsonschema in tofu too
Gowiem 66b4999
fix: space_id is a string, not a number
Gowiem 61d8cdf
Merge branch 'main' of github.com:masterpointio/terraform-spacelift-a…
Gowiem ad28e72
chore: update README with space_name var
Gowiem 32b7454
fix: add space_name to schema + fix space_id test
Gowiem 6f3e0ec
feat: test that overrides have no impact on existing stack_configs (#48)
westonplatter 83e43c0
Merge branch 'main' into feature/runtime-overrides
Gowiem 14f253a
ci: see if trunk 1.22.8 addresses CI failure
Gowiem File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
formatter: markdown table | ||
|
||
recursive: | ||
enabled: false | ||
path: modules | ||
include-main: true | ||
|
||
output: | ||
file: README.md | ||
mode: inject | ||
template: |- | ||
<!-- BEGIN_TF_DOCS --> | ||
{{ .Content }} | ||
<!-- END_TF_DOCS --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
# Look up all spaces in order to map space names to space IDs | ||
data "spacelift_spaces" "all" {} | ||
|
||
# Validate the runtime overrides against the schema | ||
# Frustrating that we have to do this, but this successfully validates the typing | ||
# of the given runtime overrides since we need to use `any` for the variable type :( | ||
# See https://github.com/masterpointio/terraform-spacelift-automation/pull/44 for full details | ||
data "jsonschema_validator" "runtime_overrides" { | ||
for_each = var.runtime_overrides | ||
|
||
document = jsonencode(each.value) | ||
schema = "${path.module}/stack-config.schema.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
"title": "Masterpoint Stack Config schema. Version 1.0. https://masterpoint.io", | ||
"description": "Schema for Masterpoint's spacelift-automation stack configuration files. This is used to override stack configurations for the https://github.com/masterpointio/terraform-spacelift-automation module.", | ||
"type": "object", | ||
"required": ["kind", "stack_settings"], | ||
"required": [], | ||
"properties": { | ||
"kind": { | ||
"type": "string", | ||
|
@@ -174,6 +174,10 @@ | |
"type": "string", | ||
"description": "Spacelift space ID" | ||
}, | ||
"space_name": { | ||
"type": "string", | ||
"description": "Spacelift space name, this will be translated to a space_id. Mutually exclusive with space_id" | ||
}, | ||
Comment on lines
+177
to
+180
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ty 🙏 |
||
"terraform_smart_sanitization": { | ||
"type": "boolean", | ||
"description": "Whether to enable smart sanitization" | ||
|
39 changes: 36 additions & 3 deletions
39
tests/fixtures/multi-instance/root-module-a/stacks/default-example.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
kind: StackConfigV1 | ||
stack_settings: | ||
space_id: direct-space-id-stack-yaml # Tests direct space_id precedence over global variable space_id | ||
labels: | ||
- test_label | ||
space_id: direct-space-id-stack-yaml # Tests direct space_id precedence over global variable space_id |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice cleanup consolidation