Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move all audit logging to templates #1709

Merged
merged 8 commits into from
Jan 22, 2025

Conversation

elinol
Copy link
Contributor

@elinol elinol commented Dec 18, 2024

Moves all audit logging to the template module.

One exception is in the function Devices.update_device_with_audit/4 where the audit log description is passed via the updating action (like tag_devicefor example). I don't know if it's worth it adding this to templates, since the templates themselves (the description) are defined outside the templates module. Any input on this is welcomed!

@elinol elinol force-pushed the move-auditlogging-to-templates branch from 86a718e to 751fa5b Compare December 28, 2024 18:25
lib/nerves_hub/devices.ex Outdated Show resolved Hide resolved
@@ -1091,6 +1070,7 @@ defmodule NervesHub.Devices do
{:ok, updated}

err ->
Logger.warning("Could not move device: #{inspect(err)}")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this be logged to sentry as well? @joshk

@elinol elinol force-pushed the move-auditlogging-to-templates branch from 751fa5b to ca603f7 Compare January 8, 2025 14:02
@elinol elinol marked this pull request as ready for review January 8, 2025 14:10
lib/nerves_hub/audit_logs/templates.ex Outdated Show resolved Hide resolved
lib/nerves_hub/devices.ex Outdated Show resolved Hide resolved
Copy link
Contributor

@nshoes nshoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you!

@elinol elinol changed the title Move all audit logging in templates Move all audit logging to templates Jan 16, 2025
@elinol elinol force-pushed the move-auditlogging-to-templates branch from 4157586 to e4ef887 Compare January 21, 2025 12:25
@elinol elinol force-pushed the move-auditlogging-to-templates branch from 3d8e541 to 0ee4737 Compare January 22, 2025 08:24
Copy link
Collaborator

@joshk joshk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOVE LOVE LOVE THIS PR

THE CONSISTENCY IS FANTASTIC, THE ENCAPSULATION, THE CLEANING

Thank you!

@joshk joshk merged commit 2247682 into nerves-hub:main Jan 22, 2025
2 checks passed
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.

3 participants