diff --git a/docs.json b/docs.json index 20d59dc..dba36dc 100644 --- a/docs.json +++ b/docs.json @@ -223,7 +223,8 @@ "flaky-tests/webhooks/slack-integration", "flaky-tests/webhooks/microsoft-teams-integration", "flaky-tests/webhooks/github-issues-integration", - "flaky-tests/webhooks/linear-integration" + "flaky-tests/webhooks/linear-integration", + "flaky-tests/webhooks/jira-integration" ] }, { diff --git a/flaky-tests/get-started/ci-providers/droneci.mdx b/flaky-tests/get-started/ci-providers/droneci.mdx index a4f26d2..bc22e7d 100644 --- a/flaky-tests/get-started/ci-providers/droneci.mdx +++ b/flaky-tests/get-started/ci-providers/droneci.mdx @@ -74,11 +74,11 @@ steps: environment: TRUNK_ORG_SLUG: from_secret: TRUNK_ORG_SLUG - TRUNK_API_TOKEN: - from_secret: TRUNK_API_TOKEN + TRUNK_TOKEN: + from_secret: TRUNK_TOKEN commands: - - curl -fsSLO --retry 3 https://trunk.io/releases/trunk && chmod +x ./trunk - - ./trunk flakytests upload --junit-paths --org-url-slug --token $TRUNK_TOKEN + - curl -fL --retry 3 "https://github.com/trunk-io/analytics-cli/releases/latest/download/trunk-analytics-cli-x86_64-unknown-linux.tar.gz" | tar -xz && chmod +x trunk-analytics-cli + - ./trunk-analytics-cli upload --junit-paths --org-url-slug --token $TRUNK_TOKEN ``` @@ -98,11 +98,11 @@ steps: environment: TRUNK_ORG_SLUG: from_secret: TRUNK_ORG_SLUG - TRUNK_API_TOKEN: - from_secret: TRUNK_API_TOKEN + TRUNK_TOKEN: + from_secret: TRUNK_TOKEN commands: - - curl -fsSLO --retry 3 https://trunk.io/releases/trunk && chmod +x ./trunk - - ./trunk flakytests upload --bazel-bep-path --org-url-slug --token $TRUNK_TOKEN + - curl -fL --retry 3 "https://github.com/trunk-io/analytics-cli/releases/latest/download/trunk-analytics-cli-x86_64-unknown-linux.tar.gz" | tar -xz && chmod +x trunk-analytics-cli + - ./trunk-analytics-cli upload --bazel-bep-path --org-url-slug --token $TRUNK_TOKEN ``` @@ -122,11 +122,11 @@ steps: environment: TRUNK_ORG_SLUG: from_secret: TRUNK_ORG_SLUG - TRUNK_API_TOKEN: - from_secret: TRUNK_API_TOKEN + TRUNK_TOKEN: + from_secret: TRUNK_TOKEN commands: - - curl -fsSLO --retry 3 https://trunk.io/releases/trunk && chmod +x ./trunk - - ./trunk flakytests upload --xcresult-path --org-url-slug --token $TRUNK_TOKEN + - curl -fL --retry 3 "https://github.com/trunk-io/analytics-cli/releases/latest/download/trunk-analytics-cli-x86_64-unknown-linux.tar.gz" | tar -xz && chmod +x trunk-analytics-cli + - ./trunk-analytics-cli upload --xcresult-path --org-url-slug --token $TRUNK_TOKEN ``` diff --git a/flaky-tests/webhooks.mdx b/flaky-tests/webhooks.mdx index d496550..7aebec1 100644 --- a/flaky-tests/webhooks.mdx +++ b/flaky-tests/webhooks.mdx @@ -16,4 +16,4 @@ Open the referenced resource in a new tab. You can also find guides for specific examples here: -
Send a Slack Messageslack-integration
Create a GitHub Issuegithub-issues-integration
Send a Microsoft Teams Messagemicrosoft-teams-integration
Create a Linear Issuelinear-integration
+
Send a Slack Messageslack-integration
Create a GitHub Issuegithub-issues-integration
Send a Microsoft Teams Messagemicrosoft-teams-integration
Create a Linear Issuelinear-integration
Create a Jira Issuejira-integration
diff --git a/flaky-tests/webhooks/jira-integration.mdx b/flaky-tests/webhooks/jira-integration.mdx new file mode 100644 index 0000000..be8be8a --- /dev/null +++ b/flaky-tests/webhooks/jira-integration.mdx @@ -0,0 +1,200 @@ +--- +title: "Jira integration" +description: "Learn how to automatically create Jira issues with Flaky Test webhooks" +--- + +Trunk allows you to automate Jira issue creation through webhooks. When a test becomes flaky and impacts enough PRs, a Jira issue is created automatically with full context including failure rates, ownership, and stack traces. + +This guide will walk you through integrating Trunk Flaky Tests with Jira through webhooks. You will be able to automatically generate Jira issues for **new flaky tests** found in your repo that **impact more than 2 PRs**. This guide should take 15 minutes to complete. + +Trunk also has a [built-in Jira integration](/flaky-tests/ticketing-integrations/jira-integration) for manual ticket creation. You only need to use webhooks if you want to automate ticket creation or need additional customization. + +### 1. Create a Jira API Token + +Before you can create a webhook to automate Jira issue creation, you need to create an API token to authorize your requests. + +1. Go to [Atlassian API token management](https://id.atlassian.com/manage-profile/security/api-tokens). +2. Click **Create API token**, give it a label (e.g., "Trunk Webhooks"), and click **Create**. +3. Copy the token and save it in a secure location. You'll need it later. + +You'll also need to generate a Base64-encoded credential string for authentication. Run this in your terminal: + +```bash +echo -n "your-email@example.com:your-api-token" | base64 +``` + +Replace `your-email@example.com` with the email associated with your Jira account and `your-api-token` with the token you just created. Save the output for step 3. + +### 2. Add a new webhook in Trunk + +Trunk uses Svix to integrate with other services, such as creating Jira issues through webhooks. + +You can create a new endpoint by: + +1. Login to [Trunk Flaky Tests](https://app.trunk.io/login?intent=flaky%20tests) +2. From your profile on the top right, navigate to **Settings** +3. Under **Organization > Webhooks**, click **Automate Jira Issues Creation**. +4. Set the **Endpoint URL** to your Jira Cloud REST API endpoint: `https://.atlassian.net/rest/api/2/issue`. Replace `` with your Jira Cloud domain (e.g., `acme` if your Jira URL is `acme.atlassian.net`). +5. Review the transformation code automatically generated for Jira issues. You can customize this transformation at any time. Learn more about [customizing transformations](#5-customize-your-transformation). +6. Create the new endpoint. You will be redirected to the endpoint configuration view. + +If you're having trouble adding a new webhook endpoint with Svix, please see the [Adding Endpoint docs from Svix](https://docs.svix.com/receiving/using-app-portal/adding-endpoints). + +### 3. Add custom headers + +The Jira REST API requires authentication headers. You can configure custom headers in the endpoint configuration: + +1. Navigate to **Webhooks > Advanced > Custom Headers.** +2. Fill in the **Key** and **Value** referencing the table below, and click the **+** button to add each header. + +You'll need to configure the following headers: + +| Key | Value | +| --------------- | ------------------------ | +| `Authorization` | `Basic ` | +| `Content-Type` | `application/json` | + +Replace `` with the Base64-encoded string you generated in [step 1](#1-create-a-jira-api-token). + +### 4. Find your Jira project key and issue type + +You'll need your Jira project key and preferred issue type to configure the transformation. + +**Project key:** This is the short prefix on your Jira issues (e.g., `ENG`, `PROJ`, `KAN`). You can find it in the URL when viewing your Jira project: `https://your-domain.atlassian.net/jira/software/projects//board`. + +**Issue type:** The type of issue to create. Common values are `Bug`, `Task`, or `Story`. The default is `Bug`. + +### 5. Customize your transformation + +Transformations are custom code snippets you can write to customize the Jira issues created by the webhook. A working template transformation will be added automatically for your webhook, but you can further customize the behavior. + +1. In the endpoint configuration view, navigate to the **Advanced** tab. Under **Transformation**, toggle the **Enabled** switch. +2. Click **Edit transformation** to update your transformation code, and click **Save** to update the transformation. +3. You can test the transformation by selecting the `test_case.status_changed` payload and clicking **Run Test**. This will test the transformation but not send a message. You will learn to send a test message [in step 6](#6-test-your-webhook). + +The generated webhook template contains several configurable constants out of the box: + +| Constant | Description | +|----------|-------------| +| `JIRA_PROJECT_KEY` | **(Required)** Your Jira project key (e.g., `ENG`, `PROJ`). | +| `JIRA_ISSUE_TYPE` | **(Optional)** The issue type to create. Defaults to `Bug`. | +| `JIRA_LABELS` | **(Optional)** Array of labels to add to the issue. Defaults to `["flaky-test"]`. | +| `JIRA_CUSTOM_FIELDS` | **(Optional)** Object of custom field key-value pairs for projects that require additional fields. | +| `PRS_IMPACTED_THRESHOLD` | Issues will be created only for flaky tests that have impacted more PRs than the `PRS_IMPACTED_THRESHOLD`.

You can adjust this value if you see many issues about low-impact flaky tests. | + +Here is the provided transformation for context. You can customize your Jira issues integration by following the [Jira REST API docs](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-post) and [Svix transformations](https://docs.svix.com/transformations#using-transformations) documentation. + + +The default transformation only creates issues when `newStatus === "flaky"`. If you also want to create issues for tests marked as **Broken** (consistently failing at a high rate), update the filter condition. For example, change `newStatus !== "flaky"` to `newStatus !== "flaky" && newStatus !== "broken"` to handle both statuses. + + +```javascript +/** + * @param webhook the webhook object + * @param webhook.method destination method. Allowed values: "POST", "PUT" + * @param webhook.url current destination address + * @param webhook.eventType current webhook Event Type + * @param webhook.payload JSON payload + * @param webhook.cancel whether to cancel dispatch of the given webhook + */ + +// Your Jira project key (e.g., "PROJ", "ENG"). This is required! +const JIRA_PROJECT_KEY = ""; +// The Jira issue type to create (e.g., "Bug", "Task", "Story"). Defaults to "Bug". +const JIRA_ISSUE_TYPE = "Bug"; +// Labels to add to the Jira issue. Optional. +const JIRA_LABELS = ["flaky-test"]; + +// Add any custom required fields your Jira project needs. Optional. +// Example: { "customfield_10042": { "value": "Platform" }, "customfield_10043": "some-value" } +const JIRA_CUSTOM_FIELDS = {}; + +// At least this many PRs need to be impacted for an issue to be created. +const PRS_IMPACTED_THRESHOLD = 2; + +function handler(webhook) { + const impacted_prs = webhook.payload.test_case.pull_requests_impacted_last_7d; + const newStatus = webhook.payload.status_change.current_status.value; + + // Filter for only flaky tests that impact more than the provided threshold + if (newStatus !== "flaky" || impacted_prs < PRS_IMPACTED_THRESHOLD) { + webhook.payload = "canceled"; + webhook.cancel = true; + return webhook; + } + + const description = summarizeTestCase(webhook.payload); + + webhook.payload = { + fields: { + project: { key: JIRA_PROJECT_KEY }, + issuetype: { name: JIRA_ISSUE_TYPE }, + summary: `Flaky Test: ${webhook.payload.test_case.name}`, + description: description, + labels: JIRA_LABELS, + ...JIRA_CUSTOM_FIELDS, + }, + }; + return webhook; +} + +function summarizeTestCase(payload) { + const { + status_change: { previous_status }, + test_case: { + name, file_path, status, quarantine, repository, codeowners, + failure_rate_last_7d, most_common_failures, + pull_requests_impacted_last_7d, ticket, html_url + } + } = payload; + + const issueBody = `See all details on the [Trunk Test Detail page|${html_url}] + +Transition time: ${status.timestamp} + +Severity (last 7 days): ${(failure_rate_last_7d * 100).toFixed(2)}% failure rate; impacting ${pull_requests_impacted_last_7d} PRs + +Ownership: this test is owned by ${(codeowners || ['@unassigned']).join(', ')} + +---- +*The most common failure reasons (out of ${most_common_failures.length} identified) are:* + +${most_common_failures.map((failure, index) => { + return `*Reason #${index + 1}*: "${failure.summary}" \n` +}).join('')} + +View the full stack trace on the [Test Detail page|${html_url}] + `; + return issueBody; +} +``` + + +The description uses [Jira wiki markup](https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=texteffects) for formatting. Links use the `[text|url]` syntax rather than markdown. + + +### 6. Test your webhook + +You can create test issues by delivering a mock webhook. You can do this by: + +1. In the endpoint configuration view, navigate to the **Testing** tab and select a **Send event** +2. Under **Subscribed events,** select `test_case.status_changed` as the event type to send +3. Click **Send Example** to test your webhook + +### 7. Monitoring webhooks + +You can monitor the events and the webhook's delivery logs in the **Overview** tab of an endpoint configuration view. + +You can see an overview of how many webhook deliveries have been attempted, how many are successful, how many are in flight, and how many fail in the **Attempt Delivery Status** modal. + +You can see a list of past delivery attempts in the **Message Attempts** modal. You can filter this list by **Succeeded** and **Failed** status, and you can click on each message to see the **Message content**, response code, and error message of each attempt. You can learn more about [replaying messages](https://docs.svix.com/receiving/using-app-portal/replaying-messages) and [filtering logs](https://docs.svix.com/receiving/using-app-portal/filtering-logs) in the Svix docs. + +### Congratulations! + +A Jira issue will now be created when a test's health status changes to **flaky** and **impacts more than 2 PRs**. You can further modify your transformation script to customize your issues. + +[See the Trunk webhook event catalog](https://www.svix.com/event-types/us/org_2eQPL41Ew5XSHxiXZIamIUIXg8H/#test_case.status_changed) + +[Learn more about consuming webhooks in the Svix docs](https://docs.svix.com/receiving/introduction) + +[Learn more about Jira's REST API](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/) diff --git a/merge-queue/integration-for-slack.mdx b/merge-queue/integration-for-slack.mdx index 6853ae8..e900503 100644 --- a/merge-queue/integration-for-slack.mdx +++ b/merge-queue/integration-for-slack.mdx @@ -1,35 +1,57 @@ --- -title: "Slack Integration" -description: "Push updates about your queue status to Slack to keep your team informed." +title: "Integration for Slack" +description: "Send merge queue updates to multiple Slack channels and receive personal DM notifications — all powered by the Trunk Slack app." --- -Trunk Merge Queue integrates with Slack to send real-time notifications about queue activity and pull request state changes to a designated channel or directly to you as personal notifications. +Trunk Merge Queue integrates with Slack to send real-time notifications about queue activity and pull request state changes. You can route notifications to **multiple Slack channels** per repository, each with its own set of enabled topics, and receive **personal DMs** about your own PRs directly in Slack. -
+ +For details on how Trunk collects, manages, and stores your data, see our [Security and Privacy](/setup-and-administration/security) page. + + +## Installing the Trunk Slack App + +Before you can set up channel notifications or personal DMs, a Slack workspace admin must install the Trunk Slack app for your organization. This is a one-time setup that enables all Slack integration features. + +### Steps to Install + +1. In the Trunk web app, navigate to **Settings > Organization > Slack**. +2. Click **Add to Slack**. +3. Review and approve the requested permissions on the Slack OAuth screen. +4. You'll be redirected back to Trunk. The page will show your workspace as **Connected** along with the workspace name. -After you have Merge Queue set up and running in your repository, you can configure Slack notifications to receive alerts for various queue events. +### Managing the Connection + +Once connected, you can **Reconnect** (to reauthorize) or **Disconnect** the workspace from the same settings page. + + +**Migrating from legacy Slack integration?** If your organization previously connected Slack through the per-repo "Connect with Slack" flow, you still need to complete this new workspace-level installation to access multi-channel notifications and the new personal DM features. After installing, you can set up channel connections and personal notifications using the new workflows described below. + ## Channel Notifications -Send merge queue updates to a shared team Slack channel to keep everyone informed about queue activity. +Send merge queue updates to one or more shared Slack channels to keep your team informed about queue activity. Each channel can have its own set of enabled notification topics. -### Enable Merge Queue Notifications +### Connecting Slack Channels -After you have Merge set up and running in your repository, you can set up your integration with Slack under **Merge Queue** tab **>** repository **> Settings >** **Connect with Slack**. + +**Prerequisite:** The Trunk Slack app must be [installed for your organization](#installing-the-trunk-slack-app) before you can connect channels. + -
+1. Navigate to **Settings > Repositories > [your repository] > Merge Queue**. +2. Under **Slack Notifications**, click **Add Channel**. +3. In the **Add Slack Channel** modal, select a channel from the dropdown. +4. Toggle the notification topics you want enabled for that channel. +5. Click **Connect**. -1. Navigate to `Settings > Repositories > [your repository] > Merge Queue` -2. Find the **Connect with Slack** setting and click **Connect** to install the Trunk Slack application -3. Authorize the app to post to your desired channel -4. You'll be redirected back to your settings page once authorization is complete +You can connect **multiple channels**, each with a different set of enabled topics. For example, you might send all notifications to a `#merge-notifications` channel while only sending failure alerts to a `#merge-queue-failures` channel. -### Configuring Channel Notification Preferences +The channel list displays each connected channel along with a summary of how many notification topics are enabled (e.g., "6/9 enabled"). To remove an individual channel, click the trash icon next to it. To remove all channel connections for the repository, click **Disconnect**. -After connecting to a Slack channel, you can customize which notifications you want to receive. By default, all Merge Queue notifications are enabled. +### Managing Channel Notification Preferences -
+Each connected channel has its own independent set of notification topics. You can expand any channel in the list to view and toggle its topics on or off. Changes take effect immediately. -You can toggle individual notification types on or off. See Available Notification Topics below for descriptions of each notification type. +See [Available Notification Topics](#available-notification-topics) below for descriptions of each notification type. **Tip:** Want to receive these notifications as personal DMs instead of in a shared channel? Check out our [Personal Slack Notifications](#personal-slack-notifications) setup guide. @@ -37,72 +59,60 @@ You can toggle individual notification types on or off. See Available Notificati ## Personal Slack Notifications -Get direct messages in Slack about your PRs in the merge queue, keeping you informed without adding noise to team channels. - -Personal Slack notifications allow you to receive personalized Slack DMs when your PRs are queued, start testing, pass tests, get merged, or encounter issues. This keeps you up-to-date on the progress of your code through the merge queue without needing to check the web UI or monitor shared channels. +Get direct messages in Slack about your PRs as they move through the merge queue — queued, testing, merged, failed, and more — without adding noise to team channels. ### Setting up Personal Notifications -To receive personal Slack notifications, you'll need to connect both your GitHub and Slack accounts to Trunk and configure your notification preferences. - -**Note:** If your organization isn't already using merge queue Slack notifications to a shared channel, a Slack workspace admin may need to approve the Trunk Slack app before you can connect your personal account. See [Enable Merge Queue Notifications](#enable-merge-queue-notifications) for details on setting up the initial Slack integration. +**Prerequisite:** The Trunk Slack app must be [installed for your organization](#installing-the-trunk-slack-app) before personal notifications can be configured. If the app hasn't been installed yet, the Home tab will display a warning directing a Slack admin to complete the installation. -#### **Steps to Enable Personal Notifications** +Personal notification setup is done from the **Trunk Slack app's Home tab** in Slack: + +1. Open the **Trunk** app in Slack. If you don't see it in your sidebar, add it via **Apps > Manage > Browse Apps** and search for "Trunk." +2. Go to the **Home** tab. +3. Click **Link Account** to connect your Trunk account to Slack. +4. Connect your **GitHub account** from the Home tab. This is required for PR tracking and most notifications. +5. Configure your notification preferences using the toggles on the Home tab. -1. **Navigate to User Settings** - * Go to **User Settings > Notifications** in the Trunk web app - * These settings are specific to you, so you can customize them however you prefer -2. **Connect GitHub Account** - * Click **Connect GitHub** to begin the OAuth flow - * This verifies that you own your GitHub account and allows Trunk to link your PRs to your user profile -3. **Connect Slack Account** +### Using the Trunk Web UI - * Click **Connect to Slack** to authorize the Trunk Slack app to send you direct messages +You can also start setup from the Trunk web app, which will redirect you to Slack to complete the process: - > **Important:** If your organization hasn't already installed the Trunk Slack app for channel notifications, a Slack workspace admin may need to approve the app before you can receive personal notifications. -4. **Configure Notification Preferences** - * Enable the specific notifications you want to receive via Slack DM - * See Available Personal Notification Topics below for descriptions of each notification type -5. **Manage Connections** - * You can disconnect your GitHub or Slack accounts at any time by clicking the respective **Disconnect** buttons in User Settings +1. Navigate to **Settings > Account > Notifications** in Trunk. +2. Under **Connect your Slack workspace**, verify your workspace is connected. If not, click **Go to Slack settings** to install the app first. +3. Click **Open in Slack** to jump to the Trunk app's Home tab, where you'll link your account and configure notifications. -**Tip:** Want to receive these same notifications in a shared Slack channel instead? Check out our team [Channel Slack Notifications](#channel-notifications) setup guide. +**Tip:** Want to send notifications to a shared team channel instead? Check out the [Channel Notifications](#channel-notifications) setup guide. -
- ## Slack App Home Dashboard -The Trunk Slack app's **Home** tab provides a personal merge queue dashboard directly in Slack. Open the Trunk app in Slack and click the **Home** tab to see an overview of your merge queue activity. +The Trunk Slack app's **Home** tab provides a personal merge queue dashboard directly in Slack. Open the Trunk app in Slack and click the **Home** tab to see an overview of your merge queue activity across all repositories. -### What you'll see +### What You'll See The Home tab displays the following sections: -* **Account connection status** — Shows whether your Trunk and GitHub accounts are linked. If GitHub is not connected, a warning explains that most notifications require it, with a button to start the GitHub OAuth flow. -* **Not Ready PRs** — PRs you've submitted to the queue that are waiting for prerequisites (e.g., passing required checks, no merge conflicts) before entering active testing. Grouped by queue. -* **PRs in Queue** — Your PRs that are currently pending, testing, or have passed tests, with status indicators. Grouped by queue. -* **Recently Merged PRs** — Up to 5 of your most recently merged PRs with merge dates. Grouped by queue. -* **Failed PRs** — Your PRs that failed in the queue. Grouped by queue. -* **Notification Preferences** — Toggle buttons for each notification topic. You can enable or disable individual notifications directly from Slack without visiting the web UI. +* **Refresh** — A button at the top of the Home tab to update the view with the latest queue data, along with a "Last refreshed" timestamp. +* **Account connection status** — Shows your connected identity (e.g., "Connected as **Your Name**"), an **Unlink Account** button, and your GitHub account connection status. You can connect your GitHub account directly from the Home tab if it isn't linked yet. +* **Not Ready** — PRs you've submitted that are waiting for prerequisites (e.g., GitHub mergeability) before entering the queue. +* **PRs in Queue** — Your PRs that are currently in the queue, with real-time status indicators (e.g., "Testing"). +* **Recently Merged PRs** — Your most recently merged PRs, with merge dates. +* **Failed PRs** — Your PRs that failed in the queue. +* **Notification Preferences** — Toggle buttons for all notification topics. You can enable or disable individual notifications directly from Slack without visiting the web UI. -Each PR entry shows the PR title, number, a link to the Trunk dashboard, and a link to the GitHub PR. All data is scoped to your PRs via your linked GitHub account. +All PR sections are grouped by repository and branch. Each PR entry shows the title, PR number, and a link to the GitHub PR. Data is shown across **all merge queues** you submit to, scoped to your PRs via your linked GitHub account. -### Linking your account +### Linking Your Account -1. Open the Trunk app in Slack and go to the **Home** tab -2. Click **Link Account** to connect your Trunk account -3. Click **Connect GitHub** to link your GitHub account (required for PR tracking and most notifications) +To use the Home tab, you need to link your Trunk and GitHub accounts. Follow the steps in [Setting up Personal Notifications](#setting-up-personal-notifications) — the same account linking process powers both the dashboard and personal DMs. -### Managing notification preferences +### Managing Notification Preferences You can toggle notification topics on or off directly from the Home tab — no need to visit the Trunk web UI. Changes take effect immediately. The available topics are the same as those listed in [Available Notification Topics](#available-notification-topics). -Use the **Refresh** button at the top of the Home tab to update the view with the latest queue data. - ## Frequently Asked Questions
@@ -117,11 +127,11 @@ Yes, both connections are required. The GitHub connection links your PRs to your What's the difference between personal notifications and channel notifications? -[Personal notifications](#personal-slack-notifications) are sent directly to you via Slack DM and only include updates about your own PRs. +[Personal notifications](#personal-slack-notifications) are sent directly to you via Slack DM and only include updates about your own PRs. They are set up from the Trunk Slack app's Home tab. -[Channel notifications](#channel-notifications) are sent to a shared team channel and include updates about all PRs in the merge queue. +[Channel notifications](#channel-notifications) are sent to one or more shared team channels and include updates about all PRs in the merge queue. You can connect multiple channels per repository, each with different notification topics. -You can use both simultaneously to stay informed personally while keeping your team updated. Learn more about setting up channel notifications. +You can use both simultaneously to stay informed personally while keeping your team updated.
@@ -129,15 +139,23 @@ You can use both simultaneously to stay informed personally while keeping your t Can I customize which notifications I receive? -Yes, in **Settings** > **Account** > **Notifications**, you can toggle individual notification topics on or off based on your preferences. For example, you might only want to be notified when your PR fails or gets merged, rather than at every stage. +Yes. For personal notifications, toggle topics on or off from the Trunk Slack app's **Home** tab. For channel notifications, configure topics per channel under **Settings > Repositories > [your repository] > Merge Queue** in the Trunk web app. + + + +
+ +What happens if I disconnect my Slack account from my Trunk account? + +You can unlink your account from the Trunk Slack app's Home tab using the **Unlink Account** button. Disconnecting stops personal Slack notifications. You can reconnect at any time by returning to the Home tab and clicking **Link Account**.
-What happens if I disconnect my GitHub or Slack account? +I don't see the Trunk app in my Slack sidebar. How do I add it? -Disconnecting either account will stop personal Slack notifications. You can reconnect at any time through **Settings** > **Account** > **Notifications**. +The Trunk app must first be [installed at the organization level](#installing-the-trunk-slack-app) by a Slack workspace admin. After that, individual users can add it to their sidebar: in Slack, go to **Apps > Manage > Browse Apps**, search for "Trunk," and click **Add**.
diff --git a/merge-queue/migrating-from-github-merge-queue.mdx b/merge-queue/migrating-from-github-merge-queue.mdx index 0c717ef..b35dcc0 100644 --- a/merge-queue/migrating-from-github-merge-queue.mdx +++ b/merge-queue/migrating-from-github-merge-queue.mdx @@ -38,6 +38,17 @@ While evaluating and testing Trunk Merge Queue for your team, we suggest disabli This setting is found under **Merge Queue** tab **>** repository **> Settings >** toggle **off GitHub Comments.** +#### Running both merge queues simultaneously + +Trunk Merge Queue can run alongside GitHub Merge Queue during your evaluation period without disrupting your existing workflow. When Trunk detects that a PR was merged externally (by GitHub Merge Queue or any other tool), it gracefully removes the PR from its queue without posting failure comments. + +This allows you to: +- Test Trunk Merge Queue on select PRs while keeping GitHub Merge Queue active +- Gradually migrate teams without forcing an immediate cutover +- Evaluate Trunk's features in production without risk + +To enable this workflow, keep GitHub Comments disabled in Trunk (as described above) and submit only test PRs to Trunk using `/trunk merge`. PRs merged by GitHub Merge Queue will be automatically cleaned up from Trunk's queue. + #### Make the switch Once you have [configured settings](/merge-queue/administration/advanced-settings) and tested out the workflow quietly, turn off other merge tools (like [GitHub merge queue](#turn-off-github-merge-queue)), re-enable GitHub comments in the Trunk web app under the **Merge Queue** tab **>** repository **> Settings >** toggle **on GitHub Comments**