Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,840 changes: 1,840 additions & 0 deletions docs/prd/file-scoped-locals.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,12 @@ var (
// Interactive prompt errors.
ErrInteractiveModeNotAvailable = errors.New("interactive mode not available")
ErrNoOptionsAvailable = errors.New("no options available")

// Locals-related errors.
ErrLocalsInvalidType = errors.New("locals must be a map")
ErrLocalsCircularDep = errors.New("circular dependency in locals")
ErrLocalsDependencyExtract = errors.New("failed to extract dependencies for local")
ErrLocalsResolution = errors.New("failed to resolve local")
)

// ExitCodeError is a typed error that preserves subcommand exit codes.
Expand Down
40 changes: 36 additions & 4 deletions examples/demo-context/schemas/atmos-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"settings": {
"$ref": "#/definitions/settings"
},
"locals": {
"$ref": "#/definitions/locals"
},
"components": {
"$ref": "#/definitions/components"
},
Expand Down Expand Up @@ -164,7 +167,7 @@
},
{
"type": "object",
"additionalProperties": false,
"additionalProperties": true,
"properties": {
"terraform": {
"$ref": "#/definitions/terraform_components"
Expand Down Expand Up @@ -204,6 +207,9 @@
"settings": {
"$ref": "#/definitions/settings"
},
"locals": {
"$ref": "#/definitions/locals"
},
"command": {
"$ref": "#/definitions/command"
},
Expand Down Expand Up @@ -276,6 +282,9 @@
"settings": {
"$ref": "#/definitions/settings"
},
"locals": {
"$ref": "#/definitions/locals"
},
"command": {
"$ref": "#/definitions/command"
},
Expand Down Expand Up @@ -323,6 +332,9 @@
"settings": {
"$ref": "#/definitions/settings"
},
"locals": {
"$ref": "#/definitions/locals"
},
"command": {
"$ref": "#/definitions/command"
},
Expand Down Expand Up @@ -380,6 +392,9 @@
"settings": {
"$ref": "#/definitions/settings"
},
"locals": {
"$ref": "#/definitions/locals"
},
"command": {
"$ref": "#/definitions/command"
}
Expand Down Expand Up @@ -409,6 +424,9 @@
"settings": {
"$ref": "#/definitions/settings"
},
"locals": {
"$ref": "#/definitions/locals"
},
"command": {
"$ref": "#/definitions/command"
},
Expand Down Expand Up @@ -466,6 +484,9 @@
"settings": {
"$ref": "#/definitions/settings"
},
"locals": {
"$ref": "#/definitions/locals"
},
"command": {
"$ref": "#/definitions/command"
}
Expand Down Expand Up @@ -685,6 +706,20 @@
}
]
},
"locals": {
"title": "locals",
"description": "File-scoped local variables for use within templates. Locals are resolved before other sections and can reference each other within the same file. Unlike vars and settings, locals do NOT inherit across file boundaries.",
"oneOf": [
{
"type": "string",
"pattern": "^!include"
},
{
"type": "object",
"additionalProperties": true
}
]
},
"backend_type": {
"title": "backend_type",
"description": "Backend type",
Expand Down Expand Up @@ -916,9 +951,6 @@
{
"type": "object",
"properties": {
"stack": {
"type": "string"
},
"namespace": {
"type": "string"
},
Expand Down
40 changes: 36 additions & 4 deletions examples/demo-helmfile/schemas/atmos-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"settings": {
"$ref": "#/definitions/settings"
},
"locals": {
"$ref": "#/definitions/locals"
},
"components": {
"$ref": "#/definitions/components"
},
Expand Down Expand Up @@ -164,7 +167,7 @@
},
{
"type": "object",
"additionalProperties": false,
"additionalProperties": true,
"properties": {
"terraform": {
"$ref": "#/definitions/terraform_components"
Expand Down Expand Up @@ -204,6 +207,9 @@
"settings": {
"$ref": "#/definitions/settings"
},
"locals": {
"$ref": "#/definitions/locals"
},
"command": {
"$ref": "#/definitions/command"
},
Expand Down Expand Up @@ -276,6 +282,9 @@
"settings": {
"$ref": "#/definitions/settings"
},
"locals": {
"$ref": "#/definitions/locals"
},
"command": {
"$ref": "#/definitions/command"
},
Expand Down Expand Up @@ -323,6 +332,9 @@
"settings": {
"$ref": "#/definitions/settings"
},
"locals": {
"$ref": "#/definitions/locals"
},
"command": {
"$ref": "#/definitions/command"
},
Expand Down Expand Up @@ -380,6 +392,9 @@
"settings": {
"$ref": "#/definitions/settings"
},
"locals": {
"$ref": "#/definitions/locals"
},
"command": {
"$ref": "#/definitions/command"
}
Expand Down Expand Up @@ -409,6 +424,9 @@
"settings": {
"$ref": "#/definitions/settings"
},
"locals": {
"$ref": "#/definitions/locals"
},
"command": {
"$ref": "#/definitions/command"
},
Expand Down Expand Up @@ -466,6 +484,9 @@
"settings": {
"$ref": "#/definitions/settings"
},
"locals": {
"$ref": "#/definitions/locals"
},
"command": {
"$ref": "#/definitions/command"
}
Expand Down Expand Up @@ -685,6 +706,20 @@
}
]
},
"locals": {
"title": "locals",
"description": "File-scoped local variables for use within templates. Locals are resolved before other sections and can reference each other within the same file. Unlike vars and settings, locals do NOT inherit across file boundaries.",
"oneOf": [
{
"type": "string",
"pattern": "^!include"
},
{
"type": "object",
"additionalProperties": true
}
]
},
"backend_type": {
"title": "backend_type",
"description": "Backend type",
Expand Down Expand Up @@ -916,9 +951,6 @@
{
"type": "object",
"properties": {
"stack": {
"type": "string"
},
"namespace": {
"type": "string"
},
Expand Down
40 changes: 36 additions & 4 deletions examples/demo-localstack/schemas/atmos-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"settings": {
"$ref": "#/definitions/settings"
},
"locals": {
"$ref": "#/definitions/locals"
},
"components": {
"$ref": "#/definitions/components"
},
Expand Down Expand Up @@ -164,7 +167,7 @@
},
{
"type": "object",
"additionalProperties": false,
"additionalProperties": true,
"properties": {
"terraform": {
"$ref": "#/definitions/terraform_components"
Expand Down Expand Up @@ -204,6 +207,9 @@
"settings": {
"$ref": "#/definitions/settings"
},
"locals": {
"$ref": "#/definitions/locals"
},
"command": {
"$ref": "#/definitions/command"
},
Expand Down Expand Up @@ -276,6 +282,9 @@
"settings": {
"$ref": "#/definitions/settings"
},
"locals": {
"$ref": "#/definitions/locals"
},
"command": {
"$ref": "#/definitions/command"
},
Expand Down Expand Up @@ -323,6 +332,9 @@
"settings": {
"$ref": "#/definitions/settings"
},
"locals": {
"$ref": "#/definitions/locals"
},
"command": {
"$ref": "#/definitions/command"
},
Expand Down Expand Up @@ -380,6 +392,9 @@
"settings": {
"$ref": "#/definitions/settings"
},
"locals": {
"$ref": "#/definitions/locals"
},
"command": {
"$ref": "#/definitions/command"
}
Expand Down Expand Up @@ -409,6 +424,9 @@
"settings": {
"$ref": "#/definitions/settings"
},
"locals": {
"$ref": "#/definitions/locals"
},
"command": {
"$ref": "#/definitions/command"
},
Expand Down Expand Up @@ -466,6 +484,9 @@
"settings": {
"$ref": "#/definitions/settings"
},
"locals": {
"$ref": "#/definitions/locals"
},
"command": {
"$ref": "#/definitions/command"
}
Expand Down Expand Up @@ -685,6 +706,20 @@
}
]
},
"locals": {
"title": "locals",
"description": "File-scoped local variables for use within templates. Locals are resolved before other sections and can reference each other within the same file. Unlike vars and settings, locals do NOT inherit across file boundaries.",
"oneOf": [
{
"type": "string",
"pattern": "^!include"
},
{
"type": "object",
"additionalProperties": true
}
]
},
"backend_type": {
"title": "backend_type",
"description": "Backend type",
Expand Down Expand Up @@ -916,9 +951,6 @@
{
"type": "object",
"properties": {
"stack": {
"type": "string"
},
"namespace": {
"type": "string"
},
Expand Down
Loading
Loading