Skip to content

Update API endpoint used for Archived projects

What does this MR do and why?

Related to #371923 (closed)

There is a bug on the Archived projects tab in the group overview where all groups, subgroups and projects are shown regardless of the archived status. This MR updates the API used to fix the bug. For the Archived projects tab we will now use the GET /groups/:id/projects API with the archived parameter. For context on why we decided to switch APIs see #371923 (comment 1090509501)

Screenshots or screen recordings

Before After
Screenshot_2023-06-12_at_5.41.07_PM Screenshot_2023-06-12_at_5.38.26_PM

How to set up and validate locally

  1. Go to a group, make note of the group ID
  2. Open the rails console
    • bin/rails console
  3. Run the following commands:
    • group = Group.find(<group id from step 1>)
    • visibility_levels = [Gitlab::VisibilityLevel::PUBLIC, Gitlab::VisibilityLevel::INTERNAL, Gitlab::VisibilityLevel::PRIVATE]
50.times do |index|
  name = FFaker::Lorem.words.join(' ')

  FactoryBot.create(
    :project_empty_repo,
    :archived,
    namespace: group,
    name: name,
    description: FFaker::Lorem.sentence,
    path: name.parameterize(separator: '-'),
    visibility_level: visibility_levels[index % 3],
    ci_project_mirror: Ci::ProjectMirror.first
  )
end
  1. Navigate to the Archived projects tab on the group overview

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Peter Hegman

Merge request reports