Description
Describe the problem
GitLab supports organizing repositories into "subgroups":
https://docs.gitlab.com/user/group/subgroups/
This affects the repository URL structure:
https://docs.gitlab.com/user/namespace/
For example, the repository URL for the "VEGA_MLX90614" library is:
https://gitlab.com/riscv-vega/vega-sensor-libraries/sensors/vega_mlx90614.git
The vega_mlx90614
repository is under the "VEGA-SENSOR-LIBRARIES/SENSORS" subgroup (which has the URL slug vega-sensor-libraries/sensors
) subgroup of the riscv-vega
group.
libraries-repository engine stores archives in a folder structure based on the repository URL. Normally this has the reasonable structure:
<LibrariesFolder>/<host>/<repo owner>/<library name>-<version>.zip
(where <LibrariesFolder>
is the value of the LibrariesFolder
key from the configuration file)
e.g.:
/home/ubuntu/workspace/libraries/github.com/arduino-libraries/Servo-1.0.0.zip
The way the code obtains the name of the <repo owner>
folder is by taking the last path component:
libraries-repository-engine/internal/libraries/archive/archive.go
Lines 59 to 60 in 22d4c14
🐛 Release archives for libraries from repositories under a GitLab subgroup are stored in a folder named according to the bottom level subgroup URL slug instead of the owner URL slug.
For example, the [email protected] release archive is stored at this path:
<LibrariesFolder>/gitlab.com/sensors/VEGA_MLX90614-1.0.0.zip
(note the folder name is sensors
instead of riscv-vega
)
Although it doesn't cause any technical problems, this is potentially confusing to human maintainers of the backend machine because:
- When looking at this directory, we would expect to be able to identify the repository owner name from the folder name
- If separate owners use the same subgroup name, their archives will be stored together in the same folder, whereas we expect there to be a dedicated folder for each user's libraries.
To reproduce
Run a sync
command using a registry file with the following content:
https://gitlab.com/riscv-vega/vega-sensor-libraries/sensors/vega_mlx90614.git|Contributed|VEGA_MLX90614
🐛 The generated release archives are stored under <LibrariesFolder>/gitlab.com/sensors
.
Of course you can also see this path in the Releases[*].URL
values in the generated "DB" file, and libraries[*].url
in the generated libraries index file.
Expected behavior
Library release archive files are always stored under a folder structure with a <host>/<owner>
naming scheme.
In the case of the "VEGA_MLX90614", the expected folder structure is gitlab.com/riscv-vega
.
libraries-repository-engine version
Additional context
You might conclude that this bug could result in collisions. However, collisions are not possible because the archive files are named by the library name and each library must have a unique name.
Issue checklist
- I searched for previous reports in the issue tracker
- My report contains all necessary details