Skip to content

gh-gl-sync: Add option for using a gitlab oauth token - #1387

Open
kwryankrattiger wants to merge 3 commits into
spack:mainfrom
kwryankrattiger:rk/sync/gitlab_oauth_token
Open

gh-gl-sync: Add option for using a gitlab oauth token#1387
kwryankrattiger wants to merge 3 commits into
spack:mainfrom
kwryankrattiger:rk/sync/gitlab_oauth_token

Conversation

@kwryankrattiger

Copy link
Copy Markdown
Collaborator

Passing private base64 encoded ssh keys doesn't make sense in all context. When running the sync script as a cron from Gitlab itself using the temporary job token is better practice.

Passing private base64 encoded ssh keys doesn't make sense in all
context. When running the sync script as a cron from Gitlab itself using
the temporary job token is better practice.
Comment thread images/gh-gl-sync/SpackCIBridge.py Outdated
@hainest

hainest commented Jul 9, 2026

Copy link
Copy Markdown

When using ghcr.io/spack/ci-bridge:0.0.44, I get an error that Auth is not a member of github. Switching to 0.0.51 of the container works fine. I'm assuming we just need to update the default value for sync_image in dav-sdk/gh-gl-sync/github-sync?

Co-authored-by: Tim Haines <thaines.astro@gmail.com>
@hainest

hainest commented Jul 9, 2026

Copy link
Copy Markdown

@kwryankrattiger Is https://gitlab.spack.io/dav-sdk/gh-gl-sync the official repo for the github-sync component?

@kwryankrattiger

Copy link
Copy Markdown
Collaborator Author

Is https://gitlab.spack.io/dav-sdk/gh-gl-sync the official repo for the github-sync component?

yes, afaik that is the only place it is published now.

else:
url = url._replace(netloc=f"spackbot:{token}@" + url.netloc)

_write_secret(".git-credentials", urllib.parse.urlunparse(url) + "\n")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to update the gitlab remote repo name name to match what's in the credentials file. I'm not entirely certain why this is needed because everything I've seen indicates that the https://gitlab.spack.io should be enough to match. 🤷

Suggested change
_write_secret(".git-credentials", urllib.parse.urlunparse(url) + "\n")
self.gitlab_repo = urllib.parse.urlunparse(url)
_write_secret(".git-credentials", self.gitlab_repo + "\n")

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.

2 participants