[go: up one dir, main page]

Skip to content

Implement "View file @ [SHA]" options menu item [Rapid Diffs][Diff File]

What does this MR do and why?

For #514397 (closed)

Phase Status
Disclosure dropdown !182222 (merged)
View @ SHA 👈🏻 You are here
Open in Editor !182851 (merged)

Adds the "View @ [SHA]" menu item to the Rapid Diffs Diff File Options dropdown menu.

Please note that the overall thesis of Rapid Diffs is "render as much as statically possible on the server so it can be cached."
To that end - and since there's no non-JS implementation of GlDisclosureDropdown - the server provides as much information as it can (the static data) and the front end picks that up to provide to the Vue component.

In other words, this isn't done with Vue + an API call because we're explicitly trying to avoid that overhead in Rapid Diffs.

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.

Screenshots or screen recordings

Before After
image image

How to set up and validate locally

  1. Enable the rapid_diffs feature flag: rails c => Feature.enable( :rapid_diffs )
  2. Have an MR with at least 1 change
  3. Visit the MR's Changes tab
  4. Add ?rapid_diffs=true to the URL (or &rapid_diffs=true if there are already search parameters)
    • Submit the URL change to reload the page
  5. Open the "kebab" (vertical ellipsis "Options") menu
  6. Ensure the "View file @ [SHA]" menu item is present, correct, and works properly.
    • You can verify this by performing the same steps but without the rapid_diffs=true URL search parameter, as the page will be master without it.
Edited by Thomas Randolph

Merge request reports

Loading