#5740 Write script to sync fas groups to pagure groups
Closed: Fixed 5 years ago by kevin. Opened 7 years ago by kevin.

We talked about this on the list a while back and never implemented it, but I think we should.

The way it would work is:

  • Gather all groups from pagure that start with 'fas-$name'
  • Check fas for a group called '$name'
  • If that exists then sync all the users in fas group $name to fas-$name on pagure.

For example, if there is a 'fas-sysadmin-main' group on pagure, and there is a sysadmin-main group on fas, it would sync members to that pagure group.

For bonus points it could only run when pagure or fas change anything about group memberships.

We may need to special case some groups like cla_done/fpca_done that everyone is in to not sync.


One question: do we want to allow people being added to fas-foo when they are not actually in the foo group in FAS? Or do we want the group to entirely mirror each others?

good question. I would think it would be best to only allow changing it in fas and overwrite any pagure changes. Otherwise things could get too confusing...

Started working on this - need if for freemedia :)

WIP: https://pagure.io/Free-Media/Housekeeping/blob/fas2pagure/f/scripts/syncFAS2Pagure.py

How do we set things using the pagure API though? The API page has methods to get info, but how do you set groups and users and that sort of thing?

I guess we could just run this on the pagure server and update the database as needed.

We may want to make it fedmsg triggered :)

Yea, that would work well - I don't know much about the pagure internals, though - any hints on how to get the script to update the db? :)

Is there any reason we can't make these groups be updated via the standard OpenID login process?
So just have it request the FAS groups, and only update those groups that have a fas- prefix, with the code that's already there?

So that would update the groups on any user login? As long as that isn't too heavyweight that seems like it would be fine to me.

So pagure support pulling groups from FAS, or having local groups but it does not support a mix of both.

Since we have already local groups, we thought we would not turn on the FAS group feature, which is why we went with the sync group/user script. Tbh, this remains my preferences, adding more fas-specific logic to pagure isn't really appealing (because that would be very Fedora specific).

Any update on whether this ticket still needs action?

Yes, this still needs work.

Metadata Update from @kevin:
- Issue priority set to: Waiting on Asignee

5 years ago

We have now such a script:
https://pagure.io/pagure-utility/blob/master/f/sync_fas_group_membership.py

If anyone needs specific groups synced, please open a new ticket with that request.

:busts_in_silhouette:

Metadata Update from @kevin:
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

5 years ago

Login to comment on this ticket.

Metadata