cli/pkg
Snider 155251c8d9
Implement log retention policy (#306)
* Implement log retention policy

- Added Append method to io.Medium interface and implementations.
- Defined RotationOptions and updated log.Options to support log rotation.
- Implemented RotatingWriter in pkg/log/rotation.go with size and age-based retention.
- Updated Logger to use RotatingWriter when configured.
- Added comprehensive tests for log rotation and retention.
- Documented the log retention policy in docs/pkg/log.md and docs/configuration.md.
- Fixed MockMedium to return current time for Stat to avoid premature cleanup in tests.

* Fix formatting issues in pkg/io/local/client.go

The CI failed due to formatting issues. This commit fixes them and ensures all modified files are properly formatted.

* Fix auto-merge workflow CI failure

Inlined the auto-merge logic and added actions/checkout and --repo flag to gh command to provide the necessary git context. This resolves the 'fatal: not a git repository' error in CI.

* Address feedback on log retention policy

- Made cleanup synchronous in RotatingWriter for better reliability.
- Improved rotation error handling with recovery logic.
- Fixed size tracking to only increment on successful writes.
- Updated MockMedium to support and preserve ModTimes for age-based testing.
- Added TestRotatingWriter_AgeRetention and TestLogger_RotationIntegration.
- Implemented negative MaxAge to disable age-based retention.
- Updated documentation for clarity on Output priority and MaxAge behavior.
- Fixed typo in test comments.
- Fixed CI failure in auto-merge workflow.

---------

Co-authored-by: Claude <developers@lethean.io>
2026-02-05 10:26:32 +00:00
..
agentic Log all errors at handling point with contextual information (#321) 2026-02-05 07:52:25 +00:00
ai feat: infrastructure packages and lint cleanup (#281) 2026-02-04 11:34:43 +00:00
ansible Remove StrictHostKeyChecking=no from SSH commands (#315) 2026-02-05 07:09:34 +00:00
build Migrate pkg/build to io.Medium abstraction (#287) 2026-02-04 17:59:10 +00:00
cache chore(io): migrate pkg/cache to Medium abstraction (#288) 2026-02-04 15:15:46 +00:00
cli Log all errors at handling point with contextual information (#321) 2026-02-05 07:52:25 +00:00
collect feat: infrastructure packages and lint cleanup (#281) 2026-02-04 11:34:43 +00:00
config feat: infrastructure packages and lint cleanup (#281) 2026-02-04 11:34:43 +00:00
container Remove StrictHostKeyChecking=no from SSH commands (#315) 2026-02-05 07:09:34 +00:00
crypt Implement Authentication and Authorization Features (#314) 2026-02-05 06:55:50 +00:00
deploy feat: wire release command, add tar.xz support, unified installers (#277) 2026-02-04 00:49:57 +00:00
devops Remove StrictHostKeyChecking=no from SSH commands (#315) 2026-02-05 07:09:34 +00:00
framework feat: add tests for edge cases, error paths, and integration scenarios (#308) 2026-02-05 10:10:07 +00:00
git feat: git command, build improvements, and go fmt git-aware (#74) 2026-02-01 10:48:44 +00:00
gitea feat(gitea): add Gitea Go SDK integration and CLI commands (#324) 2026-02-04 21:12:12 +00:00
help feat(help): Implement full-text search (#294) 2026-02-05 10:26:16 +00:00
i18n fix(i18n): add British English verb forms and fix locale-dependent tests (#328) 2026-02-05 10:05:57 +00:00
io Implement log retention policy (#306) 2026-02-05 10:26:32 +00:00
log Implement log retention policy (#306) 2026-02-05 10:26:32 +00:00
mcp Add TCP transport for MCP server (#296) 2026-02-05 10:26:21 +00:00
plugin feat: infrastructure packages and lint cleanup (#281) 2026-02-04 11:34:43 +00:00
process Implement panic recovery and graceful service retrieval (#316) 2026-02-05 07:52:23 +00:00
rag style: fix gofmt formatting across all affected files (#279) 2026-02-04 01:27:01 +00:00
release Migrate pkg/build to io.Medium abstraction (#287) 2026-02-04 17:59:10 +00:00
repos Migrate pkg/repos to Medium abstraction (#291) 2026-02-04 18:03:54 +00:00
unifi Update README.md to reflect actual configuration management implementation (#310) 2026-02-05 10:05:56 +00:00
workspace feat: add tests for edge cases, error paths, and integration scenarios (#308) 2026-02-05 10:10:07 +00:00