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

Add "Event Scope" and "Include Children" to Instance Audit Logs #4753

Merged
merged 9 commits into from
Nov 20, 2024

Conversation

Steve-Mcl
Copy link
Contributor

@Steve-Mcl Steve-Mcl commented Nov 11, 2024

closes #4750
closes #4751

Description

Adds "Event Scope" and "Include Children" to Instance Audit Logs

NOTE This merges into #4749. To keep #4749 manageable, we should probably not merge this in until that one is approved (but feel free to review and approve this up-front)

NOTE2 This also inadvertently fixes #4751
image

In action UPDATED to include associations as per discussion in #4749 comments

chrome_XA4vdFLv8z

Tests added

  Audit model
    static methods
      buildScopeClause
        for Project
          ✔ should return clause scoped for project only
          ✔ should return clause scoped for devices only
          ✔ should return clause scoped for project and all children

  3 passing (3s)

Related Issue(s)

Owner: #4750
Parent: #4684

Checklist

  • I have read the contribution guidelines
  • Suitable unit/system level tests have been added and they pass
  • Documentation has been updated
    • Upgrade instructions
    • Configuration details
    • Concepts
  • Changes flowforge.yml?
    • Issue/PR raised on FlowFuse/helm to update ConfigMap Template
    • Issue/PR raised on FlowFuse/CloudProject to update values for Staging/Production

Labels

  • Includes a DB migration? -> add the area:migration label

@Steve-Mcl Steve-Mcl changed the base branch from main to 4746-team-audit-log November 11, 2024 13:25
@Steve-Mcl Steve-Mcl requested a review from joepavitt November 11, 2024 13:27
Copy link

codecov bot commented Nov 11, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Project coverage is 78.72%. Comparing base (650d303) to head (3c1c5bc).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
forge/db/models/AuditLog.js 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4753      +/-   ##
==========================================
+ Coverage   78.65%   78.72%   +0.07%     
==========================================
  Files         314      314              
  Lines       15050    15053       +3     
  Branches     3456     3457       +1     
==========================================
+ Hits        11838    11851      +13     
+ Misses       3212     3202      -10     
Flag Coverage Δ
backend 78.72% <66.66%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@joepavitt
Copy link
Contributor

Will hold off reviewing until the underling branch has a PR, as I'd like to take a look at that context/basis of this branch too.

@Steve-Mcl
Copy link
Contributor Author

Steve-Mcl commented Nov 11, 2024

Will hold off reviewing until the underling branch has a PR.

Not sure what you mean Joe?

The base branch PR is here: #4749 (issue: #4746)

@joepavitt
Copy link
Contributor

Not sure what you mean Joe?

Ah, did go looking but didn't find it, thanks for clarifying Steve

@Steve-Mcl
Copy link
Contributor Author

@joepavitt I've merged the changes from the base branch and applied the same edits to include the router-link in the audit log. I've updated this PRs 1st post to reflect.

@joepavitt
Copy link
Contributor

Approved, committed some minor amendments to pluralise the labels for "Scope", but not merging as waiting on #4749

Base automatically changed from 4746-team-audit-log to main November 20, 2024 09:32
@Steve-Mcl Steve-Mcl merged commit 5475a81 into main Nov 20, 2024
13 checks passed
@Steve-Mcl Steve-Mcl deleted the 4750-proj-audit-incl-children branch November 20, 2024 10:38
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.

Project audit Log users not listed Project Audit Log to have include children option
2 participants