Skip to content

Show project/group as deleted if so on credentials page

What does this MR do and why?

Relates to #434016 (closed)

As project is destroyed related user deletion takes place as the same happens async. Token deletion happens as the part of User deletion. That means even when project is deleted, token is there in database for some minutes, around that time if user tries to access admin/credentials page an error is thrown. With this MR we will display the status as Deleted to admin in case the token does not belong to Group or Project.

Screenshots

After Bug fix is applied

Screenshot 2024-01-05 at 11.09.41 PM.png

Steps to Reproduce

  1. Create a new project
  2. Create an access token related to the project from settings/access tokens
  3. Delete the project from settings/General/Advanced/Delete Project option
  4. Access URL - admin/credentials?filter=resource_access_tokens immediately project deletion happens

Observe without the changes in this MR an error is thrown -

NoMethodError - undefined method `name' for nil:NilClass:
ee/app/views/shared/credentials_inventory/resource_access_tokens/_resource_access_token.html.haml:22
ee/app/views/shared/credentials_inventory/_resource_access_tokens.html.haml:11
ee/app/views/shared/credentials_inventory/index.html.haml:28
app/controllers/application_controller.rb:162:in `render'
ee/app/controllers/concerns/credentials_inventory_actions.rb:12:in `block (2 levels) in index'
ee/app/controllers/concerns/credentials_inventory_actions.rb:10:in `index'

After the changes in this MR an error is thrown and UI is rendered with Deleted in the place of Project/Group name on credentials page.

Edited by Smriti Garg

Merge request reports