[go: up one dir, main page]

Skip to content

Extend Project Alias API to allow Project Aliases in Groups

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem to solve

The current Project Alias API is not fully integrated into the nested groups.

When creating a project alias using the Project Alias API, we can currently control which project (by providing the project_id) the alias will link to, and how the alias name for the project will be. As of now, we can not provide a group (by any means) in which the new alias will appear, effectively limiting aliases to projects without groups.

Intended users

This feature will primarily be used by:

User experience goal

The (administrative) user should be able to create aliases using the established Project Alias API in any valid namespace (path/group) by providing a single group_id to attach the alias to, or continue to create aliases in the root namespace. This should be consistent with the way projects can be created in the root namespace, or any valid group.

Proposal

We propose to expand the Project Aliases and the Project Alias API by an optional argument group_id, which allows to attach and alias to a group to surface in. Further, the alias system must be expanded to allow access to the project by the group only, if a group_id is given, and by the root of all projects only, if no group_id is given.

Example:

Consider this legacy structure (synthesized from our actual structure; as seen from build process, hence with .git extension):

application.git
components/gluefunc1.git
components/gluefunc2.git
libfunc1.git
libfunc2.git

Now, the structure is changed to divide mirrored external projects from local projects:

external/libfunc1.git
project/application.git
project/components/gluefunc1.git
project/components/gluefunc2.git
project/libfunc1.git

With the Project Alias API, we can add compatibility links to some of the projects:

application.git --> project/application.git
libfunc1.git    --> external/libfunc1.git
libfunc2.git    --> project/libfunc1.git

We can, however, not provide aliases for these projects:

components/gluefunc1.git --> project/components/gluefunc1.git
components/gluefunc2.git --> project/components/gluefunc2.git

In this example, the proposed system allows to keep a group components in the root namespace, create a distinct group project/components (in the project group/namespace), move the projects gluefunc1 and gluefunc2 there, and link to them in the components group. This allows access to those projects as required.

Further details

Use Case: Support Migration

In our legacy Git server instance, we need to organize projects in groups for a number of reasons. Once in a while, we tend to change the structure of our projects, to reflect new organizational changes, or mitigate problems (like name clashes). While we move a project to a new path, we must provide a backward compatibile project structure for legacy builds: Those build should run without modifications for some time. We can easily achive this by moving the project to the intended target path, then provide a symlink to make the same project available at the original path.

When migrating the legacy Git server to Gitlab, we need to provide those backward compatible access paths, which is even under perfect circumstances not always possible. Since the legacy repository tree is imported into its own group as a separate namespace, we cannot leverage the Project Alias API at all.

Use Case: Restructuration of Projects

In the past, in our projects a number of reasons lead to a restructuration of our repository/project structure: Distinction of projects, code origin, different ideas on limiting the access to specific parts of the source tree, automation requirements, and, finally, convenience. We always need to keep old build structures alive for a limited time. This does not only allow to move projects into groups, but keeps a list of currently available access paths in form of the list of project aliases. This allows us to enable backward compatibility, and, when no longer needed, safely terminate it.

Permissions and Security

This should not impact permissions or security concerns beyond what should already be in place for the current Project Alias system.

Documentation

Dokumentation on the Project Alias API needs to be updated. It is assumed documentation of the current limitations needs to be adapted, if there is anything beyond the Project Alias API.

What does success look like, and how can we measure that?

For context: At this point we consider the alias as a more or less temporary helper for git/ssh access to repositories, not as full-blown generic alias with impact to the web GUI.

For success, GitLab project aliases should be useable like symlinks of git repositories insofar as git/ssh access to the repository is concerned.

Links / references

Edited by 🤖 GitLab Bot 🤖