Skip to content

Draft: Refactor to use rest API for edit blob

What does this MR do and why?

Refactor to use rest API for edit blob:

  • using /api/:version/projects/:id/repository/files/:file_path for submitting blob edits
  • unblocks showing custom error message (like in a scenario when more than 1 user edits the same file)

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
Change to master, change to new branch with MR, change to new branch without MR Screen_Recording_2025-09-04_at_13.27.34 Screen_Recording_2025-09-04_at_13.23.35

How to set up and validate locally

  1. Go to Project / Repository
  2. Choose a file to edit in single file editor.
  3. 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

Closes #491263

Edited by Paulina Sedlak-Jakubowska

Merge request reports

Loading