wtsi-hgi / hgi-systems

Orchestration and configuration management of hgi systems (using terraform & ansible)
GNU General Public License v3.0
3 stars 3 forks source link

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

Closed colin-nolan closed 7 years ago

colin-nolan commented 7 years ago

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.

colin-nolan commented 7 years ago

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.

colin-nolan commented 7 years ago

Bug report filed on the GitLab client library: https://github.com/gpocentek/python-gitlab/issues/250.