Integrations: GitHub Issues thread-action target (create a linked GitHub issue from a thread) - #50
Conversation
New publishable package `@airnauts/airside-extension-github` mirroring the
Jira extension: one `thread-action` (`id:'github.createIssue'`,
`provider:'github'`, slot `thread-toolbar`) whose `run` creates a GitHub issue
via `POST /repos/{owner}/{repo}/issues` (native fetch, `Bearer` auth, no
Octokit) and returns an `externalLink` the server persists. `visibleWhen` hides
the action once a github link exists. Issue body is Markdown (local
`buildMarkdownDescription`/`buildIssueTitle`), no server/core change. Wired
env-gated into the Next.js host, added to the changeset `fixed` group with a
minor changeset, and recorded in ADR-0044 (token auth + fetch-not-octokit).
Closes #48.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015YC2L9GsNmvyjm6VrUJvX1
Review — verified findingsSolid, faithful mirror of the jira extension. Two things to fix at merge, plus notes. 1. ADR number collision: this PR's ADR-0044 already exists on main. Main's 2. No length cap on the issue body. Non-issues verified for the record:
Forward-looking: ~80–100 lines (fetch wrapper, Changeset present for the new package. ✅ |
Renumber this PR's ADR to ADR-0049 (0044-0047 taken on main, 0048 claimed by PR #70) and update in-repo references. Cap GitHub issue body under the 65,536-char limit with a truncation marker so very large threads still create an issue instead of failing with a 422. Airside-Agent-Fix: true Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
🤖 airside-agent: addressed "Review — verified findings" in 15b7fb4 — renumbered the colliding ADR-0044 → ADR-0049 (+refs) and capped the issue body under GitHub's 65,536 limit with a truncation marker (+tests); left the benign version-note/encoding/shared-seam items as-is per your notes. |
|
fix merge conflixts |
Resolve docs/adr.md conflict: keep main's ADR-0044..0047 and place this PR's GitHub-extension ADR-0049 last. Align new @airnauts/airside-extension-github to the 0.10.1 fixed-group version. Airside-Agent-Fix: true Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
🤖 airside-agent: addressed "fix merge conflicts" in 8406fe7 — merged origin/main and resolved the only conflict ( |
Summary
Adds a second thread-action target — GitHub Issues — as a new publishable package
@airnauts/airside-extension-github, structurally mirroring@airnauts/airside-extension-jira. Clicking "Create GitHub issue" on a thread opens a linked GitHub issue and pins theexternalLinkback onto the thread (rendered by existing client code). No server or core change — it reuses theServerExtension/ThreadActionExtensionseam andupsertExternalLinkpersistence (ADR-0034 anticipated this).Closes #48.
How it maps to the approved spec
packages/integration-github/→@airnauts/airside-extension-github, public factorygithubExtension(opts). Onethread-action(id:'github.createIssue',provider:'github', slotthread-toolbar,presentation:{style:'primary'}),visibleWhenhides it once agithublink exists,runreturns{ externalLink }.src/client.ts—GitHubConfig/createGitHubClient→POST {baseUrl}/repos/{owner}/{repo}/issuesvia nativefetch(no@octokit/*). Headers:authorization: Bearer <token>,accept: application/vnd.github+json,x-github-api-version: 2022-11-28,content-type: application/json. 5sAbortSignal.timeout. Non-2xx and network/abort →IntegrationError('github'); the token never appears in any error message. MapsexternalId=String(issue.id),key="#"+number,url=html_url.src/markdown.ts— localbuildIssueTitle+buildMarkdownDescription(Markdown analog of Jira's ADF; kept local per spec, not a shared package — that's Integrations: Linear thread-action target (create a linked Linear issue from a thread) #47's work).src/create-issue.ts/src/index.ts—runhandler + factory; validatestoken/owner/repoat construction.externalLink = { provider:'github', externalId, key, label:"GitHub "+key, url, createdAt }.publishConfig.access:public,type:module, exports→dist,workspace:^deps, initialversion:0.9.1, tsup/tsconfig/README/LICENSE)..changeset/config.json— added to thefixedgroup; one minor changeset (0.9.1 → 0.10.0in lockstep).examples/nextjs-host/.../route.ts(AIRSIDE_GITHUB_TOKEN/_OWNER/_REPO) + dep added to the host'spackage.json.ADR
Added ADR-0044 (token auth: fine-grained PAT via
Bearer, GitHub App deferred with no config-surface change; andfetch, not Octokit). The spec flagged that issue #17's real-time spec may also claim 0044 — please renumber on merge if it collides.Verification
client.test.ts,markdown.test.ts,index.test.tsauthored before implementation.pnpm --filter @airnauts/airside-extension-github test→ 10 passing.pnpm buildgreen (incl. host route typecheck against the new package).pnpm lint(biomeci) exit 0 — no new warnings in the package.🤖 Draft opened by airside-agent — automated build of #48.