Commit graph

3 commits

Author SHA1 Message Date
Snider
b3115a12a7 refactor: update package imports from cli to go
Some checks are pending
Security Scan / Go Vulnerability Check (push) Waiting to run
Security Scan / Secret Detection (push) Waiting to run
Security Scan / Dependency & Config Scan (push) Waiting to run
2026-02-16 13:53:54 +00:00
Claude
52d358daa2 refactor: rename module from github.com/host-uk/core to forge.lthn.ai/core/cli
Move module identity to our own Forgejo instance. All import paths
updated across 434 Go files, sub-module go.mod files, and go.work.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 05:53:52 +00:00
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