Skip to content

Clean up redirect_with_ref_type in favour of ambiguous_ref_modal

Jerry Seto requested to merge cleanup-redirect-with-ref-type into master

What does this MR do and why?

  • ambiguous_ref_modal shows a modal to the user and prompts them to choose the correct ref where redirect_with_ref_type would redirect to the tag version of the ref
  • redirect_with_ref_type is a refinement over some existing redirection behaviour
  • These behaviours overlap we've decided to go with ambiguous_ref_modal so this change is to clean up redirect_with_ref_type and the ambiguous_ref_modal flag toggle between the modal behaviour and the existing redirection behaviour
  • some behaviour from redirect_with_ref_type is still desirable for: #427616 (closed)

Contributes to: #420352 (closed)

How to set up and validate locally

  1. Create a project with readme
  2. Create a tag (e.g git tag other-branch)
  3. Create a branch with the same name as the tag (e.g git checkout -b other-branch)
  4. Push the tag and branch (e.g git push --tags && git push --all)
  5. Try visiting readme without providing ref_type (e.g http://gdk.test:3000/root/same-names-project/-/blob/other-branch/README.md) and be redirected to the branch version of the README with a url containing the commit sha rather than the branch name
  6. Enable the ambiguous_ref_modal feature flag
  7. Try visiting readme without providing ref_type and get a modal for choosing the branch or tag version instead.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Jerry Seto

Merge request reports

Loading