Skip to content

Conversation

@lllamnyp
Copy link
Member

@lllamnyp lllamnyp commented Dec 19, 2025

What this PR does

Add representation for backup Plans in the dashboard and a readme describing, how to add further resources to the dashboard.

Release note

[backups,dashboard] Add backup Plans to the dashboard.

Summary by CodeRabbit

  • New Features

    • Added a Backups section in the dashboard navigation with Plans, BackupJobs, and Backups.
    • Added detailed views for Plan, BackupJob, and Backup showing metadata, references, status, timings, and artifacts.
    • Enhanced list views with custom columns (application refs, phase/status, created/taken timestamps).
  • Documentation

    • Added a Dashboard integration guide documenting how to add resources, list/detail wiring, and verification steps.

✏️ Tip: You can customize this high-level summary in your review settings.

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. enhancement New feature or request labels Dec 19, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 19, 2025

📝 Walkthrough

Walkthrough

Adds dashboard integration for Backups (Plans, BackupJobs, Backups): new Backups sidebar section, hardcoded menu entries, custom list column overrides, three detail factories (plan/backupjob/backup), a non-exported application-ref helper, and an integration README.

Changes

Cohort / File(s) Summary
Sidebar Navigation Structure
internal/controller/dashboard/sidebar.go
Adds a hardcoded "Backups" category (children: Plans, BackupJobs, Backups) inserted between Resources and Administration; adjusts dynamic population to skip Marketplace/Backups/Administration; extends static upsert target IDs with stock-project-factory-plan-details, ...-backupjob-details, ...-backup-details; wires static ownership/labels for these entries.
Helper Functions
internal/controller/dashboard/static_helpers.go
Adds non-exported createApplicationRefColumn(name string) map[string]any to construct a factory-type column that renders application references from .spec.applicationRef.* as "Kind.apiGroup/name".
Resource Factories & Custom Columns
internal/controller/dashboard/static_refactored.go
Adds CustomColumnsOverride entries for stock-namespace-/backups.cozystack.io/v1alpha1/plans, .../backupjobs, and .../backups; introduces three unified factories: plan-details, backupjob-details, backup-details (tabs, spec/status/timing/artifact fields); integrates them into CreateAllFactories() and includes new overrides in CreateAllCustomColumnsOverrides().
Documentation
internal/controller/dashboard/README.md
Adds a comprehensive integration guide documenting how to add CustomColumnsOverride, Factory, and Sidebar entries with examples, verification steps, common patterns, and troubleshooting (includes a Plan example).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 I nibbled code beneath the moon,

New Backups paths in tidy tune,
Sidebars hop and lists align,
Details sparkle, columns shine,
A little rabbit cheers: "All's fine!"

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title '[backups,dashboard] User-facing UI' is partially related to the changeset but lacks specificity about the main change. Consider a more descriptive title like '[backups,dashboard] Add backup Plans and resource integration guide' to clarify the specific components and features being added.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @lllamnyp, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the dashboard by adding a dedicated user interface for 'backup Plans', enabling better visibility and management of backup resources. Concurrently, it provides detailed documentation to streamline the future integration of other Kubernetes resources into the dashboard, ensuring a consistent and extensible UI framework.

Highlights

  • Backup Plans UI: Introduced user-facing UI for backup Plans in the dashboard, allowing users to view and manage these resources.
  • Dashboard Integration Guide: Added a comprehensive README guide detailing the process of integrating new Kubernetes resources into the dashboard, covering CustomColumnsOverride, Factory, and Sidebar entries.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist 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

This pull request adds the UI for backup Plan resources to the dashboard, including list and detail views, and a sidebar entry. It also introduces a comprehensive README.md guide for adding new resources to the dashboard. The changes are well-structured and follow the existing patterns.

However, I've identified a recurring issue with how object references (like applicationRef, storageRef, strategyRef) are formatted for display. The current implementation will render them incorrectly when the apiGroup is not present. This issue is present in the new helper function, the Plan details factory, and is also documented in the new README.md. I've left detailed comments on how to address this. Additionally, I've pointed out some minor inaccuracies in line number references in the new documentation.

Comment on lines +209 to +211
parsedText("application-ref-value",
"{reqsJsonPath[0]['.spec.applicationRef.kind']['-']}.{reqsJsonPath[0]['.spec.applicationRef.apiGroup']['-']}/{reqsJsonPath[0]['.spec.applicationRef.name']['-']}",
nil),
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The example provided for displaying object references is flawed. When apiGroup is empty, the resulting string will be Kind./name instead of the desired Kind/name. This is because the dot . separator is hardcoded. This pattern is also used in static_refactored.go for applicationRef, storageRef, and strategyRef. This should be corrected to handle cases where apiGroup is not present. Consider using a custom formatter or a component that supports conditional rendering to build this string correctly.

Comment on lines +1530 to +1558
antdFlexVertical("spec-application-ref-block", 4, []any{
antdText("application-ref-label", true, "Application", nil),
parsedText("application-ref-value", "{reqsJsonPath[0]['.spec.applicationRef.kind']['-']}.{reqsJsonPath[0]['.spec.applicationRef.apiGroup']['-']}/{reqsJsonPath[0]['.spec.applicationRef.name']['-']}", nil),
}),
antdFlexVertical("spec-storage-ref-block", 4, []any{
antdText("storage-ref-label", true, "Storage", nil),
parsedText("storage-ref-value", "{reqsJsonPath[0]['.spec.storageRef.kind']['-']}.{reqsJsonPath[0]['.spec.storageRef.apiGroup']['-']}/{reqsJsonPath[0]['.spec.storageRef.name']['-']}", nil),
}),
antdFlexVertical("spec-strategy-ref-block", 4, []any{
antdText("strategy-ref-label", true, "Strategy", nil),
parsedText("strategy-ref-value", "{reqsJsonPath[0]['.spec.strategyRef.kind']['-']}.{reqsJsonPath[0]['.spec.strategyRef.apiGroup']['-']}/{reqsJsonPath[0]['.spec.strategyRef.name']['-']}", nil),
}),
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This block for displaying applicationRef, storageRef, and strategyRef has the same issue as the createApplicationRefColumn helper. The string concatenation will result in an incorrect format like Kind./name when apiGroup is empty. This pattern should be corrected for all three references to ensure they display correctly. This is a recurring issue in this PR and should be addressed with a robust solution, for example by creating a helper function that correctly formats these references.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
internal/controller/dashboard/sidebar.go (1)

311-322: orderCategoryLabels function is out of sync with documented category order.

The main ensureSidebar function documents the category order as "Marketplace, IaaS, PaaS, NaaS, <others A→Z>, Resources, Backups, Administration", but the orderCategoryLabels function's comment (line 316) omits "Backups" and its tail slice (line 323) contains only ["Resources", "Administration"].

While this currently works because "Backups" is hardcoded and explicitly skipped in the dynamic loop (line 149), the mismatch creates inconsistency. Update the orderCategoryLabels comment and tail slice to include "Backups" for consistency with the documented order and to prevent confusion during future refactoring.

🧹 Nitpick comments (4)
internal/controller/dashboard/README.md (3)

284-285: Add language specifier to fenced code block.

The code block starting at line 284 lacks a language specifier. Since this is a prompt template, consider adding text or markdown as the language identifier for consistency with linting rules.

🔎 Proposed fix
-```
+```text
 Please add support for the {ResourceKind} resource ({group}/{version}/{plural}) to the Cozystack dashboard.

352-352: Convert bare URL to markdown link.

Per markdown best practices, wrap the URL in angle brackets or use a proper markdown link format.

🔎 Proposed fix
-- Kubernetes API Conventions: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md
+- Kubernetes API Conventions: <https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md>

321-324: Hardcoded line numbers will become stale.

References like "Lines 375-379 in static_refactored.go" will become outdated as the codebase evolves. Consider using function/section names or code search patterns instead of exact line numbers.

internal/controller/dashboard/static_refactored.go (1)

1443-1557: Consider adding a YAML tab for consistency.

The Plan factory only includes a "Details" tab, while other similar factories (secret, service, ingress, workloadmonitor) also include a "YAML" tab for viewing/editing the resource definition. If Plan resources should be viewable/editable via YAML, consider adding a YAML tab following the pattern used in other factories.

🔎 Example YAML tab to add after the details tab
map[string]any{
    "key":   "yaml",
    "label": "YAML",
    "children": []any{
        map[string]any{
            "type": "YamlEditorSingleton",
            "data": map[string]any{
                "id":                        "yaml-editor",
                "cluster":                   "{2}",
                "isNameSpaced":              true,
                "prefillValuesRequestIndex": 0,
                "substractHeight":           float64(400),
                "type":                      "api",
                "typeName":                  "plans",
                "apiGroup":                  "backups.cozystack.io",
                "apiVersion":                "v1alpha1",
            },
        },
    },
},
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fe7bdcf and d9ba772.

📒 Files selected for processing (4)
  • internal/controller/dashboard/README.md (1 hunks)
  • internal/controller/dashboard/sidebar.go (6 hunks)
  • internal/controller/dashboard/static_helpers.go (1 hunks)
  • internal/controller/dashboard/static_refactored.go (3 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

Use Controller-runtime patterns and kubebuilder style for Go code

Files:

  • internal/controller/dashboard/sidebar.go
  • internal/controller/dashboard/static_refactored.go
  • internal/controller/dashboard/static_helpers.go
🧬 Code graph analysis (1)
internal/controller/dashboard/static_refactored.go (1)
internal/controller/dashboard/unified_helpers.go (1)
  • UnifiedResourceConfig (211-219)
🪛 markdownlint-cli2 (0.18.1)
internal/controller/dashboard/README.md

284-284: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


352-352: Bare URL used

(MD034, no-bare-urls)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (4)
internal/controller/dashboard/sidebar.go (2)

115-116: LGTM!

The keysAndTags entry for plans correctly maps to plan-sidebar, which matches the sidebar tag that will be generated by createUnifiedFactory for the Plan resource.


169-180: LGTM!

The hardcoded "Backups" section follows the established pattern used for "Marketplace" and "Administration". The link format and structure are consistent with other menu items.

internal/controller/dashboard/static_refactored.go (2)

374-380: LGTM!

The CustomColumnsOverride for Plans is correctly configured with:

  • Proper ID format matching the API path
  • Name column with badge and link to the detail page
  • Application column using the new helper function
  • Created timestamp column

The navigation link /factory/plan-details/{name} correctly matches the factory key.


1559-1569: LGTM!

The plan-details factory is correctly added to the return list, completing the integration.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Dec 25, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
internal/controller/dashboard/static_refactored.go (1)

1530-1541: Fix string concatenation for reference display.

The string concatenation pattern {kind}.{apiGroup}/{name} will produce incorrect output like Kind./name when apiGroup is empty (common for core Kubernetes resources). This is the same issue flagged in previous reviews.

While line 378 correctly uses the createApplicationRefColumn helper for the table column, the factory details here use direct string concatenation. Consider creating a similar helper for parsedText values or refactoring the display logic to handle empty apiGroup correctly.

Expected format:

  • When apiGroup is present: Kind.apiGroup/name
  • When apiGroup is empty: Kind/name

This affects all three reference fields: applicationRef (line 1532), storageRef (line 1536), and strategyRef (line 1540).

🧹 Nitpick comments (1)
internal/controller/dashboard/sidebar.go (1)

311-352: Consider updating orderCategoryLabels to include "Backups" for consistency.

While the current implementation works (line 149 filters out "Backups" from dynamic categories), the orderCategoryLabels function should be updated to reflect the complete ordering, including "Backups":

  1. Update line 318 fallback to include "Backups":

    -return []string{"Marketplace", "IaaS", "PaaS", "NaaS", "Resources", "Administration"}
    +return []string{"Marketplace", "IaaS", "PaaS", "NaaS", "Resources", "Backups", "Administration"}
  2. Update line 322 tail to include "Backups":

    -tail := []string{"Resources", "Administration"}
    +tail := []string{"Resources", "Backups", "Administration"}
  3. Update line 341 to exclude "Backups" from others:

    -if k == "Resources" || k == "Administration" {
    +if k == "Resources" || k == "Backups" || k == "Administration" {
  4. Update the function comment (lines 312-313) to document "Backups" in the ordering.

This would make the ordering logic more robust and prevent potential issues if a CRD is defined with category: "Backups" in the future.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d9ba772 and 88da2d1.

📒 Files selected for processing (3)
  • internal/controller/dashboard/sidebar.go
  • internal/controller/dashboard/static_helpers.go
  • internal/controller/dashboard/static_refactored.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/controller/dashboard/static_helpers.go
🧰 Additional context used
📓 Path-based instructions (2)
internal/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

Follow controller-runtime patterns and kubebuilder style for Go code in internal directory

Files:

  • internal/controller/dashboard/sidebar.go
  • internal/controller/dashboard/static_refactored.go
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

Do NOT manually edit vendor/ directory or auto-generated files (zz_generated.*.go)

Files:

  • internal/controller/dashboard/sidebar.go
  • internal/controller/dashboard/static_refactored.go
🧬 Code graph analysis (1)
internal/controller/dashboard/static_refactored.go (1)
internal/controller/dashboard/unified_helpers.go (1)
  • UnifiedResourceConfig (211-219)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (6)
internal/controller/dashboard/static_refactored.go (1)

375-380: LGTM! Well-structured plan column override.

The CustomColumnsOverride correctly uses the createApplicationRefColumn helper to display the application reference, avoiding string concatenation issues.

internal/controller/dashboard/sidebar.go (5)

29-29: LGTM! Documentation updated correctly.

The comment accurately reflects the new category ordering that includes the Backups section.


115-116: LGTM! Sidebar tags configured correctly.

The keysAndTags entry for plans follows the established pattern for built-in resources.


129-149: LGTM! Skip logic correctly handles hardcoded sections.

The condition properly excludes the hardcoded "Backups" section from dynamic category processing, consistent with "Marketplace" and "Administration" handling.


169-180: LGTM! Hardcoded Backups section structured correctly.

The Backups menu section follows the established pattern and is correctly positioned between dynamic categories and Administration, as documented in the comments.


220-220: LGTM! Plan details sidebar correctly registered.

The addition of "stock-project-factory-plan-details" to targetIDs ensures the plan details sidebar is created with the shared menu.

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Dec 25, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (1)
internal/controller/dashboard/README.md (1)

204-212: Fix the object reference rendering pattern to handle empty apiGroup.

This example shows a hardcoded dot separator between kind and apiGroup. When apiGroup is empty, this produces Kind./name instead of Kind/name. As flagged in the previous review, this pattern should handle conditional rendering or use a formatter that omits the separator when apiGroup is absent. This applies to applicationRef, storageRef, and strategyRef patterns throughout the codebase.

💡 Suggested approach

Consider using a conditional formatter or custom component that only includes the dot separator when apiGroup is non-empty:

// Pseudocode example:
// If apiGroup is present: Kind.apiGroup/name
// If apiGroup is empty: Kind/name
parsedText("application-ref-value", 
    "{reqsJsonPath[0]['.spec.applicationRef.kind']['-']}{conditional-dot}{reqsJsonPath[0]['.spec.applicationRef.apiGroup']['-']}/{reqsJsonPath[0]['.spec.applicationRef.name']['-']}", 
    nil),

Alternatively, document the conditional handling required when implementing this pattern.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 88da2d1 and 78d8c19.

📒 Files selected for processing (1)
  • internal/controller/dashboard/README.md
🧰 Additional context used
📓 Path-based instructions (1)
**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Git commits should follow [component] Description format and include --signoff flag

Files:

  • internal/controller/dashboard/README.md
🪛 markdownlint-cli2 (0.18.1)
internal/controller/dashboard/README.md

284-284: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


352-352: Bare URL used

(MD034, no-bare-urls)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build

## What this PR does

Add representation for backup Plans in the dashboard and a readme
describing, how to add further resources to the dashboard.

### Release note

```release-note
[backups,dashboard] Add backup Plans to the dashboard.
```

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
Moved README describing how to add new resources to the Cozystack
dashboard to a separate commit to directly reference relevant code
changes from the document.

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In @internal/controller/dashboard/README.md:
- Line 352: Replace the bare URL
"https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md"
with a markdown link, e.g. change that line to use link syntax like [Kubernetes
API
Conventions](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md)
so it no longer violates MD034.
- Line 284: The fenced code block in README.md is missing a language identifier
(MD040); update the opening fence from ``` to include a language such as text
(e.g., change ``` to ```text) for the block containing "Please add support for
the {ResourceKind} resource ({group}/{version}/{plural}) to the Cozystack
dashboard." so the markdown linter passes.

In @internal/controller/dashboard/static_refactored.go:
- Around line 1671-1681: The parsedText expressions for application-ref-value
and storage-ref-value currently always insert a dot before the name even when
apiGroup is empty, producing outputs like "Kind./name"; update those parsedText
expressions to build the label as kind + (apiGroup ? '.' + apiGroup : '') + '/'
+ name so the dot is only present when apiGroup is non-empty; also update
strategy-ref-value to follow the same pattern (include kind and apiGroup parts
with the same conditional dot) so its output is consistent with
application/storage refs; locate and modify the parsedText entries with IDs
"application-ref-value", "storage-ref-value", and "strategy-ref-value".
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 78d8c19 and 297acd9.

📒 Files selected for processing (4)
  • internal/controller/dashboard/README.md
  • internal/controller/dashboard/sidebar.go
  • internal/controller/dashboard/static_helpers.go
  • internal/controller/dashboard/static_refactored.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/controller/dashboard/static_helpers.go
🧰 Additional context used
📓 Path-based instructions (3)
**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Git commits should follow [component] Description format and include --signoff flag

Files:

  • internal/controller/dashboard/README.md
internal/**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

Follow controller-runtime patterns and kubebuilder style for Go code in internal directory

Files:

  • internal/controller/dashboard/sidebar.go
  • internal/controller/dashboard/static_refactored.go
**/*.go

📄 CodeRabbit inference engine (AGENTS.md)

Do NOT manually edit vendor/ directory or auto-generated files (zz_generated.*.go)

Files:

  • internal/controller/dashboard/sidebar.go
  • internal/controller/dashboard/static_refactored.go
🧬 Code graph analysis (1)
internal/controller/dashboard/static_refactored.go (1)
internal/controller/dashboard/unified_helpers.go (1)
  • UnifiedResourceConfig (211-219)
🪛 markdownlint-cli2 (0.18.1)
internal/controller/dashboard/README.md

284-284: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


352-352: Bare URL used

(MD034, no-bare-urls)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (10)
internal/controller/dashboard/README.md (2)

1-198: Comprehensive integration guide with clear structure.

The documentation provides excellent step-by-step guidance for integrating new resources into the dashboard. The structure (Overview → Prerequisites → Steps → Verification) is logical, and the helper function references align well with the codebase.


209-211: Address the reference formatting issue when apiGroup is empty.

The example concatenation pattern will produce Kind./name when apiGroup is empty. This issue affects the actual implementation in static_refactored.go at lines 1549, 1553, 1557, 1673, 1677, 1857, 1861, 1865 and should be corrected across both the documentation and code.

Likely an incorrect or invalid review comment.

internal/controller/dashboard/sidebar.go (4)

29-29: Category ordering correctly updated.

The Backups section is properly positioned between Resources and Administration in both the documentation comment and the implementation logic.

Also applies to: 135-135


115-122: Sidebar tags correctly configured.

The keysAndTags entries for backup resources follow the established naming convention and align with the factory sidebarTags in static_refactored.go.


155-155: Hardcoded Backups section properly implemented.

The Backups section follows the established pattern for hardcoded sidebar sections, with correct API group paths and proper alignment between child keys and keysAndTags entries.

Also applies to: 175-196


236-238: Factory sidebar IDs correctly added.

The detail sidebar IDs follow the naming convention and properly align with the factory keys defined in static_refactored.go.

internal/controller/dashboard/static_refactored.go (4)

375-397: CustomColumnsOverride entries properly configured.

The column overrides for backup resources follow established patterns, correctly use the createApplicationRefColumn helper for consistency, and link to the appropriate factory detail pages.


1897-1899: Factory resources properly added.

The three backup-related factories are correctly wired into the return list with keys that align with the sidebar configuration and column override hrefs.


1547-1558: Reference formatting issue in Plan detail view.

The manual concatenation of references (applicationRef, storageRef, strategyRef) at lines 1549, 1553, and 1557 will produce Kind./name when apiGroup is empty (e.g., for core Kubernetes resources). This is inconsistent with the CustomColumnsOverride at line 378 which correctly uses the createApplicationRefColumn helper.

Consider creating a detail view helper for reference formatting or using conditional rendering to handle empty apiGroup values.

Likely an incorrect or invalid review comment.


1855-1865: Reference formatting issue in Backup detail view.

Lines 1857, 1861, and 1865 use the same problematic concatenation pattern, producing Kind./name when apiGroup is empty. All three backup-related detail factories (plan, backupjob, backup) should be refactored to use a consistent helper approach.

Likely an incorrect or invalid review comment.


Use this template when asking an AI agent to add a new resource to the dashboard:

```
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add language identifier to fenced code block.

The code block is missing a language identifier, violating markdown linting standard MD040.

🔎 Fix
-```
+```text
 Please add support for the {ResourceKind} resource ({group}/{version}/{plural}) to the Cozystack dashboard.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

284-284: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
In @internal/controller/dashboard/README.md at line 284, The fenced code block
in README.md is missing a language identifier (MD040); update the opening fence
from ``` to include a language such as text (e.g., change ``` to ```text) for
the block containing "Please add support for the {ResourceKind} resource
({group}/{version}/{plural}) to the Cozystack dashboard." so the markdown linter
passes.


## Additional Resources

- Kubernetes API Conventions: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Wrap bare URL in markdown link syntax.

The URL violates markdown linting standard MD034 by not being wrapped in link syntax.

🔎 Fix
-- Kubernetes API Conventions: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md
+- [Kubernetes API Conventions](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- Kubernetes API Conventions: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md
- [Kubernetes API Conventions](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md)
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

352-352: Bare URL used

(MD034, no-bare-urls)

🤖 Prompt for AI Agents
In @internal/controller/dashboard/README.md at line 352, Replace the bare URL
"https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md"
with a markdown link, e.g. change that line to use link syntax like [Kubernetes
API
Conventions](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md)
so it no longer violates MD034.

Comment on lines +1671 to +1681
antdFlexVertical("spec-application-ref-block", 4, []any{
antdText("application-ref-label", true, "Application", nil),
parsedText("application-ref-value", "{reqsJsonPath[0]['.spec.applicationRef.kind']['-']}.{reqsJsonPath[0]['.spec.applicationRef.apiGroup']['-']}/{reqsJsonPath[0]['.spec.applicationRef.name']['-']}", nil),
}),
antdFlexVertical("spec-storage-ref-block", 4, []any{
antdText("storage-ref-label", true, "Storage", nil),
parsedText("storage-ref-value", "{reqsJsonPath[0]['.spec.storageRef.kind']['-']}.{reqsJsonPath[0]['.spec.storageRef.apiGroup']['-']}/{reqsJsonPath[0]['.spec.storageRef.name']['-']}", nil),
}),
antdFlexVertical("spec-strategy-ref-block", 4, []any{
antdText("strategy-ref-label", true, "Strategy", nil),
parsedText("strategy-ref-value", "{reqsJsonPath[0]['.spec.strategyRef.name']['-']}", nil),
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Reference formatting issue in BackupJob detail view.

Lines 1673 and 1677 have the same concatenation issue as Plan details, producing Kind./name when apiGroup is empty. Additionally, line 1681 (strategyRef) inconsistently omits the apiGroup/kind pattern entirely, showing only the name.

🤖 Prompt for AI Agents
In @internal/controller/dashboard/static_refactored.go around lines 1671 - 1681,
The parsedText expressions for application-ref-value and storage-ref-value
currently always insert a dot before the name even when apiGroup is empty,
producing outputs like "Kind./name"; update those parsedText expressions to
build the label as kind + (apiGroup ? '.' + apiGroup : '') + '/' + name so the
dot is only present when apiGroup is non-empty; also update strategy-ref-value
to follow the same pattern (include kind and apiGroup parts with the same
conditional dot) so its output is consistent with application/storage refs;
locate and modify the parsedText entries with IDs "application-ref-value",
"storage-ref-value", and "strategy-ref-value".

Copy link
Member

@kvaps kvaps left a comment

Choose a reason for hiding this comment

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

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 7, 2026
@lllamnyp lllamnyp merged commit 67c5265 into main Jan 7, 2026
24 checks passed
@lllamnyp lllamnyp deleted the feat/backups-ui branch January 7, 2026 19:45
lllamnyp added a commit that referenced this pull request Jan 8, 2026
## What this PR does

Add representation for backup Plans, BackupJobs and Backups in the dashboard and a readme
describing, how to add further resources to the dashboard.

### Release note

```release-note
[backups,dashboard] Add backup Plans, BackupJobs, and Backups to the dashboard.
```

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added a Backups section in the dashboard navigation with Plans,
BackupJobs, and Backups.
* Added detailed views for Plan, BackupJob, and Backup showing metadata,
references, status, timings, and artifacts.
* Enhanced list views with custom columns (application refs,
phase/status, created/taken timestamps).

* **Documentation**
* Added a Dashboard integration guide documenting how to add resources,
list/detail wiring, and verification steps.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

(cherry picked from commit 67c5265)
Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
kvaps added a commit that referenced this pull request Jan 16, 2026
…d backup system (#1867)

## What this PR does

Update changelog for v1.0.0-alpha.1 to include missing features:
- **Cozystack Operator**: New operator for Package and PackageSource
management (#1740, #1741, #1755, #1756, #1760, #1761)
- **Backup System**: Comprehensive backup functionality with Velero
integration (#1640, #1685, #1687, #1708, #1719, #1720, #1737, #1762)
- Add @androndo to contributors
- Update Full Changelog link to v0.38.0...v1.0.0-alpha.1

### Release note

```release-note
[docs] Update changelog for v1.0.0-alpha.1: add cozystack-operator and backup system
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants