Skip to content

Restore TagsFinder class interface

Vasilii Iakliushin requested to merge 340591_refactor_tags_finder into master

What does this MR do and why?

Contributes to #299529 (closed)

Problem

TagsFinder interface is not compatible with other Finders (like BranchesFinder, Repositories::TreeFinder). It prevents us from using a keyset pagination classes.

Solution

Changes:

  • Restore TagsFinder interface to return a list of tags.
  • Raise an exception when Gitaly is not available
  • Handle Gitaly exceptions
  • Return 503 error for tags API endpoint when Gitaly is unavailable

Screenshots or screen recordings

Tags page

Screenshot_2021-11-10_at_18.43.09

Tags API response

Screenshot_2021-11-10_at_18.44.18

How to set up and validate locally

Tags page

  1. Go to tags page: http://localhost:3000/root/<project_path>/-/tags
  2. Stop Gitaly process in console gdk stop gitaly
  3. Refresh the page
  4. Verify that the page loads and shows an error message

Tags API

  1. Send a request to tags API endpoint: http://localhost:3000/api/v4/projects/1/repository/tags
  2. Stop Gitaly process in console gdk stop gitaly
  3. Resend the request
  4. Verify that response code is 503 and error message is "503 Service Unavailable"

Numbered steps to set up and validate the change are strongly suggested.

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 Vasilii Iakliushin

Merge request reports