• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 21707748264

05 Feb 2026 10:21AM UTC coverage: 60.837% (-0.02%) from 60.852%
21707748264

push

github

web-flow
Extract atomic file write utility to shared fileutils package (#3613)

The atomicWriteFile function was previously defined in pkg/workloads/statuses/file_status.go
and used only for status file writes. This refactoring extracts it to a new pkg/fileutils package
as AtomicWriteFile, making it reusable across the codebase.

Changes:
- Create new pkg/fileutils package with AtomicWriteFile function
- Move atomic write tests to pkg/fileutils/atomic_test.go
- Update pkg/client/config_editor.go to use fileutils.AtomicWriteFile for JSON/YAML config writes
- Update pkg/workloads/statuses/file_status.go to use fileutils.AtomicWriteFile for status writes
- Remove duplicate atomicWriteFile implementation and tests from file_status.go

This improves code reusability and ensures consistent atomic write behavior across all file operations
(config files, status files) preventing partial writes during concurrent access or system failures.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

28 of 41 new or added lines in 3 files covered. (68.29%)

12 existing lines in 4 files now uncovered.

40998 of 67390 relevant lines covered (60.84%)

79.36 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

79.58
/pkg/transport/proxy/httpsse/http_proxy.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc