Add Snippets BlobController for raw data
What does this MR do?
Adds a new Snippets BlobController for both personal and project snippets, to handle blob related actions.
This has initially been added to support returning raw data for multi-file snippets, as described in #217775 (closed)
The decision to add a BlobController
rather than a RawController
was made because eventually (near future) we will also be having other blob related actions for snippets, such as diff
.
No changelog has been added because the newly added endpoint is currently only accessible via a feature flag
We have decided not to put this new endpoint behind a feature flag because it is ok for it to be immediately available. Using a FF would prevent unauthenticated users accessing the raw content, which would go against the existing expectation/functionality.
Testing this MR
For testing this new endpoint, you will need to establish a commit ref for personal/project snippets, and them access them at paths such as:
Project snippets:
http://yourhost:port/namespace/project-name/-/snippets/:snippet_id/raw/:ref/:filepath
e.g.
http://127.0.0.1:3000/root/snippet-testing/-/snippets/286/raw/8807792edab1f0ab1be489ddbc0f016f7f4c9cb1/myfile.txt
Personal snippets:
http://yourhost:port/-/snippets/:snippet_id/raw/:ref/:filepath
e.g.
http://127.0.0.1:3000/-/snippets/287/raw/7325f4bfc461b82306f34c58ce4604483ffa5e40/test.txt
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry (https://docs.gitlab.com/ee/development/documentation/workflow.html#when-documentation-is-required)) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
Refs #217775 (closed)