Skip to content

direct: Fix processing of configs with dots in map keys#4977

Merged
denik merged 14 commits intomainfrom
denik/migrate-dots
Apr 15, 2026
Merged

direct: Fix processing of configs with dots in map keys#4977
denik merged 14 commits intomainfrom
denik/migrate-dots

Conversation

@denik
Copy link
Copy Markdown
Contributor

@denik denik commented Apr 15, 2026

Changes

When calculating the plan, direct engine users dyn.Walk to figure out where remaining references are. It is used dyn.Path.String() method which lost information for configuration with dots in map keys.

Fixed the plan to convert dyn.Path to structpath.PathNode directly which preserves nodes.

Why

Fixes #4960

Tests

New dedicate test that shows that this type of config did not work on direct engine (even without migration).
New invariant test config with dots in maps keys to test the migration and other scenarios.

denik added 10 commits April 15, 2026 13:30
Add pipeline_config_dots.yml.tmpl that exercises:
- Dots in pipeline configuration map keys (europris.swipe.*, europris.azure.*)
- Cross-resource references in values (resources.schemas.my_schema.*)
- Complex variable field access with dots (var.AZURE.subscription)

Task: 001.md

Co-authored-by: Isaac
Keys containing dots (e.g., "europris.swipe.egress_streaming_schema")
were serialized without escaping, making them indistinguishable from
nested paths when re-parsed. Now uses bracket notation ['key.with.dots']
for such keys. Also adds bracket notation parsing to NewPathFromString
so the string representation roundtrips correctly.

Task: 001.md

Co-authored-by: Isaac
Task: 001.md

Co-authored-by: Isaac
Dotted pipeline configuration keys are not supported by CLI v0.293.0,
so exclude the pipeline_config_dots.yml.tmpl config from the
continue_293 test variant.

Task: 003.md

Co-authored-by: Isaac
This reverts commit c77d25a8a2b51b656b63850fc682217f3ab33ea0.
This reverts commit ba72217472b15637881c3e453fc75a55470638b4.
Move the fix for dotted map keys (e.g. "europris.swipe.egress_streaming_schema")
from libs/dyn/Path.String() to the specific boundary in bundle_plan.go where
dyn.Path strings are consumed by structpath.ParsePath.

The new dynPathToStructPath() helper converts dyn.Path to structpath.PathNode
using NewBracketString, which already handles dotted keys correctly with
['key.with.dots'] notation. This avoids modifying the core dyn.Path API and
keeps the fix localized to the direct engine's extractReferences function.

Revert the previous changes to libs/dyn (bracket notation in Path.String() and
NewPathFromString) since they are no longer needed.

Add acceptance test confirming both terraform and direct engines handle dotted
pipeline configuration keys correctly.

Co-authored-by: Isaac
@denik denik force-pushed the denik/migrate-dots branch from 777458a to abc77a0 Compare April 15, 2026 11:43
denik added 4 commits April 15, 2026 13:44
…hars

Keys without dots or brackets use NewDotString for normal path segments;
only fall back to NewBracketString when the key itself contains '.' or '['.

Co-authored-by: Isaac
Delegate dot-vs-bracket logic to NewStringKey instead of reimplementing
it inline, keeping the call site simple.

Co-authored-by: Isaac
}
// Store the original string that contains references, not individual references
refs[p.String()] = ref.Str
// Store the original string that contains references, not individual references.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is a bit confusing, what is the difference between "references" and "individual references"?

@denik denik added this pull request to the merge queue Apr 15, 2026
Merged via the queue into main with commit 00de70c Apr 15, 2026
24 checks passed
@denik denik deleted the denik/migrate-dots branch April 15, 2026 13:18
deco-sdk-tagging bot added a commit that referenced this pull request Apr 15, 2026
## Release v0.297.0

### CLI
* Auth commands now accept a profile name as a positional argument ([#4840](#4840))

* Add `auth logout` command for clearing cached OAuth tokens and optionally removing profiles ([#4613](#4613), [#4616](#4616), [#4647](#4647))

### Bundles
* Added support for lifecycle.started option for apps ([#4672](#4672))
* engine/direct: Fix permissions for resources.models ([#4941](#4941))
* Fix resource references not correctly resolved in apps config section ([#4964](#4964))
* Allow run_as for dashboards with embed_credentials set to false ([#4961](#4961))
* direct: Pass changed fields into update mask for apps instead of wildcard ([#4963](#4963))
* engine/direct: Fix deploy of configurations with dots in maps keys ([#4977](#4977))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bundle deployment migrate: dotted keys in DLT pipeline configuration map cause 'key not found in map' error

2 participants