wtsi-hgi/hgi-systems

403 Forbidden when set to disable (enabled) shared runners on a Gitlab project

Closed this issue · 2 comments

Shared runners are currently being disabled with this code:

project.shared_runners_enabled = False
project.save()

Call to this save method tries to put this data:

{
    "name": "hgi-arvados-compute-image-builder",
    "public": true,
    "visibility_level": 20,
    "public_builds": true,
    "description": "",
    "container_registry_enabled": true,  
    "issues_enabled": true,
    "snippets_enabled": false,
    "only_allow_merge_if_build_succeeds": false,
    "builds_enabled": true,
    "path": "hgi-arvados-compute-image-builder",
    "lfs_enabled": true,
    "wiki_enabled": true,
    "default_branch": "master",
    "only_allow_merge_if_all_discussions_are_resolved": false,
    "shared_runners_enabled": false,
    "merge_requests_enabled": true,
    "request_access_enabled": false
}

It would appear the failure is because of a lack of permissions to change any of these parameters:

{
    "name": "hgi-arvados-compute-image-builder",
    "public": true,
    "visibility_level": 20,
}

Changing the shared_runners_enabled property on its own works fine.

I think this is an upstream issue: it shouldn't be trying to (re)set so many properties when I only requested to change 1!

I will file a bug report on the GitLab python library that this is using.

Bug report filed on the GitLab client library: python-gitlab/python-gitlab#250.