Skip to content

Use rest API for to submit data for blob edit

What does this MR do and why?

This MR is a chunk of work I started in !202756 (closed). I've realised I'll have to cover a couple of scenarios that previously the controller was taking care. Below you can find a breakdown how I plan to split the work:

MR # Scope Status
1 Uses rest API to submit data ⬅️
2 Reintroduce notifications 🚧
3 Editing file name is possible 🚧
4 File size validation 🚧
5 Handle fork workflow

Apart from the first couple of commits from !202756 (closed), this branch also includes a commit that introduces a feature flag and reintroduces a previous submit with controller and one commit that stubs the feature flag to false for feature tests that will pass after I finish MRs no 2, 3 and 4.

References

Screenshots or screen recordings

Context Before After
Impersonated second user trying to edit the file at the same time Screenshot_2025-09-04_at_11.44.45 Screenshot_2025-09-04_at_11.22.48
Before / feature flag off After / feature flag on
Screen_Recording_2025-09-18_at_14.43.37 Screen_Recording_2025-09-18_at_14.46.00

How to set up and validate locally

  1. In rails console enable the feature flag
    Feature.enable(:blob_edit_refactor)
  2. Go to Project / Repository
  3. Choose a file to edit in single file editor.
  4. Check the following scenarios:
  • commit changes directly to master
  • commit changes to a new branch with opening an MR
  • commit changes to a new branch without opening an MR
  1. Validate you can perform all of these actions.
  2. In another browser impersonate a member of the group that has rights to edit files.
  3. In both browsers open the same file in the repository and go to Edit with single file editor.
  4. Edit file with one of the users and submit changes.
  5. After that try to edit the file with the second user, you should get a message about the file changing in the meantime.

MR acceptance checklist

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

Related to #509968

Edited by Paulina Sedlak-Jakubowska

Merge request reports

Loading