Use commit sha for API calls on project view page
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Epic: &11540 (closed)
Problem
A project page (https://gitlab.com/gitlab-org/gitlab) uses a reference name for API requests.
Proposal
Resolve the reference name on page load and use the corresponding commit sha for API requests.
backend finds a default branch for the project and exposes both a reference name main
and a commit sha aaaa
to frontend.
frontend uses the reference name on UI and the commit sha for API requests.
Support frontend with providing both reference name and resolved commit sha.
Modify affected requests to use commit sha as a ref
:
- getPaginatedTree (GraphQL)
- pathLastCommit (GraphQL)
- Logs_tree request: https://gitlab.com/gitlab-org/gitlab/-/refs/master/logs_tree/?format=json&offset=0 (API)
- Readme request: https://gitlab.com/gitlab-org/gitlab/-/blob/master/README.md?format=json&viewer=rich (API)
Edited by 🤖 GitLab Bot 🤖