Skip to content

Conversation

@cmelone
Copy link
Member

@cmelone cmelone commented Oct 28, 2025

This PR adds a mapping between two accounts: a user from an OAuth provider and a user in a gitlab instance.

The goal is to link a contributor on github.com to their corresponding account on the destination gitlab instance. By adding github as an OAuth provider, we can verify that both identities belong to the same person. When a push event comes in from github, the mapper checks whether the commit author exists as a gitlab user. If they do, the commit can be pushed to the destination repository.

To use this feature, the following environment variables must be set:

  • HC_ACCOUNT_MAP_TYPE="gitlab_oauth"
  • HC_GL_OAUTH_ACCESS_TOKEN -- a personal access token created by an admin of the Gitlab instance with read_api scope (to query the list of users on the instance)
  • HC_GL_OAUTH_PROVIDER="github" -- have only tested this with Github so far, but I imagine that Hubcast users may want to link between two Gitlab instances.

--

This has been tested on gitlab.staging.spack.io.

- modified accountmap interface to default caller to async to avoid conditional calling logic
- the oauth account map requires a numerical github id, changed the interface to accept a full user dict from github, the implementations decide which keys to use for their mapping
- added requester field to oauth account map as gitlab requires an id string associated with each request
@cmelone cmelone marked this pull request as ready for review January 14, 2026 22:00
@cmelone cmelone requested a review from alecbcs January 14, 2026 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant