Improve support for fetching refspecs of merge/pull requests from git (self-hosted) forges
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 42
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
Git forges have a different naming scheme for merge/pull requests.
-
fetch = +refs/merge-requests/*/head:refs/remotes/origin/merge-requests/* -
fetch = +refs/pull/*:refs/remotes/pull/* -
Gogs/Gitea use the same scheme as GitHub.
-
Bitbucket
- not supported on BitBucket Cloud (bitbucket.com) BCLOUD-5814;
- supported on BitBucket Stash (self-hosted) with yet another scheme (doc):
fetch +refs/pull-requests/*/from:refs/remotes/origin/pr/*
This is handled in worker/context.ml, which simply inspects the remote URL. Considering that we're mainly dealing with github.com, gitlab.com, and self-hosted GitLab instances, we check and default to their refspecs in that order.
There's apparently no standard way with git to query the remote for more info (e.g., the type of forge). We could hackishly inspect the headers for certain strings, or use forges REST/GraphQL API for self-hosted domains to detect which kind of refspec it's using.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with worker/context.ml, especially the logic that inspects the remote URL and selects a refspec. Compare the documented GitHub, GitLab, Gogs/Gitea, and self-hosted Bitbucket schemes, then define support for the relevant forges so merge/pull request refs are fetched with the correct naming scheme.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, github, gitlab, ocaml
- Domain
- ci-cd, devops
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100