package_registry_access_level is ignored during project creation
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
Despite a project is created via the GitLab API with
"package_registry_access_level": "disabled",
the package registry is still available.
Steps to reproduce
Post the following to create a project with only repository features enabled:
curl -X POST --location "https://gitlab.com/api/v4/projects"
-H "Content-Type: application/json"
-H "Private-Token: ..."
-d '{
"name": "My New Project",
"path": "my-new-project",
"description": "A sample project created via GitLab API",
"visibility": "private",
"initialize_with_readme": false,
"analytics_access_level": "disabled",
"builds_access_level": "disabled",
"container_registry_access_level": "disabled",
"environments_access_level": "disabled",
"feature_flags_access_level": "disabled",
"infrastructure_access_level": "disabled",
"issues_access_level": "disabled",
"model_experiments_access_level": "disabled",
"model_registry_access_level": "disabled",
"monitor_access_level": "disabled",
"package_registry_access_level": "disabled",
"pages_access_level": "disabled",
"releases_access_level": "disabled",
"requirements_access_level": "disabled",
"security_and_compliance_access_level": "disabled",
"snippets_access_level": "disabled",
"wiki_access_level": "disabled",
"repository_access_level": "enabled",
"forking_access_level": "enabled",
"merge_requests_access_level": "enabled",
"lfs_enabled": false
}'
The answer includes
"packages_enabled": true,
...
"package_registry_access_level": "private",
Example Project
What is the current bug behavior?
The package registry isn't disabled as requested.
What is the expected correct behavior?
The package registry should be disabled.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Results of GitLab environment info
Reproduced on a GitLab 18.2 CE as well.
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)(we will only investigate if the tests are passing)
Possible fixes
Patch release information for backports
If the bug fix needs to be backported in a patch release to a version under the maintenance policy, please follow the steps on the patch release runbook for GitLab engineers.
Refer to the internal "Release Information" dashboard for information about the next patch release, including the targeted versions, expected release date, and current status.
High-severity bug remediation
To remediate high-severity issues requiring an internal release for single-tenant SaaS instances, refer to the internal release process for engineers.