Repository navigation
Plan creates with diffs, and apply the deletes of an emptied folder - #149
Merged
Merged
Conversation
This was referenced Oct 6, 2026
99-not-out
added this pull request to stack #150
October 6, 2026 16:12
99-not-out
marked this pull request as ready for review
October 6, 2026 16:16
99-not-out
force-pushed
the
fix/plan-diffs-and-empty-folders
branch
2 times, most recently
from
October 7, 2026 08:57
d78c38f to
7203de1
Compare
BStarmerSmith
approved these changes
Oct 7, 2026
99-not-out
force-pushed
the
fix/plan-diffs-and-empty-folders
branch
from
October 7, 2026 09:20
7203de1 to
d2d19c7
Compare
achever1
approved these changes
Oct 7, 2026
apply --print-diff fetched the current resource to diff against and failed when there was none, so a dry run planning any create failed. A resource not found is now diffed against nothing. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B464sFQc8q6VkehfkByBaX
apply -r with state stopped at "No resources found to apply" before working out the state's deletes, so removing the last file of a folder never deleted what it described. With state enabled an empty folder now deletes everything the state manages that is no longer there. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B464sFQc8q6VkehfkByBaX
The diff printed by --print-diff did not end with a newline, so the
result line that followed ("Topic/x: Created") was glued to it and lost
to anything reading the output line by line.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01B464sFQc8q6VkehfkByBaX
99-not-out
force-pushed
the
fix/plan-diffs-and-empty-folders
branch
from
October 7, 2026 10:42
d2d19c7 to
c4436fe
Compare
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.
Stacked on #148.
What & why
Running
apply -r --enable-stateas a GitOps plan and apply turned up three smaller problems:--print-difffailed for anything the Console did not have yet (could not find any matching resource), so no dry run that creates a resource could print diffs. A resource not found is now diffed against nothing.No resources found to applycame first, so removing the last file never deleted what it described. With state enabled, the deletes now run first.Topic/x: Created. It now starts its own line.Changes
ErrResourceNotFoundfrom the Console and Gateway clients' lookup; diff mode treats it as "nothing there yet".Notes
--enable-state, applying an empty folder now deletes everything the state manages for it. That is what removing the files means, but a mistakenly emptied folder now deletes too.--print-diffon a new topic prints the diff andCreated; an emptied folder deletes its topic.make lintreports only the two existingunparamfindings incmd/template.go.