Skip to content

Conversation

raghavyuva
Copy link
Owner

@raghavyuva raghavyuva commented Sep 20, 2025

Summary by CodeRabbit

  • New Features

    • Introduced Extensions hub with hero, header, and grid: browse, search, sort, and paginate extensions.
    • Added install and view details actions with RBAC protection and new navigation entry.
    • Enabled API endpoints to list and view extensions.
    • Included a new Fail2ban extension template.
  • Chores

    • Added feature flag and permissions for extensions; updated audit types.
    • Migrated database to support extensions, variables, executions, and steps.
    • Integrated Redux API slice and store wiring.
    • Added translations (EN, ES, FR, KN).

Copy link
Contributor

coderabbitai bot commented Sep 20, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Introduces a full “extensions” feature across API, storage, migrations, loader/parser, routing, and frontend (Redux types/slice, hooks, components, i18n, navigation). Adds templates and startup loading. Also updates the API version timestamp.

Changes

Cohort / File(s) Summary of Changes
API version
api/api/versions.json
Updated v1 release_date timestamp.
DB migrations (extensions, RBAC, feature flag, audit)
api/migrations/extensions/036_create_extensions_up.sql, api/migrations/extensions/036_create_extensions_down.sql, api/migrations/rbac/033_extensions_permissions_up.sql, api/migrations/rbac/033_extensions_permissions_down.sql, api/migrations/feature-flags/034_add_extensions_feature_flag_up.sql, api/migrations/feature-flags/034_add_extensions_feature_flag_down.sql, api/migrations/audit/035_add_extensions_to_audit_up.sql
Added schema/types/tables/indexes/triggers for extensions; corresponding down migration; added extension permissions and role mappings; feature flag for extensions; audit enum value.
Types layer
api/internal/types/extension.go
Introduced models, enums, list params/response for extensions and executions.
Storage layer
api/internal/features/extension/storage/storage.go
Added Bun-backed storage interface/implementation with CRUD, list, and transactions; soft-delete support; preload variables.
Service layer
api/internal/features/extension/service/service.go
Added ExtensionService with constructor and CRUD/list delegates to storage.
Controller & routing
api/internal/features/extension/controller/init.go, api/internal/features/extension/controller/get_extensions.go, api/internal/routes.go
Added ExtensionsController (constructor, validation helper) and three GET handlers; registered routes under /extensions with RBAC/Audit.
Validation
api/internal/features/extension/validation/validator.go
Added Validator wrapper (constructor, request parse stub, struct validation).
Loader & parser
api/internal/features/extension/loader/loader.go, api/internal/features/extension/parser/parser.go, api/internal/storage/store.go
Added YAML parser and DB loader with upsert; wired loader into store init to load templates at startup.
Template
api/templates/fail2ban.yaml
Added Fail2ban extension YAML template with variables, steps, and validation.
Frontend types & API
view/redux/types/extension.ts, view/redux/api-conf.ts, view/redux/services/extensions/extensionsApi.ts, view/redux/store.ts
Added TS types; API endpoints enum; RTK Query slice with 3 queries; integrated slice into store.
Frontend hooks & page
view/app/extensions/hooks/use-extensions.ts, view/app/extensions/page.tsx
Added hook to manage listing/search/sort/pagination; new Extensions page composing hero/header/grid with pagination and RBAC guard.
Frontend components
view/app/extensions/components/extension-card.tsx, view/app/extensions/components/extensions-grid.tsx, view/app/extensions/components/extensions-header.tsx, view/app/extensions/components/extensions-hero.tsx
Added UI components for cards, grid (with skeleton/error/empty), header (search/sort with skeleton), and hero (with skeleton).
Navigation & RBAC (view)
view/components/layout/app-sidebar.tsx, view/lib/rbac.ts
Added Extensions nav item; extended Resource union with 'extensions'.
i18n
view/lib/i18n/locales/en.json, .../es.json, .../fr.json, .../kn.json
Added translations for Extensions UI; added “installed” key; added navigation.extensions.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User (Browser)
  participant V as View (React)
  participant RTK as RTK Query
  participant API as API Router
  participant C as ExtensionsController
  participant S as ExtensionService
  participant St as Storage
  participant DB as Database

  U->>V: Navigate to /extensions
  V->>RTK: useGetExtensionsQuery(params)
  RTK->>API: GET /v1/extensions?search&sort_by&sort_dir&page&page_size
  API->>C: Route to GetExtensions
  C->>S: ListExtensions(params)
  S->>St: ListExtensions(params)
  St->>DB: SELECT (filters, search, sort, paginate)
  DB-->>St: Rows + total
  St-->>S: ExtensionListResponse
  S-->>C: ExtensionListResponse
  C-->>API: 200 JSON
  API-->>RTK: Response
  RTK-->>V: data, isLoading=false
  V-->>U: Render grid/page
Loading
sequenceDiagram
  autonumber
  participant Init as Store Init
  participant L as ExtensionLoader
  participant P as YAML Parser
  participant DB as Database

  Init->>L: LoadExtensionsFromTemplates()
  L->>P: LoadExtensionsFromDirectory(templates/)
  P-->>L: [extensions[], variables[][]]
  loop each extension
    L->>DB: Begin Tx
    L->>DB: Upsert extension
    L->>DB: Delete/Insert variables (bulk)
    DB-->>L: Commit
  end
  L-->>Init: Done
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Poem

A hop and a skip through YAML and DB,
I nibble new routes with glee.
Cards on the grid, a hero in view,
Extensions abound—so shiny, so new!
With paws on the parser and ears to the log,
I ship this warren’s latest cog. 🐇✨

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/extensions

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 and usage tips.

@raghavyuva raghavyuva changed the base branch from master to feat/develop September 20, 2025 10:26
@raghavyuva raghavyuva changed the base branch from feat/develop to master September 20, 2025 10:28
@raghavyuva raghavyuva changed the base branch from master to feat/develop September 20, 2025 10:28
@raghavyuva raghavyuva self-assigned this Sep 20, 2025
@raghavyuva raghavyuva added this to the Beta Release milestone Sep 20, 2025
@raghavyuva
Copy link
Owner Author

@coderabbitai summary and short title

Copy link
Contributor

coderabbitai bot commented Sep 20, 2025

@raghavyuva I'll regenerate the summary and short title for this PR about extensions functionality.

✅ Actions performed

Summary regeneration triggered.

@raghavyuva raghavyuva marked this pull request as draft September 20, 2025 10:35
@zhravan zhravan deleted the branch feat/develop October 3, 2025 12:21
@zhravan zhravan closed this Oct 3, 2025
@github-project-automation github-project-automation bot moved this to Done in Nixopus Oct 3, 2025
@zhravan zhravan reopened this Oct 4, 2025
* feat: extension forking

* fix: remove duplicate route endpoints due to merge conflict resolution

* ui: update design for fork customization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants