[go: up one dir, main page]

Skip to content

Access repo name/slug easily/quickly

Release notes

The name of a repo is not easily accessible. It should be easy to access this name without having to launch the rails runner each time.

Problem to solve

Running gitlab-rails runner "projectName = ProjectRepository.find_by(disk_path: '@hashed/4b/22/4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a').project.name; puts projectName" takes way too long to finish executing. Getting the name of a repo should be on the order of 1ms, not 60s.

User experience goal

The user should be able to use the GitLab to get the name of the current repo from a hook.

Further details

Use case: in a hook, the name of the repo needs to be accessible. Pushing to the repo should not take an entire extra minute for hooks that need this repo name information. Waiting for the rails runner to start up and execute is not an acceptable cost for this type of action.

Permissions and Security

Since hooks are admin-level, permissions are the same as admin permissions.

Availability & Testing

This is an extremely minor feature.