Skip to content

feat(llc): GitHub PR ↔ work-item linking for LLC adapters (#9625) - #10061

Merged
mrveiss merged 5 commits into
Dev_new_guifrom
issue-9625
Jun 13, 2026
Merged

mrveiss merged 5 commits into
Dev_new_guifrom
issue-9625

Conversation

@mrveiss

@mrveiss mrveiss commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Thinking Path

Issue #9625 (umbrella #9923, M-sized) asked for PR ↔ work-item linking. Found prior unmerged work on local branch issue-MVA-3716-pr-linking (3981f2d80 + security-hardened 895736640, 1540 commits behind base, no PR). Ported the hardened version onto current base and fixed its two gaps: the linked_pr_urls model field and the router registration were both missing (the old commit referenced a column it never added and a router it never mounted). Renumbered the migration (old 051 slot is taken) to 20260612_056 revising head 20260612_055.

What Changed

  • Model/migration: linked_pr_urls JSONB on llc_work_items (Python-side default=list + PG server_default '[]'::jsonb), migration 20260612_056_llc_pr_linking
  • Webhook: POST /api/llc/webhooks/github — fail-closed (503 without GITHUB_WEBHOOK_SECRET, 401 on bad HMAC-SHA256), resolves work item from branch (llc/{id}, autobot-llc/{id}, llc-{id}) or PR body (Closes #llc-{id}), strict PR-URL validation matched against the webhook repo; merge → in_review + comment, close-without-merge → comment
  • Agent endpoint: POST /api/llc/work-items/{id}/link-pr (IDOR-guarded, same strict URL validation, idempotent append + system comment)
  • Wiring: router registered in llc/api/__init__.py; linked_pr_urls exposed in _item_to_dict
  • Frontend: 🔗 badge on Kanban cards when PRs are linked
  • Docs: docs/llc/github-pr-integration.md (branch convention, webhook setup) + linked from docs/llc/_index.md; live autobot-llc skill updated out-of-repo
  • Tests: llc/tests/test_github_webhooks.py (36 tests: extraction, URL validation, signature, endpoint security gates, link/transition flows)

Verification

  • pytest llc/tests/test_github_webhooks.py llc/tests/test_work_items_idor.py llc/tests/test_work_item.py llc/tests/test_backlog_reorder.py → 99 passed
  • Full llc/tests delta vs base: zero new failures outside the known bug(llc/tests): full-suite module pollution replaces sys.modules['llc.api'] — kills all llc.api.* route tests and masks regressions #9995 full-suite module-pollution class (my file passes standalone, same as all other llc.api.* route tests)
  • API wiring audit AUTHORITATIVE: 0 unwired, 0 unmounted; both new paths present in dumped OpenAPI
  • flake8 clean on all added/changed lines (23 pre-existing E501 in work_items.py identical on base)
  • Single alembic head (20260612_056); import llc.api smoke OK

Model Used

Claude Fable 5

Closes #9625 (part of #9923)

mrveiss added 2 commits June 12, 2026 14:15
- Add linked_pr_urls JSONB field to LLCWorkItem (+ migration 20260612_056)
- Add POST /api/llc/work-items/{id}/link-pr endpoint (IDOR-guarded, strict URL validation)
- Add POST /api/llc/webhooks/github handler — fail-closed HMAC-SHA256 signature
  verification, branch/PR-body work-item resolution, repo-matched URL validation
- Auto-transition work item to in_review on PR merge; comment on close-without-merge
- Show 🔗 PR badge on Kanban work item cards
- Document branch naming convention (llc/{work_item_id}) in docs/llc/github-pr-integration.md
- Port + harden prior unmerged work from issue-MVA-3716-pr-linking (3981f2d80, 895736640),
  fixing its gaps: model field and router registration were missing
@github-actions

github-actions Bot commented Jun 13, 2026 •

Copy link
Copy Markdown
Contributor

✅ SSOT Configuration Compliance: Passing

🎉 No hardcoded values detected that have SSOT config equivalents!

mrveiss and others added 3 commits June 13, 2026 17:11
Applied Black, isort, and autoflake to match code-quality checks.
Triggered by workflow auto-fix-formatting.yml.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@mrveiss
mrveiss merged commit fd774e2 into Dev_new_gui Jun 13, 2026
24 of 25 checks passed
@mrveiss
mrveiss deleted the issue-9625 branch June 13, 2026 14:57
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