3 ms·
Edit2: This is wrong, see replies below. An update, having now tried this on a toy Gitlab/Github instance. It looks like this still relies on Gitlab's support
by eslaught 9y ago
Edit2: This is wrong, see replies below.
An update, having now tried this on a toy Gitlab/Github instance.
It looks like this still relies on Gitlab's support for mirroring an external repo, which relies on polling. This is less than awesome, because it means we're back into the (many) minutes latency range from pushing changes to seeing them appear in the mirrored repo (and therefore CI). When I did this before, we had to set up a mirror on our own machines to get this latency down into the ~1 minute range, otherwise it was unusable.
What appears to have been added was syncing the build status from CI builds back to Github. That part seems to work as intended.
There does appear to be a Gitlab API for triggering a mirror update, but I don't see an easy way to get that hooked up to Github out of the box. The CI status feature would be much more aweseome with the addition of push-based mirroring.
Edit: And the problem with mirroring manually like we did before is that there isn't a clean way to mirror pull requests (it requires manipulating web APIs, not just pushing a Git repo). So if we went back to that route, we wouldn't really get the seamless experience we've been hoping for.
- williamchia 9y agoHi Eslaught - So the new CI/CD for GitHub feature should be solving the pain points of the old manual mirroring process. When you set up a project and Oauth to GitHub it should automatically implement 3 components: - Bidirectional Mirroring https://gitlab.com/gitlab-org/gitlab-ee/issues/3745 https://gitlab.com/gitlab-org/gitlab-ee/issues/3745 - push webhook to GitLab to trigger CI/CD immediately once a code is committed (e.g. "push mirroring") https://gitlab.com/gitlab-org/gitlab-ee/issues/4691 https://gitlab.com/gitlab-org/gitlab-ee/issues/4691 - GitHub project service integration (to webhook CI status back to GitHub.) https://gitlab.com/gitlab-org/gitlab-ee/issues/3836 https://gitlab.com/gitlab-org/gitlab-ee/issues/3836 Is this not working for you? (may be a bug) Did you set up the toy instance by creating a CI/CD project and use the GitHub Oauth?
- Snappy 9y agoFWIW, if you created the connection between GitLab and GitHub for your project before 10.6, you'll have to remove the connection and then re-add it to get the push-based mirroring to happen. Otherwise, yes, it will still poll.
- eslaught 9y agoHow do you do this?
- williamchia 9y agoIt seems like you should be able to do this, but there may need to be an update to work with already-mirrored repos since the feature was designed to have a flow that expects a new project to be created. I've logged an issue to track down the process: https://gitlab.com/gitlab-org/gitlab-ce/issues/44552 https://gitlab.com/gitlab-org/gitlab-ce/issues/44552
- eslaught 9y agoI guess I got lost on my initial pass through the UI. I deleted my toy repo and did it over again; it seems to be working now. Latency seems to be in the 20-30 second range for incremental pushes, which is pretty good. Is there a way to do this for existing repos? Or do we have to delete and re-create our production repo to do this?
- jamedjo 9y ago> Is there a way to do this for existing repos? You can add a webhook on GitHub and have it point to our Pull Mirroring API [1], followed by manually setting up the integration to send status updates back [2]. We're looking to make this process easier, and have explored ways we might implement this in https://gitlab.com/gitlab-org/gitlab-ee/issues/5220 https://gitlab.com/gitlab-org/gitlab-ee/issues/5220. [1] https://docs.gitlab.com/ee/api/projects.html#start-the-pull-mirroring-process-for-a-project https://docs.gitlab.com/ee/api/projects.html#start-the-pull-... [2] https://docs.gitlab.com/ee/user/project/integrations/github.html https://docs.gitlab.com/ee/user/project/integrations/github....