Skip to content

Added --simulate-json option to write the changed files of a simulate run as JSON - #6526

Open
djbclark wants to merge 1 commit into
cfengine:masterfrom
djbclark:simjson-1-files-r2
Open

djbclark wants to merge 1 commit into
cfengine:masterfrom
djbclark:simjson-1-files-r2

Conversation

@djbclark

Copy link
Copy Markdown
Contributor

With --simulate-json=FILE, a --simulate run also writes the changed files (path, created/modified/deleted, type) to FILE as one JSON document. This replaces the closed #6294. This first part is as small as I could make it; the rest is split into much smaller follow-up PRs:

Part Adds C lines Test lines
1 (this PR) changed files, written safely +182 +234
2 renames +29/−2 +27/−2
3 owner, group, permissions, size, SHA-256 +40 +23/−3
4 symlink targets +10 +1

I reviewed the logic with AI help and cannot vouch for the C; the unit and acceptance tests and CI are the correctness case.

… run as JSON

With --simulate-json=FILE, cf-agent also writes the changed files of a
--simulate run to FILE as one JSON document; renames are not covered yet.

Ticket: none
Changelog: Title
Signed-off-by: Daniel JB Clark <djbclark@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@cf-bottom

Copy link
Copy Markdown

Thanks for submitting a PR! Maybe @craigcomstock can review this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants