Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

github integration documentation polishing (#9361)

ulferts8bcd664dc518
diff --git a/docs/system-admin-guide/github-integration/README.md b/docs/system-admin-guide/github-integration/README.md
index 303fb2eec1f..43136ee02cb 100644
--- a/docs/system-admin-guide/github-integration/README.md
+++ b/docs/system-admin-guide/github-integration/README.md
@@ -1,53 +1,67 @@
---
sidebar_navigation:
- title: Github integration
- priority: 600
-description: Integrate the Github pull request workflow into OpenProject.
+title: GitHub integration
+priority: 600
+description: Integrate the GitHub pull request workflow into OpenProject.
robots: index, follow
keywords: github integration
---
# GitHub integration
-OpenProject offers an integration for GitHub pull requests to integrate software development closely with planning and specification.
+OpenProject offers an integration with GitHub pull requests (PRs) to link software development closely to planning and specification.
+You create a pull request in GitHub and link it to an OpenProject work package.
+
+## Overview
OpenProject work packages will directly display information from GitHub in a separate tab.
![GitHub-tab](GitHub-tab.png)
-In your OpenProject work package, the GitHub integration supports you to create a branch straight from the work package and consequently the matching pull request.
+The tab shows all PRs linked to a work package with their corresponding status (e.g. 'Open' or 'Merged') as well as the state (e.g. 'success' or 'queued') of the GitHub actions configured to run for a PR. PRs and work packages are in an n:m relationship, so a work package can be linked to multiple PRs and a PR can be linked to multiple work packages.
+Additionally, in your OpenProject work package, the GitHub integration supports you to create a branch straight from the work package and consequently the matching pull request.
![GitHub-create-branch](GitHub-create-branch.png)
-In order to create a new branch, open the GitHub tab in your OpenProject work package detail view. Click on Git snippets to extend the menu. First, copy the branch name.
+Pull request activities will also show up in the Activity tab when the pull request is
-![GitHub-copy-branch-name](GitHub-copy-branch-name.png)
+* first referenced (usually when opened)
+* merged
+* closed
-Then, open your desktop client, e.g. GitHub desktop. There, you create your branch with the name you copied from your OpenProject work package.
+![Github comments on work package](workpackage-github-comments.png)
-![GitHub-desktop-new-branch](GitHub-desktop-new-branch.png)
+## Creating a pull request
+
+As pull requests are based on branches, a new branch needs to be created first. For that, open the GitHub tab in your OpenProject work package detail view. Click on 'Git snippets' to extend the menu. First, copy the branch name by clicking the corresponding button.
+
+![GitHub-copy-branch-name](GitHub-copy-branch-name.png)
-Then go to Typora (or any other editor) and create content or make changes.
+Then, open your git client, e.g. GitHub desktop or a console. There, you create your branch with the name you copied from your OpenProject work package. That way, all the branches will follow a common pattern and as the OpenProject ID is included in the branch name, it will be easy to see the connection between a PR and a work package when taking a look at a list of PRs on GitHub.
-![GitHub-test-copy](GitHub-test-copy.png)
+![GitHub-desktop-new-branch](GitHub-desktop-new-branch.png)
-Save and the changes will appear in GitHub desktop or the client you are using.
+With the branch opened, you can start the actual development work using whatever tool you deem to be the best (it is VIM BTW), to alter your codebase.
![GitHub-changes](GitHub-changes.png)
-In order to commit these changes, go to OpenProject to copy the commit message.
+Once you are satisfied with the changes you create a commit. Within the 'Git snippets' menu, OpenProject suggests a commit message for you based on the title and the URL of the work package.
![GitHub_OpenProject-commit-message](GitHub_OpenProject-commit-message.png)
-And use it in the GitHub desktop commmit message field. Make sure you use the reference for the OpenProject work package (in this case #6006) in the title.
+A URL pointing to a work package within a pull request description or a comment will lead to the two entities becoming linked. Using the value in the 'Commit message' input thus helps you to establish that link. The link needs to be in the PR and not in a commit but GitHub will use the first commit message as the proposed branch description (as long as there is only one commit).
![GitHub-commit](GitHub-commit-2645308.png)
-After having committed, publish your branch.
+Once the branch is published,
![GitHub-publish-branch](GitHub-publish-branch.png)
-Subsequently, you can create your pull request. Title and comment with the link to the respective OpenProject work package will be prefilled. If you want, you can add some additional information.
+you create your pull request. Title and comment with the link to the respective OpenProject work package will be prefilled, at least if there is only one commit to the branch. Because of this one commit limitation and if the policy is to create a branch as early as possible, there is a third option in the 'Git snippets' menu ('Create branch with empty commit') that will open a branch and add an empty commit to it in one command. Using this option, one can first create the branch quickly and have it linked to the work package right from the beginning. Commits can of course be added to the branch (and PR) after that.
+
+The branch description can be amended before a PR is created giving the opportunity to further describe the changes. To help with that, it is also possible to copy parts of the work package description since the description can be displayed in the markdown format. Links to additional work packages can also be included in the PR description.
+
+Rather than inserting a link to the work package you can also reference it just by adding "OP#87" to the pull request's description where 87 is the ID of the work package.
![GitHub-open-pull-request](GitHub-open-pull-request-2645707.png)
@@ -59,7 +73,7 @@ When you click on the link in the comment, it will take you to the OpenProject w
![GitHub-work-package-activity](GitHub-work-package-activity-2646492.png)
-In the GitHub tab of that work package, the status of the pull request as well as the GitHub Action will be displayed.
+In the GitHub tab of that work package, the status of the pull request as well as status of all the configured GitHub Actions will also be displayed.
![GitHub-action](GitHub-action.png)
@@ -67,8 +81,6 @@ If the status of a pull request changes, it will accordingly appear in its OpenP
![GitHub-pull-request-status](GitHub-pull-request-status.png)
-
-
## Configuration
You will have to configure both OpenProject and GitHub for the integration to work.
@@ -77,13 +89,13 @@ You will have to configure both OpenProject and GitHub for the integration to wo
First you will need to create a user in OpenProject that will make the comments.
The user will have to be added to each project with a role that allows them
-to comment on work packages.
+to see work packages and comment on them.
The role needs two permissions and should only receive those two: "View work packages" and "Add notes" which you will find in the "Work package tracking" section.
-![Github role with 'add notes' permission](github-role.png)
+![GitHub role with 'add notes' permission](github-role.png)
-![Github user added as member to project with respective role](github-project-member.png)
+![GitHub user added as member to project with respective role](github-project-member.png)
Once the user is created you need to generate an OpenProject API token for it
to use later on the GitHub side of things. For this you have to:
@@ -97,13 +109,15 @@ Copy the generated key. You can then configure the necessary webhook in GitHub.
In addition, in *Project settings* and *Modules* you will need to activate the GitHub module so that all information pulling through from GitHub will be shown in the work packages.
-![Github-module](Github-module-2647262.png)
+![GitHub-module](Github-module-2647262.png)
+
+Seeing the 'GitHub' tab requires permission so the permission needs to be granted to all roles in a project allowed to see the tab.
### GitHub
In GitHub you have to set up a webhook in each repository to be integrated with OpenProject.
-![Create the webhook in Github](create-github-webhook.png)
+![Create the webhook in GitHub](create-github-webhook.png)
You need to configure just two things in the webhook.
The **Content Type** has to be `application/json`.
@@ -116,4 +130,4 @@ https://myopenproject.com/webhooks/github?key=42
```
_Earlier version may have used the `api_key` parameter. In OpenProject 10.4, it is `key`._
-Now the integration is set up on both sides and you can use it.
+Now the integration is set up on both sides and you can use it.
\ No newline at end of file