Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

ci(preview): label preview links so Linear surfaces them on issues (#16759)

Max Deichmannb36ddc4f8053
diff --git a/.agents/skills/langfuse-previews/SKILL.md b/.agents/skills/langfuse-previews/SKILL.md
index d505cfeef7..0adb22bd23 100644
--- a/.agents/skills/langfuse-previews/SKILL.md
+++ b/.agents/skills/langfuse-previews/SKILL.md
@@ -45,6 +45,13 @@ Pushing updates it; closing the PR tears it down.
shared seed identity is `[email protected]` / `password`, with API keys
`pk-lf-1234567890` / `sk-lf-1234567890` — shared and synthetic, so never
treat a preview as private.
+- **Open it from Linear** — on any Linear issue linked to the PR, the preview
+ sits behind the issue's **Preview** shortcut. Linear builds that shortcut by
+ parsing the PR description and bot comments for markdown links whose label
+ ends in "preview", so both preview surfaces label their link that way
+ (`pr-<N> app preview`, `pr-<N> storybook preview`) — keep that suffix when
+ editing either comment, or the shortcut disappears. A bare URL is not
+ matched.
- **Know where you are** — every preview page shows a top strip linking back
to the PR, with the author and when the preview content last changed.
- **Update** — push to the PR; it rebuilds and rolls to the new image (~5 min,
diff --git a/.github/workflows/preview-build.yml b/.github/workflows/preview-build.yml
index 18832be205..589060d57f 100644
--- a/.github/workflows/preview-build.yml
+++ b/.github/workflows/preview-build.yml
@@ -297,6 +297,13 @@ jobs:
ref: ${{ github.event.pull_request.base.sha }}
sparse-checkout: .github/actions
+ # The URL is a markdown link whose label ends in "preview" so Linear's
+ # GitHub integration picks it up as a custom preview link and offers it
+ # on every linked Linear issue. Linear parses PR descriptions and
+ # comments (author or bot) for markdown links labelled "... preview";
+ # a bare URL or a label ending in the hostname is not matched. The
+ # pinned description block below uses the same label and URL, so Linear
+ # shows one entry rather than two.
- name: Mark preview image pushed
if: needs.build.result == 'success'
uses: ./.github/actions/preview-comment
@@ -308,7 +315,7 @@ jobs:
Argo CD is rolling it out — the environment is usually ready within a
few minutes of this comment.
- **URL:** https://${{ needs.meta.outputs.preview_host }} (signs you in automatically; opt out with `/auth/sign-in?autoSignIn=false`)
+ **URL:** [pr-${{ github.event.pull_request.number }} app preview](https://${{ needs.meta.outputs.preview_host }}) (signs you in automatically; opt out with `/auth/sign-in?autoSignIn=false`)
**Login:** `${{ needs.meta.outputs.login_email }}` / `${{ needs.meta.outputs.login_password }}`
**API keys:** `${{ needs.meta.outputs.public_key }}` / `${{ needs.meta.outputs.secret_key }}`
**Commit:** ${{ needs.meta.outputs.commit_sha }}
@@ -442,10 +449,13 @@ jobs:
const host = process.env.PREVIEW_HOST;
// Exactly one bold line, by request — the markdown link is needed
- // because a schemeless hostname does not auto-link.
+ // because a schemeless hostname does not auto-link. Its label ends
+ // in "preview" so Linear's GitHub integration picks the line up as
+ // a custom preview link on every linked Linear issue; the label and
+ // URL match the status comment's, so Linear shows one entry.
const block = [
START,
- `🟡 **Live preview: [${host}](https://${host})**`,
+ `🟡 **Live preview: [pr-${pull_number} app preview](https://${host})**`,
END,
"",
"",
diff --git a/.github/workflows/storybook-preview.yml b/.github/workflows/storybook-preview.yml
index 8d95a7fd2b..1bd583b3db 100644
--- a/.github/workflows/storybook-preview.yml
+++ b/.github/workflows/storybook-preview.yml
@@ -124,9 +124,14 @@ jobs:
with:
script: |
const marker = "<!-- storybook-preview -->";
- const body = `${marker}\nStorybook preview: ${process.env.PREVIEW_URL}\n\nUpdated at: ${new Date().toISOString()}\nCommit: ${process.env.COMMIT_SHA}`;
const { owner, repo } = context.repo;
const issue_number = Number(process.env.PR_NUMBER);
+ // The link label ends in "preview" so Linear's GitHub integration
+ // picks it up as a custom preview link on every linked Linear
+ // issue; a bare URL is not matched. The AWS app preview comment
+ // uses the same shape, so a linked issue offers both.
+ const link = `[pr-${issue_number} storybook preview](${process.env.PREVIEW_URL})`;
+ const body = `${marker}\nStorybook preview: ${link}\n\nUpdated at: ${new Date().toISOString()}\nCommit: ${process.env.COMMIT_SHA}`;
const comments = await github.paginate(github.rest.issues.listComments, {
owner,