Skip to content

feat: add Jira and GitHub integrations#107

Merged
alexneamtu merged 12 commits intomainfrom
feat/integrations
Mar 3, 2026
Merged

feat: add Jira and GitHub integrations#107
alexneamtu merged 12 commits intomainfrom
feat/integrations

Conversation

@alexneamtu
Copy link
Contributor

@alexneamtu alexneamtu commented Mar 3, 2026

Summary

  • Add per-user Jira and GitHub integration configuration in Settings (API tokens encrypted at rest with AES-256-GCM)
  • Add "Create Issue" button on VideoDetail page that creates issues pre-populated with video title, watch URL, and transcript excerpt
  • New internal/integration/ package with IssueCreator interface, GitHub and Jira provider clients, CRUD handler, and encryption utilities
  • 5 new API endpoints documented in OpenAPI spec

Changes

  • Migration 000050: user_integrations table (UUID PK, user_id FK, provider CHECK, JSONB config, UNIQUE per user+provider)
  • Backend: internal/integration/ — integration.go (types, encryption), handler.go (CRUD + create-issue), github.go, jira.go
  • Server: Routes wired under /api/settings/integrations and /api/videos/{id}/create-issue
  • Frontend: Settings page Integrations card with expandable GitHub/Jira forms; VideoDetail "Create Issue" dropdown button
  • Docs: OpenAPI spec updated with Integrations tag and 5 endpoints

Test plan

  • 15 new Go integration tests (encryption round-trip, GitHub/Jira client mock servers, handler CRUD with pgxmock)
  • 677 frontend tests pass (55 Settings tests including new integrations card test)
  • TypeScript typecheck clean
  • Configure a GitHub integration in Settings → verify "Test Connection" succeeds
  • Create an issue from VideoDetail → verify issue appears in GitHub with video link and transcript
  • Configure a Jira integration → verify issue creation with ADF body format
  • Verify tokens are masked in GET /api/settings/integrations response

Create user_integrations table to store per-user integration
configs (Jira, GitHub) with encrypted JSONB config column.
IssueCreator interface, request/response types, DeriveKey,
Encrypt, Decrypt, MaskToken — 4 passing tests.
GitHubClient: Bearer auth, POST /repos/{owner}/{repo}/issues,
markdown body with collapsible transcript. JiraClient: Basic
auth, POST /rest/api/3/issue, ADF body format. Both implement
IssueCreator interface — 10 passing tests total.
List, Save, Delete, Test, CreateIssue handlers with encrypted
token storage, config validation, and provider factory — 15 tests.
Register integration CRUD under /api/settings/integrations and
create-issue under /api/videos/{id}/create-issue.
Settings: expandable GitHub/Jira config forms with save, test
connection, and disconnect. VideoDetail: Create Issue button
with dropdown for configured providers. 677 frontend tests pass.
5 new endpoints: list/save/delete integrations, test connection,
create issue from video. Schemas for GitHub/Jira configs.
@github-actions
Copy link

github-actions bot commented Mar 3, 2026

Preview deployed: https://pr-107.app.sendrec.eu

Check error returns for resp.Body.Close, io.Copy, and json
Encode/Decode. Lowercase error string per staticcheck ST1005.
Apply the same organization_id filter used by other video
endpoints — personal videos require organization_id IS NULL,
org videos require matching organization_id.
The videos table has transcript_json (JSONB) not transcript (TEXT).
The non-existent column caused SQL errors returning 404.
- Frontend: populate form fields from saved integration config on load
- Backend: detect masked token values and preserve existing encrypted
  tokens when re-saving without changing the token
@alexneamtu alexneamtu merged commit 7da2cc4 into main Mar 3, 2026
4 checks passed
@alexneamtu alexneamtu deleted the feat/integrations branch March 3, 2026 11:22
@github-actions
Copy link

github-actions bot commented Mar 3, 2026

Preview environment cleaned up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant