Skip to content

--simulate-json: consider recording run identity (start time, pid) in the document #32

Open

Description

@djbclark

Deferred from the #27 review, 2026-09-30.

A run that fails before the JSON write leaves an earlier run's FILE in place. CFEngine's practice, followed here, is to leave the old file, write atomically, and signal failure through the exit status. cf-net get -o, cf-promises -T, cf-secret and cf-runagent all behave that way.

A cheap extra safeguard: put the run's start time and pid in the document, so a consumer can detect an old file without trusting the exit code. cf-monitord's env_data sets the precedent there: its reader checks the file's age. About 5 lines. Not done now to keep the upstream PRs small.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions