Skip to content

feat: admin audit log (v1.4)#106

Merged
eclectic-coding merged 4 commits into
mainfrom
feat/admin-audit-log
May 28, 2026
Merged

feat: admin audit log (v1.4)#106
eclectic-coding merged 4 commits into
mainfrom
feat/admin-audit-log

Conversation

@eclectic-coding
Copy link
Copy Markdown
Owner

Summary

  • AuditEvent modelsolid_stack_web_audit_events table with 8 action types; opt-in via rails solid_stack_web:install:migrations
  • MigrationsGenerator — new rails solid_stack_web:install:migrations generator produces the migration
  • config.current_actor block — identify who performed each action (runs in controller context)
  • Recording wired inJobsController, FailedJobsController, Queues::PausesController, FailedJobs::SelectionsController, Jobs::SelectionsController; gracefully swallows errors so missing migration never breaks the dashboard
  • AuditController — HTML + CSV responses; filters by action, actor, and queue; redirects with a helpful message if migration hasn't been run
  • View — badge-coloured actions, actor/queue filter links, pagination, CSV export button, "Audit" link in Queue subnav
  • Dummy app — seeded with 12 events covering all 8 action types
  • Fixesfilter_persist_controller pinned in importmap (was missing since v1.2.0); spec/dummy/log/ fully gitignored to prevent rotated log files being committed

Test plan

  • 17 new request specs covering rendering, all three filter types, CSV export, and audit recording
  • Full suite: 397 examples, 0 failures, rubocop clean

🤖 Generated with Claude Code

eclectic-coding and others added 4 commits May 28, 2026 08:38
Records who retried, discarded, or paused what and when. Requires
opt-in migration via `rails solid_stack_web:install:migrations`.

- AuditEvent model (solid_stack_web_audit_events table) with 8 actions
- record_audit / resolve_current_actor helpers in ApplicationController
- new config.current_actor block for actor identity
- Recording wired into JobsController, FailedJobsController,
  Queues::PausesController, FailedJobs::SelectionsController,
  Jobs::SelectionsController
- AuditController with HTML + CSV responses, filters by action/actor/queue
- Audit view with badge-coloured actions, actor/queue filter links
- MigrationsGenerator for host-app migration installation
- Audit nav link added to Queue subnav
- 17 new request specs + dummy schema updated

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
filter_persist_controller was imported in application.js but never
pinned, causing a browser module resolution error in the dummy app.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds 12 audit events covering all 8 action types across multiple actors
and queues, with realistic timestamps for manual testing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eclectic-coding eclectic-coding merged commit 5345971 into main May 28, 2026
4 checks passed
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 89.55224% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.65%. Comparing base (add0914) to head (d08933a).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
...trollers/solid_stack_web/application_controller.rb 70.00% 3 Missing ⚠️
...pp/controllers/solid_stack_web/audit_controller.rb 92.85% 2 Missing ⚠️
app/helpers/solid_stack_web/application_helper.rb 66.66% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #106      +/-   ##
==========================================
- Coverage   99.46%   98.65%   -0.82%     
==========================================
  Files          39       41       +2     
  Lines         749      815      +66     
==========================================
+ Hits          745      804      +59     
- Misses          4       11       +7     
Files with missing lines Coverage Δ
...lid_stack_web/failed_jobs/selections_controller.rb 100.00% <100.00%> (ø)
...trollers/solid_stack_web/failed_jobs_controller.rb 100.00% <100.00%> (ø)
...lers/solid_stack_web/jobs/selections_controller.rb 100.00% <100.00%> (ø)
app/controllers/solid_stack_web/jobs_controller.rb 100.00% <100.00%> (ø)
...ollers/solid_stack_web/queues/pauses_controller.rb 100.00% <100.00%> (ø)
app/models/solid_stack_web/audit_event.rb 100.00% <100.00%> (ø)
lib/solid_stack_web.rb 100.00% <100.00%> (ø)
...pp/controllers/solid_stack_web/audit_controller.rb 92.85% <92.85%> (ø)
app/helpers/solid_stack_web/application_helper.rb 97.80% <66.66%> (-2.20%) ⬇️
...trollers/solid_stack_web/application_controller.rb 84.09% <70.00%> (-4.49%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants