Skip to content

[tenant] Allow listing workloads - #1576

Merged
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
fix-workload-list
Nov 3, 2025
Merged

[tenant] Allow listing workloads#1576
Andrei Kvapil (kvaps) merged 1 commit into
mainfrom
fix-workload-list

Conversation

@kvaps

@kvaps Andrei Kvapil (kvaps) commented Nov 3, 2025

Copy link
Copy Markdown
Member

Signed-off-by: Andrei Kvapil kvapss@gmail.com

What this PR does

Release note

[tenant] Allow listing workload

Summary by CodeRabbit

  • Chores
    • Updated access permissions to allow users across all roles (default, view, use, admin, super-admin) to access workloads in addition to workloadmonitors with get, list, and watch capabilities.

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@dosubot dosubot Bot added the size/XS This PR changes 0-9 lines, ignoring generated files label Nov 3, 2025
@coderabbitai

coderabbitai Bot commented Nov 3, 2025

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

The change adds workloads resource permissions alongside existing workloadmonitors entries across multiple RBAC role definitions (default, view, use, admin, super-admin) in the tenant configuration template, maintaining consistent verbs of get, list, and watch.

Changes

Cohort / File(s) Summary
RBAC Role Resource Permissions
packages/apps/tenant/templates/tenant.yaml
Added workloads resource to the resources list in multiple role definitions (default, view, use, admin, super-admin) under the cozystack.io API group, alongside existing workloadmonitors entries with verbs ["get", "list", "watch"].

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify workloads resource name and casing are correct
  • Confirm the verbs (get, list, watch) are appropriate for the workloads resource
  • Check that all required roles have been updated consistently and no roles were missed
  • Ensure no unintended side effects from expanded permissions

Suggested reviewers

  • lllamnyp

Poem

🐰 Workloads hop into the RBAC scene,
Roles now watch what they have seen!
Permissions bloom like clover bright and wide,
Each tier gets its peek, with nothing to hide! ✨

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-workload-list

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5401ae9 and 93a9241.

📒 Files selected for processing (1)
  • packages/apps/tenant/templates/tenant.yaml (5 hunks)

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
Copy Markdown
Contributor

Summary of Changes

Hello Andrei Kvapil (@kvaps), 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 tenant component's operational capabilities by updating its RBAC configurations. The modification grants the necessary permissions to 'get', 'list', and 'watch' 'workloads' resources within the 'cozystack.io' API group, allowing the tenant application to effectively manage and observe workload objects.

Highlights

  • RBAC Permissions Update: This pull request modifies the Role-Based Access Control (RBAC) rules for the tenant component.
  • Workload Resource Access: It specifically grants permissions to 'get', 'list', and 'watch' 'workloads' resources under the 'cozystack.io' API group.
  • Tenant Component Enhancement: The changes enable the tenant application to interact with and monitor workload-related objects within the Cozystack ecosystem.
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 (@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 (@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.

@kvaps Andrei Kvapil (kvaps) added the backport Should change be backported on previous release label Nov 3, 2025
@kvaps
Andrei Kvapil (kvaps) merged commit 1770735 into main Nov 3, 2025
4 of 6 checks passed
@kvaps
Andrei Kvapil (kvaps) deleted the fix-workload-list branch November 3, 2025 10:57
@github-actions

github-actions Bot commented Nov 3, 2025

Copy link
Copy Markdown

Successfully created backport PR for release-0.37:

@dosubot dosubot Bot added the kind/feature Categorizes issue or PR as related to a new feature label Nov 3, 2025

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

Code Review

This pull request correctly adds permissions for various tenant roles to list workloads from the cozystack.io API group. The changes are consistent across all roles. I have one suggestion regarding code duplication in the RBAC role definitions. Consolidating the repeated rule block into a Helm named template would improve the long-term maintainability of this configuration.

- cozystack.io
resources:
- workloadmonitors
- workloads

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.

medium

While adding the workloads resource is correct, I've noticed that this block of RBAC rules for the cozystack.io apiGroup is duplicated across five different roles in this file (default, view, use, admin, and super-admin).

To improve maintainability and adhere to the Don't Repeat Yourself (DRY) principle, I recommend extracting this rule into a shared Helm named template. This would centralize the logic, making future updates to these permissions much simpler and less error-prone.

For example, you could define a template in a _helpers.tpl file or at the top of this file:

{{- define "tenant.cozystack.io.readonly.rules" -}}
- apiGroups:
  - cozystack.io
  resources:
  - workloadmonitors
  - workloads
  verbs: ["get", "list", "watch"]
{{- end -}}

And then include it in each role's rules section:

{{- include "tenant.cozystack.io.readonly.rules" . | nindent 2 }}

Andrei Kvapil (kvaps) added a commit that referenced this pull request Nov 3, 2025
# Description
Backport of #1576 to `release-0.37`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Should change be backported on previous release kind/feature Categorizes issue or PR as related to a new feature size/XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant