Azure / Azure/azure-dev

config.json Save() should use atomic write pattern

Open
#7,912 0 comments 0 reactions 0 assignees View on GitHub
area/environment enhancement
Dominant language
Go
Stars
569
Forks
364
Avg merge
2d 19h
Merged PRs (30d)
136

Description

## Context
`config.json` writes use direct `os.WriteFile` which can produce torn reads if the process is interrupted mid-write. The environment package already has `WriteFileAtomic` (write-to-temp + rename) for `.env` files.

## Proposal
Apply the same atomic write pattern to `config.json` saves. Depends on #WriteFileAtomic being available in a shared location (see companion issue for hoisting to pkg/osutil).

## References
- PR #7776 follow-up from concurrency review

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.