PR Channels
Enable GitHub PR Issue threads.
By default, GitHub doesn't allow threaded messages in PR issue comments, this makes that some Pullpo functionality, like full bidireccionality (sending all Slack PR Channels messages back to GitHub), may not be shown in the best way.
Before enabling threading
After enabling threading
How to enable GitHub PR Issue Threads
Step 1. Install Pullpo in your GitHub org or individual account.
First, you will need to install Pullpo in your GitHub account. Installing the Pullpo Slack integration is not necessary for issue threading, but it's recommended. Read more about the installation process here.
Step 2. Add GitHub action (runs in 10s)
In every repository where you want to enable GitHub PR issue threads you need to add the following 10s GitHub action:
## .github/workflows/pullpo.yaml
name: Pullpo PR Threads
on:
pull_request:
types: [opened]
jobs:
pullpo_threads:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 0
- name: Create Pullpo thread file with PR SHA
run: |
mkdir -p 一pullpo一
rm -rf 一pullpo一/*
echo "# Pullpo Threaded Conversations on GitHub
## What is the 一pullpo一 directory I see on my project?
The `一pullpo一` directory allows your team to respond to comments that do not reference code in a
dedicated thread, instead of having to \"quote reply\" which makes following a conversation more
complex than it needs to be.
**DO NOT REMOVE OR .GITIGNORE THIS DIRECTORY OR THE AUTO-GENERATED FILES IT CONTAINS**. Doing so will
prevent you, your reviewers and ohter contributors from being able to have threaded messages in GitHub.
## What files does it contain?
The files inside this directory are created by a workflow (which you can probably find in `.github/workflows`)
that is executed when a new pull request is open in this repository. This file is added in a new commit to
your pull request. The **Pullpo GitHub App** transforms your normal comments into threaded comments by
commenting on this uniquely named file.
## Will this directory keep getting bigger and bigger?
No, the workflow removes all previous files in the directory. Since files have unique names within a
repository, this avoids merge conflicts and also prevents an infinetly increasing file list. If the
`一pullpo一` directory contains more than one file, it is likely because multiple pull requests were open at
the same time at one point.
## How will this appear on my Pull Request `Conversation` or `Files Changed` tabs?
The `Conversation` tab will have the new threaded comments. Ideally you'll have
[logged into Pullpo](https://pullpo.io/login/github) with your GitHub account so the Pullpo App will be able
to replace the new comments as authored by you. Otherwise they will show up as an action that the bot made and
you'll be tagged in the new threaded comment.
As for the `Files Changed` tab, the `一pullpo一` directory has been named by prefixing a
special character that sorts it to the bottom of the page, so all comment threads will sit at the bottom and
won't disturb anyone trying to read your changes.
## So, what now...?
Keep contributing as you're used to; your pull requests will receive an additional commit that enables
threaded comments. Other than that everything stays as usual.
" > 一pullpo一/README.md
touch 一pullpo一/pr_${{ github.event.pull_request.number }}_threads.txt
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "add-pullpo-pr-threads"
git push
Step 3. (Optional) Enable full-sync with Slack PR Channels.
To get the most out of Pullpo, enable full sync with PR Slack channels. After installing our Slack integration and synchronizing your devs, you can enable full-sync mode in your Pullpo settings.
What does this GitHub action do?
This GitHub Action, named "Pullpo PR Threads," runs whenever a pull request is opened. This action requires write permissions, thats why we created an action, so that you can see exactly what it does.
Here's what it does:
When a pull request is opened, it creates a special folder called 一pullpo一 if it doesn't already exist. We named it this way so that it always appears at the end of the files changed tab. Inside this folder, a simple text file is created to track discussions related to this specific pull request. Based on how it works, these files will never create merge conflicts.
When someone creates an issue comment on GitHub (or in a PR Slack channel), the Pullpo app is going to take that message and transform it into a file comment message referencing this newly created file.
Basically, this action sets up a spot for threaded conversations linked to pull requests. It helps the Pullpo app to organize comments more neatly.
Is the new created file going to generate merge conflicts?
No, never. The GitHub Action in charge of setting up the 一pullpo一 directory, which allows threaded conversations, produces a distinct file for each new pull request. As the file created for your pull request has its own unique name and is not present in any other pull request, there's no chance of encountering a merge conflict due to Pullpo's threaded conversations workflow.
Why a GitHub action, and not just use the Pullpo app?
To install the Pullpo App we do not ask for permission to write code to your repository. In order to be transparent and let you have complete control on how new files are created on your repository, we are making this action available to everyone. You can modify it as long as the following requisites are kept:
- The action name should continue to be "Pullpo PR Threads" so the Pullpo App recognizes the workflow.
- The created file for each pull request must be created inside the "一pullpo一" directory and be named "pr_${{github.event.pull_request.number}}_threads.txt" since the Pullpo App will use that path for new issue threads.
Besides that, you could change the README.md contents, prevent the removal of previously generated files, etc. It's up to you!