feat(config): add AuditConfig and RotationConfig to Config#110
feat(config): add AuditConfig and RotationConfig to Config#110fohte merged 6 commits intofohte/audit-logfrom
AuditConfig and RotationConfig to Config#110Conversation
Add audit log configuration structures to the runok config model. AuditConfig holds enabled/path/rotation settings with sensible defaults (enabled=true, path=~/.local/share/runok/, retention_days=7). Config::merge() supports field-level override merging for audit settings across global, project, and local override config layers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello @fohte, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the application's configuration capabilities by integrating dedicated structures for audit log management. It allows users to define detailed audit settings, including enablement, log file paths, and rotation policies, directly within their Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## fohte/audit-log #110 +/- ##
===================================================
+ Coverage 89.89% 90.61% +0.72%
===================================================
Files 29 29
Lines 6183 6481 +298
===================================================
+ Hits 5558 5873 +315
+ Misses 625 608 -17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The default audit log path did not respect the XDG Base Directory Specification. Check XDG_DATA_HOME before falling back to $HOME/.local/share/runok/. Also remove audit_config_is_enabled_defaults_to_true which was already covered by the parameterized audit_config_is_enabled rstest. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Audit log configuration should not be overridable by project-level or local override configs, since there is no use case for per-project audit settings. The merge now preserves only the base (global) value and discards any audit section from project/local layers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Audit log configuration should not be overridable by project-level or local override configs. Instead of restricting this at the merge level (which would also block extends resolution from inheriting audit settings), enforce the restriction in the loader by stripping the audit field from project/local configs before merging. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously the loader silently stripped audit settings from project-level and local override configs. Now it emits a warning to stderr so users know their audit config is being ignored. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Previously, audit settings were stripped from project/local configs before extends resolution. This meant a project config using `extends` to reference a preset containing an `audit` section would still get that audit config merged in, bypassing the global-only restriction. Integrate `resolve_extends` into `DefaultConfigLoader::load()` so each config layer's extends are resolved first, then audit is stripped from the fully-resolved project/local configs. Also extract `strip_audit` helper to deduplicate the stripping logic.
Why
What
AuditConfigandRotationConfigtoConfigto support audit log settings inrunok.yml