Skip to content

fix: load settings plugins from database#3053

Open
adityathebe wants to merge 2 commits into
mainfrom
plugins-from-database
Open

fix: load settings plugins from database#3053
adityathebe wants to merge 2 commits into
mainfrom
plugins-from-database

Conversation

@adityathebe

@adityathebe adityathebe commented Jun 25, 2026

Copy link
Copy Markdown
Member

Settings → Plugins was still fetching from the runtime plugin registry.

The persisted plugins table is now the source of truth for configured plugins, so the page now reads non-deleted plugin rows from PostgREST instead. The UI maps DB fields into the existing listing shape and shows namespace/source/version from the stored plugin spec/status.

Summary by CodeRabbit

  • New Features

    • The plugins page now shows plugin namespace and source details.
    • Plugin records are displayed using a richer backend-aligned structure, including version and timestamp information.
  • Bug Fixes

    • Plugin version and description are now populated more reliably from available plugin data.
    • Remote plugin detection and upgrade messaging now use the updated source information for more accurate guidance.

The Settings plugins page still read from the runtime plugin registry, which no longer reflects the persisted source of truth for configured plugins.

Fetch non-deleted plugin rows from the plugins table through PostgREST and map stored spec/status fields into the listing used by the page.
@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
aws-preview Ready Ready Preview Jun 25, 2026 12:58pm
flanksource-ui Ready Ready Preview Jun 25, 2026 12:58pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@adityathebe, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 55 minutes and 6 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 78878400-2aaf-43ce-8205-0d95ab20eb8e

📥 Commits

Reviewing files that changed from the base of the PR and between 0e9fb90 and 9b5922b.

📒 Files selected for processing (1)
  • src/pages/Settings/PluginsPage.tsx

Walkthrough

Plugin listings now use a backend-oriented schema and a database-backed fetch. The settings page updates remote-plugin detection, tooltip text, visible columns, and query wiring to match the new plugin data shape.

Changes

Plugin listing and settings page

Layer / File(s) Summary
Backend plugin schema and fetch
src/api/services/plugins.ts
PluginSpec and PluginListing are redefined, and getPlugins now queries ConfigDB with explicit fields, filters deleted rows, and normalizes description and version.
Settings page fields and query
src/pages/Settings/PluginsPage.tsx
Remote-plugin detection uses spec.address, the tooltip text changes, the table shows Namespace and Source, and useQuery now calls getPlugins with the database cache key.

Sequence Diagram(s)

sequenceDiagram
  participant PluginsPage
  participant getPlugins
  participant ConfigDB
  PluginsPage->>getPlugins: useQuery runs queryFn
  getPlugins->>ConfigDB: ConfigDB.get(select, deleted_at filter, order)
  ConfigDB-->>getPlugins: plugin rows
  getPlugins-->>PluginsPage: normalized PluginListing[]
Loading

Possibly related PRs

Suggested reviewers

  • moshloop
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: Settings → Plugins now loads persisted plugin data from the database instead of the runtime registry.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch plugins-from-database
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch plugins-from-database

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/pages/Settings/PluginsPage.tsx`:
- Around line 110-115: The "Source" column accessor in PluginsPage is reading
only from spec.source and spec.address, so it misses the persisted top-level
source field on PluginListing. Update the column definition in PluginsPage so
the accessorFn checks row.source first, then falls back to row.spec?.source and
row.spec?.address, preserving the existing empty-string fallback.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a736002f-f62a-41ca-82c3-456a29777f70

📥 Commits

Reviewing files that changed from the base of the PR and between 0879030 and 0e9fb90.

📒 Files selected for processing (2)
  • src/api/services/plugins.ts
  • src/pages/Settings/PluginsPage.tsx

Comment on lines 110 to 115
{
header: "Version",
accessorKey: "version",
maxSize: 100,
header: "Source",
id: "source",
accessorFn: (row) => row.spec?.source ?? row.spec?.address ?? "",
enableResizing: true
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find where the plugins table's `source` column and spec.source are written/used
rg -nP --type=ts -C3 '\bsource\b' src/api/services/plugins.ts
rg -nP -C3 'plugins' --iglob '*migration*' --iglob '*.sql'
rg -nP --type=ts -C3 'spec\?\.(source|address)' src

Repository: flanksource/flanksource-ui

Length of output: 842


Align "Source" column logic with the persisted data structure.

The API returns source as a top-level field in PluginListing, but the column's accessorFn ignores it:

Current logic in src/pages/Settings/PluginsPage.tsx
accessorFn: (row) => row.spec?.source ?? row.spec?.address ?? ""

This results in the "Source" column displaying an empty string whenever spec.source and spec.address are missing, even if a valid value exists in the top-level row.source. Update the accessor to prioritize the top-level field:

accessorFn: (row) => row.source ?? row.spec?.source ?? row.spec?.address ?? ""
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/Settings/PluginsPage.tsx` around lines 110 - 115, The "Source"
column accessor in PluginsPage is reading only from spec.source and
spec.address, so it misses the persisted top-level source field on
PluginListing. Update the column definition in PluginsPage so the accessorFn
checks row.source first, then falls back to row.spec?.source and
row.spec?.address, preserving the existing empty-string fallback.

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