Skip to content

ENG-2782 - Add include_total query param to /tree and monitor name t…#7765

Open
vcruces wants to merge 2 commits intomainfrom
ENG-2782
Open

ENG-2782 - Add include_total query param to /tree and monitor name t…#7765
vcruces wants to merge 2 commits intomainfrom
ENG-2782

Conversation

@vcruces
Copy link
Copy Markdown
Contributor

@vcruces vcruces commented Mar 26, 2026

…o the integrations tray

Ticket ENG-2782

Description Of Changes

Frontend updates to support the improved cursor pagination in the /tree endpoint. Passes include_total: false explicitly to skip the COUNT query on all tree navigation calls, taking advantage of the performance improvement introduced in fidesplus #3305.

Also improves the monitor failure log drawer title to include the monitor name for better context.

Code Changes

  • Added include_total parameter to the getMonitorTree RTK Query endpoint in action-center.slice.ts
  • Passed include_total: false on all three tree fetch calls in MonitorTree.tsx
  • Changed failure log drawer title from "Failure log" to "${monitor.name} - Failure log" in MonitorStatusCell.tsx

Steps to Confirm

  1. Open Action Center and navigate a monitor tree. Verify pagination works and the requests send include_total=false.
  2. Open a monitor's failure log drawer and confirm the title includes the monitor name

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Mar 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
fides-plus-nightly Ignored Ignored Preview Mar 27, 2026 3:21pm
fides-privacy-center Ignored Ignored Mar 27, 2026 3:21pm

Request Review

open={isOpen}
onClose={() => setIsOpen(false)}
title="Failure log"
title={`${monitor.name} - Failure log`}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is an unrelated change. It came up in a recent pod check-in that not including the monitor name could cause confusion when an integration has multiple monitors.

This is a minimal change to add some context, but we can improve it in a future iteration

@vcruces vcruces force-pushed the ENG-2782 branch 2 times, most recently from 9ab6ec0 to 935e7ca Compare March 27, 2026 11:44
@vcruces vcruces requested a review from speaker-ender March 27, 2026 15:19
@vcruces vcruces marked this pull request as ready for review March 27, 2026 15:19
@vcruces vcruces requested a review from a team as a code owner March 27, 2026 15:19
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Code Review

Clean, well-scoped PR. Changes are minimal and correctly implement the performance improvement by passing include_total: false on all three tree fetch call sites in MonitorTree.tsx.

Correctness

  • All three tree fetch paths (initial expand, load-more/pagination, root load) are updated consistently — no missed call sites.
  • monitor.name is typed as a required non-nullable string in MonitorStatusResponse, so the template literal in the drawer title is safe.
  • RTK Query correctly omits undefined params from the request, so omitting include_total at call sites won't break anything today.

Suggestion

The one thing worth hardening: include_total defaults to undefined in the query type, which means a future call site that forgets to pass include_total: false will silently trigger the COUNT query again. Since the intent is always to skip it, consider defaulting include_total to false in the query destructor inside the slice (see inline comment). This makes the safe behavior the default without requiring every caller to opt in explicitly.

Testing

No tests were added, but the changes are a thin pass-through of a query parameter — the logic lives in the backend. The existing test coverage for MonitorTree and the RTK Query endpoint should be sufficient. The drawer title change (MonitorStatusCell.tsx) is equally trivial and matches a required-string field in the type.

staged_resource_urn?: string;
include_descendant_details?: boolean;
diff_status?: DiffStatus[];
include_total?: boolean;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The parameter is typed as boolean | undefined, so any future call site that omits include_total will silently default to whatever the backend's default is (presumably true, which triggers the COUNT query). Since the entire motivation of this PR is to skip COUNT queries, consider defaulting to false here in the slice instead:

include_total?: boolean; // default: false at call sites

Or alternatively, set the default in the query destructor:

include_total = false,

That way new call sites are safe by default without having to remember to pass include_total: false explicitly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The backend defaults this to false if it’s not provided

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.

1 participant