GitHub project service integration (manual)
When GitLab CI/CD executes pipelines for a project that mirrors a GitHub project, the pipeline status is visible only in GitLab. This requires users to go to GitLab in order to see the health of their project, while they should be able to see it directly in the GitHub interface.
We should implement a way to send the status back to the original project in GitHub, as many other CI/CD systems do.
Proposal
Create a project service integration for GitHub, that allows sending the status back to the original project using the GitHub status APIs (https://developer.github.com/v3/repos/statuses/).
Ask for the minimal information needed:
- GitHub address (to allow for on-prem GitHub Enterprise) (default to github.com)
- Personal API token (https://github.com/blog/1509-personal-api-tokens)
- Project owner (namespace) (default to namespace, if match found in GitHub)
- Project name (default to project name, if match found in GitHub)
When active, the service will connect to GitHub and update the commit status automatically.
Follow up improvements (%10.6)
- Automatically fill and enable GitHub project service integration if importing a CI/CD only project from GitHuhb
Future improvements:
- Provide a button to automatically connect to GitHub account and fill in 1 and 2. [Mark: I don't believe you can use the API to fetch or generate a personal API token, but we can use OAuth instead of a token.]
- Send environment deployment status to GitHub (https://gitlab.com/gitlab-org/gitlab-ee/issues/3842).
Design
Empty | Authorize | Filled | PR status |
---|---|---|---|
Links / references
- https://gitlab.com/gitlab-org/gitlab-ee/issues/3836
- https://gitlab.com/gitlab-org/gitlab-ee/issues/3745
- https://gitlab.com/gitlab-org/gitlab-ee/issues/3842
- GitHub API: create a commit status
Documentation blurb
Overview
What is it? Why should someone use this feature? What is the underlying (business) problem? How do you use this feature?
Use cases
Who is this for? Provide one or more use cases.
Feature checklist
Make sure these are completed before closing the issue, with a link to the relevant commit.
-
Feature assurance -
Documentation -
Added to features.yml