Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As custom user incorrect fleet gitrepos are shown given the workspace filter #12437

Closed
mmartin24 opened this issue Oct 30, 2024 · 10 comments · Fixed by #12449
Closed

As custom user incorrect fleet gitrepos are shown given the workspace filter #12437

mmartin24 opened this issue Oct 30, 2024 · 10 comments · Fixed by #12449
Assignees
Labels
area/vue3 Bugs and technical debts as outcome to the Vue3 migration kind/bug QA/manual-test Indicates issue requires manually testing
Milestone

Comments

@mmartin24
Copy link

Setup

  • Rancher version: 2.10.0-alpha5
  • Rancher UI Extensions:
  • Browser type & version:Brave 1.70

Describe the bug
After an admin deploys 2 girepos one in fleet-local and the other in fleet-default, an user with access to these gitrepos will see them in incorrect order when using the toggle (the ones meant to be in local will appear in default and the one in default will appear in local)

To Reproduce

  • Deploy Rancher 2.10.0-alpha5 with at least 1 downstream cluster
  • As an admin deploy these 2 gitrepos:
    Local cluster
Name: fleet-local-simple-chart
URL: https://github.com/rancher/fleet-test-data
branch: master
path: simple-chart

Default cluster

Name: fleet-default-nginx
URL: https://github.com/rancher/fleet-test-data
branch: master
path: qa-test-apps/nginx-app
  • Create standard user std-user-46 with this custom roles:
 { resource: "fleetworkspaces", verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]},
 { resource: "gitrepos", verbs: ["list"]},
 { resource: "bundles", verbs: ["create", "delete", "get", "list", "patch", "update", "watch"]},
  • Access as std-user-46

Result
When navigating to gitrepos std-user-46 sees:

  • when changing toggle to fleet-local gitrepo fleet-default-nginx
  • when changing toggle to fleet-default gitrepo fleet-local-simple-chart
    image

Expected Result
When navigating to gitrepos std-user-46 should see:

  • when changing toggle to fleet-local gitrepo fleet-local-simple-chart
  • when changing toggle to fleet-default gitrepo fleet-default-nginx

Screenshots

Screencast.from.30-10-24.17.15.59.webm

Additional context

@github-actions github-actions bot added the QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this label Oct 30, 2024
@richard-cox
Copy link
Member

richard-cox commented Oct 30, 2024

@mmartin24 can you confirm how you created the two git repos? it would be expected that the git repo is created in the workspace that was selected at the time of creation

Edit: this can be confirmed by looking at the metadata.namespace of the gitrepo

@eva-vashkevich
Copy link
Member

@gaktive should I look into this and try to fit it in 2.10?

@richard-cox
Copy link
Member

@eva-vashkevich if it's reproducible and a regression we should try. if it's not reproducible or a regression it can definitely be pushed to 2.11. In master i couldn't reproduce, the gitrepos appear in the workspace they were created in

@eva-vashkevich eva-vashkevich self-assigned this Oct 30, 2024
@eva-vashkevich
Copy link
Member

I am able to reproduce the issue and can confirm it is not present in 2.9 dashboard

@mmartin24
Copy link
Author

@mmartin24 can you confirm how you created the two git repos? it would be expected that the git repo is created in the workspace that was selected at the time of creation

Edit: this can be confirmed by looking at the metadata.namespace of the gitrepo:

@richard-cox the admin does create the gitrepo on the expected workspace in both cases, here you can see how for gitrepo fleet-default-nginx, created on the workspace fleet-default, the metadata.namespace is fleet-default
image

For std-user-46, with the toggle pointing to fleet-default. the metadata.namespace is still fleet-default but the gitrepo displayed is the one belonging to the fleet-local workspace, (fleet-local-simple-chart)
image

@richard-cox richard-cox added this to the v2.10.0 milestone Oct 31, 2024
@richard-cox
Copy link
Member

@mmartin24 i still can't reproduce. can you try on head, and include specific steps to reproduce (for instance i created global roles and added the required group to the resource grants)? I don't think this affects much, but the gitrepo permission with just list is a bit odd (should probably include get too).

@eva-vashkevich please can you provide an update on how you reproduced and progress from yesterday?

@richard-cox richard-cox changed the title Fleet toggle shows incorrect gitrepos for non Admin users As custom user incorrect fleet gitrepos are shown given the workspace filter Oct 31, 2024
@mmartin24
Copy link
Author

@richard-cox, sorry for the delay.
I tried with something simpler as creating another admin user and in that case it works (although it has a delay on displaying the correct repo, in case it gives you a hint).
The best reproduction steps are the ones described in the ticket, but I can provide you a full video of our test with all the steps followed to get to this point.
Please let me know if this is ok:

Screencast.from.31-10-24.18.27.01.mov

@eva-vashkevich
Copy link
Member

Hi @mmartin24 I am able to reproduce using steps from the ticket and will sync with Richard if needed. Right now I am still trying to figure out the cause.

@richard-cox richard-cox added the area/vue3 Bugs and technical debts as outcome to the Vue3 migration label Oct 31, 2024
@richard-cox richard-cox self-assigned this Oct 31, 2024
@richard-cox
Copy link
Member

richard-cox commented Oct 31, 2024

Details in PR, but key bug points

  • issue revolves around switching between workspaces or namespaces where the number of rows remains the same
    • hard to reproduce in namespace world given switcher isn't singular
  • user irrelevant
  • cause by a change of vue3 reactivity

@yonasberhe23 yonasberhe23 added QA/manual-test Indicates issue requires manually testing and removed QA/dev-automation Issues that engineers have written automation around so QA doesn't have look at this labels Nov 1, 2024
@yonasberhe23 yonasberhe23 self-assigned this Nov 2, 2024
@yonasberhe23
Copy link
Contributor

Seeing correct gitrepos, clusters, and cluster groups when navigating between workspaces. Also conducted regression testing around lists.

Tested in:

  • Rancher v2.10-212d8b6e92992235d791d8f2aaea8436ab4f6b77-head
  • Dashboard master 99285c9
Screen.Recording.2024-11-04.at.8.59.28.PM.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/vue3 Bugs and technical debts as outcome to the Vue3 migration kind/bug QA/manual-test Indicates issue requires manually testing
Projects
None yet
4 participants