|
| 1 | +.. _integrations_sourcehut: |
| 2 | + |
| 3 | +SourceHut Integration |
| 4 | +===================== |
| 5 | + |
| 6 | +DejaCode's integration with SourceHut allows you to automatically forward |
| 7 | +**Workflow Requests** to SourceHut **tickets**. |
| 8 | +This behavior can be selectively applied to any **Request Template** of your choice. |
| 9 | + |
| 10 | +Prerequisites |
| 11 | +------------- |
| 12 | + |
| 13 | +- A **SourceHut project** hosted on https://todo.sr.ht that you want to integrate with |
| 14 | + DejaCode. |
| 15 | +- A **SourceHut account** with API access and permission to create/edit tickets. |
| 16 | + |
| 17 | +SourceHut API Token |
| 18 | +------------------- |
| 19 | + |
| 20 | +To enable integration, you need a SourceHut **API token**. |
| 21 | + |
| 22 | +1. **Create a Token**: |
| 23 | + |
| 24 | + - Go to https://meta.sr.ht/oauth2 |
| 25 | + - Under **Personal Access Tokens**, click **"Generate new token"** |
| 26 | + - Set a clear description like ``DejaCode Integration`` in the "Comment" field |
| 27 | + - Select **both** the ``todo.sr.ht`` > ``TRACKERS`` AND ``TICKETS`` scopes |
| 28 | + - **Generate token** and copy the **entire token string** |
| 29 | + |
| 30 | +.. note:: |
| 31 | + |
| 32 | + It is recommended to **create a dedicated SourceHut user** with a clear, descriptive |
| 33 | + name such as ``dejacode-integration``. This ensures that all SourceHut issues |
| 34 | + managed by integration are clearly attributed to that user, improving traceability |
| 35 | + and auditability. |
| 36 | + |
| 37 | +DejaCode Dataspace Configuration |
| 38 | +-------------------------------- |
| 39 | + |
| 40 | +To use your SourceHut token in DejaCode: |
| 41 | + |
| 42 | +1. Go to the **Administration dashboard** |
| 43 | +2. Navigate to **Dataspaces**, and select your Dataspace |
| 44 | +3. Scroll to the **SourceHut Integration** section under **Configuration** |
| 45 | +4. Paste your SourceHut token in the **SourceHut token** field |
| 46 | +5. Save the form |
| 47 | + |
| 48 | +Activate SourceHut Integration on Request Templates |
| 49 | +--------------------------------------------------- |
| 50 | + |
| 51 | +1. Go to the **Administration dashboard** |
| 52 | +2. Navigate to **Workflow** > **Request templates** |
| 53 | +3. Create or edit a Request Template in your Dataspace |
| 54 | +4. Set the **Issue Tracker ID** field to your SourceHut project URL, e.g.:: |
| 55 | + |
| 56 | + https://todo.sr.ht/~USERNAME/PROJECT_NAME |
| 57 | + |
| 58 | +Once the integration is configured: |
| 59 | + |
| 60 | +- New **Requests** using this template will be automatically pushed to SourceHut |
| 61 | +- Field updates (like title or priority) and **status changes** (e.g. closed) will be |
| 62 | + synced |
| 63 | +- New **Comments** on a DejaCode Request will be propagated to the SourceHut ticket |
0 commit comments