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.

  • Close this issue

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.

backend

Support frontend with providing both reference name and resolved commit sha.

frontend

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 Sep 22, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading