Update tree and blob resolvers to accept ref_type
requested to merge 20526-impossible-to-browse-a-branch-if-a-tag-exists-with-the-same-name-be into master
What does this MR do and why?
Update tree and blob resolvers to accept ref_type
Also propagate ref_type to blob and tree presenters so that routes so frontend code can continue depending on the rendered routes
This is the first of a series of MRs for addressing the issue of not being able to browse files when a tag and branch have the same name.
For context the other MRs:
- Controller changes: !122237 (merged)
- Frontend changes: !122145 (merged)
How to set up and validate locally
- Create a project with a branch and tag with the same name
- Try graphql queries to see that the correct blobs and trees are rendered
Example queries
query testPaginatedTree {
project(fullPath: "root/project-with-branch-and-tag-sharing-name") {
id
repository {
paginatedTree(path: "/", ref: "ambiguous", refType: TAGS) {
nodes {
trees {
nodes {
id
sha
name
flatPath
type
webPath
}
}
blobs {
nodes {
id
sha
name
flatPath
type
mode
webPath
lfsOid
}
}
}
}
}
}
}
query testTree {
project(fullPath: "root/project-with-branch-and-tag-sharing-name") {
id
repository {
tree(path: "/", ref: "ambiguous", refType: "HEADS") {
trees {
nodes {
id
sha
name
flatPath
type
webPath
}
}
blobs {
nodes {
id
sha
name
flatPath
type
mode
webPath
lfsOid
}
}
}
}
}
}
query testBlob {
project(fullPath: "root/project-with-branch-and-tag-sharing-name") {
id
repository {
blobs(paths: "README.md", ref: "ambiguous", refType:"HEADS") {
nodes {
id
webPath
name
size
rawSize
fileType
language
path
blamePath
editBlobPath
gitpodBlobUrl
ideEditPath
forkAndEditPath
ideForkAndEditPath
codeNavigationPath
projectBlobPathRoot
forkAndViewPath
environmentFormattedExternalUrl
environmentExternalUrlForRouteMap
canModifyBlob
canCurrentUserPushToBranch
archived
storedExternally
externalStorage
externalStorageUrl
rawPath
replacePath
pipelineEditorPath
}
}
}
}
}
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #20526 (closed)
Edited by Jerry Seto