Skip to content

Fix notification & audit trail for dataclip retention policy changes - #5089

Open
taylordowns2000 wants to merge 4 commits into
mainfrom
data-retention-policy-notification
Open

Fix notification & audit trail for dataclip retention policy changes#5089
taylordowns2000 wants to merge 4 commits into
mainfrom
data-retention-policy-notification

Conversation

@taylordowns2000

@taylordowns2000 taylordowns2000 commented Aug 22, 2026

Copy link
Copy Markdown
Member

Description

This PR fixes #5088 by checking for a change in the retention_policy when deciding whether to send the policy change alert. The new functionality in this PR:

  1. should properly send the email (not stay silent on critical changes!)
  2. should not send misleading information about i/o retention periods when the i/o policy is set to :erase_all

The PR also fixes #5090 (the audit trial) in exactly the same fashion.

Validation steps

  1. Change only the retention policy, don't touch the retention periods.
  2. See the email.
  3. Log in as a super user.
  4. Check the audit trail.
  5. See the appended audit trail entry.

AI Usage

Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):

  • I have used Claude Code
  • I have used another model
  • I have not used AI

You can read more details in our
Responsible AI Policy

Pre-submission checklist

  • I have performed an AI review of my code (we recommend using /review
    with Claude Code)
  • I have implemented and tested all related authorization policies.
    (e.g., :owner, :admin, :editor, :viewer)
  • I have updated the changelog.
  • I have ticked a box in "AI usage" in this PR

@github-project-automation github-project-automation Bot moved this to New Issues in Core Aug 22, 2026
@github-actions

Copy link
Copy Markdown

Security Review ✅

  • S0 (project scoping): N/A — the change only extends which changeset keys (:retention_policy) trigger an existing notification helper inside Projects.update_project; no new queries or web-layer entrypoints.
  • S1 (authorization): N/A — no new controllers, LiveView events, or policy-gated actions; caller authorization for update_project is unchanged.
  • S2 (audit trail): PASS — retention-policy changes are still audited via the pre-existing Audit.derive_events(changeset, user) step at lib/lightning/projects.ex:617; this PR only affects email notifications.

Comment thread lib/lightning/projects.ex

defp retention_setting_updated?(changeset) do
Map.has_key?(changeset.changes, :history_retention_period) or
Map.has_key?(changeset.changes, :retention_policy) or

@taylordowns2000 taylordowns2000 Aug 22, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

we didn't count changing the policy as part of the retention_setting_updated? function

@taylordowns2000 taylordowns2000 changed the title Fix notification when dataclip retention policy changes Fix notification & audit trail for dataclip retention policy changes Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New Issues

Development

Successfully merging this pull request may close these issues.

Audit trail not updated when I/O retention policy changes Email not sent when I/O data retention policy changes

1 participant