Loading
docs(repository_files): fix broken API doc anchors
What does this MR do?
GitLab renamed the section titles on the Repository files API page, so 18 of the 21 doc links in repository_files.go point at anchors that no longer exist. The page opens, but at the top instead of at the method.
This MR points each link at the section that documents the endpoint the method calls:
| Method(s) | Endpoint | Old anchor | New anchor |
|---|---|---|---|
GetFile, GetFileOptions |
GET .../files/:file_path |
#get-file-from-repository |
#retrieve-a-file-from-a-repository |
GetFileMetaData, GetFileMetaDataOptions |
HEAD .../files/:file_path |
#get-file-from-repository |
#get-file-metadata-only |
GetFileBlame and its types |
GET .../files/:file_path/blame |
#get-file-blame-from-repository |
#retrieve-file-blame-history-from-a-repository |
GetRawFile, GetRawFileReader, GetRawFileMetaData, GetRawFileOptions |
GET/HEAD .../files/:file_path/raw |
#get-raw-file-from-repository |
#retrieve-a-raw-file-from-a-repository |
CreateFile, CreateFileOptions |
POST .../files/:file_path |
#create-new-file-in-repository |
#create-a-file-in-a-repository |
UpdateFile, UpdateFileOptions |
PUT .../files/:file_path |
#update-existing-file-in-repository |
#update-a-file-in-a-repository |
DeleteFile, DeleteFileOptions |
DELETE .../files/:file_path |
#delete-existing-file-in-repository |
#delete-a-file-in-a-repository |
GetFileMetaData sends a HEAD request, so it now links to the "Get file metadata only" subsection instead of the general "Retrieve a file" section.
This is the same kind of fix as !2723 (merged), !2777 (merged) and !2779 (merged).
How was this checked?
- Every new anchor was checked against the
idvalues in the live HTML of https://docs.gitlab.com/api/repository_files/. After the change, all 21 links in the file resolve (before: 18 broken). - Each mapping was checked against the route and HTTP method the function uses (
routeProjectsIDRepositoryFilesID,...Blame,...Raw, andwithMethod(...)). - Comment-only change.
This contribution was prepared with the help of an AI assistant. I reviewed the changes and take responsibility for them.