Skip to content

Support multiple Github admin users and organizations.

Boros Gábor requested to merge smarnach/github-admin-users into master

Created by: smarnach

This feature allows to configure a list of admin Github users and organizations for each instance who will be given SSH access to the VMs belonging to the instance.

Testing instructions

Run the included migration using

make migrate

In the Django console, for any OpenEdXInstance, say instance, set the github_admin_users field to a list containing at least one Github organization and one Github user, e.g.

instance.github_admin_users = ['smarnach-org', 'smarnach']

The Github API token you are using needs to have the read:org permission, and needs to be a member of the org, and the org needs to have a team called "Owners".

Then launch an AppServer for the instance using

instance.spawn_appserver()

Once the provisioning started, look at the Ansible configuration of that AppServer (e.g. in the web interface). It should contain the following entry:

COMMON_USER_INFO:
- {github: true, name: smarnach-test, type: admin}
- {github: true, name: smarnach, type: admin}

This list of users should include all members in the Owners team of the org as well as all users listed individually.

You could wait for the provisionig to complete and try to log in as one of these users, but I don't think that's strictly necessary, since this feature has always worked, and I only changed how the list of users is built.

You can also try reverting the migration

honcho run ./manage.py migrate instance 0056

and applying it again

make migrate

After that cycle, the first element of git_admin_users should have been preserved.

Merge request reports