fix(workflow): follow identifier renames through downstream references#2612
Open
simlarsen wants to merge 1 commit into
Open
fix(workflow): follow identifier renames through downstream references#2612simlarsen wants to merge 1 commit into
simlarsen wants to merge 1 commit into
Conversation
Renaming a step's identifier used to silently break every downstream
reference to it — the {{local.components.<id>.returnValues.<rv>}} tokens still
pointed at the old id (now visible as red "broken reference" chips). This
rewrites them automatically on save.
- Pure renameComponentReferences(nodes, oldId, newId) rewrites the tokens in
every argument string. Matching includes the trailing ".returnValues." so an
id that's a prefix of another (slack-1 vs slack-10) is never mis-rewritten;
unchanged nodes are returned by reference; no-op when the id is unchanged.
- Wired into the settings panel's save path in Workflow.tsx: when the saved id
differs from the one the panel opened with, the cascade runs across the
graph.
Tests: rename rewrites a downstream ref, prefix-collision safety, multiple
occurrences per value, no-op cases, and untouched nodes kept by reference. 87
workflow tests pass; tsc + eslint clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A correctness fix: renaming a step no longer silently breaks references to it. Stacked on #2611.
Problem
Renaming a step's identifier left every downstream
{{local.components.<id>.returnValues.<rv>}}token pointing at the old id — a silent breakage (now visible as the red "broken reference" chips from #2604, but still broken).Fix
Renames now cascade automatically on save.
renameComponentReferences(nodes, oldId, newId)rewrites the tokens in every argument string. Matching includes the trailing.returnValues.so an id that's a prefix of another (slack-1vsslack-10) is never mis-rewritten; unchanged nodes are returned by reference; it's a no-op when the id is unchanged/empty.Workflow.tsx: when the saved id differs from the one the panel opened with, the cascade runs across the graph (and autosaves).Verification
renameComponentReferences(5 tests): rewrites a downstream ref; prefix-collision safety (slack-1rename leavesslack-10alone); multiple occurrences in one value; no-op for unchanged/empty id; untouched nodes kept by reference.tsc✓,eslint✓.🤖 Generated with Claude Code