feature: link specs to Forgejo issues (model, manual link, create-issue button) #26

Merged
Gilles merged 1 commit from feat/spec-issue-links into master 2026-10-31 19:40:22 +00:00
Owner

Closes #25.

First slice of the Forgejo issue <-> spec link feature: a SpecVersionIssueLink model keyed on Spec (not a single SpecVersion, so the link survives every new draft/validated version), Project.default_repo as the default target repo, manual CRUD for links (/api/issue-links/, with a one-shot Forgejo fetch at creation to seed cached_state/title), and a "create issue from spec" action (/api/specs/<id>/create-issue/) that opens the issue via the Forgejo API and links it immediately.

SpecVersion.is_implemented is now derived from linked issues (every one closed) once a spec has >=1 link, falling back to the existing manual boolean otherwise (non-software specs have no link) -- set_implemented() refuses a manual write once a link exists.

Webhook-driven sync, polling fallback, body-detection of a spec code typed in an issue, and the PDF-extract comment are later slices, not in this PR.

Test plan

  • manage.py test apps.specs apps.orgs -- 127/127 passing (16 new)
  • pylint apps config -- 10.00/10
  • autopep8 --diff clean
  • bandit -r apps config -- 0 issues
  • Migrations apply cleanly on a fresh database

🤖 Generated with Claude Code

https://claude.ai/code/session_014HiJrn6J6vhyFfC2qyY4uh

Closes #25. First slice of the Forgejo issue <-> spec link feature: a `SpecVersionIssueLink` model keyed on `Spec` (not a single `SpecVersion`, so the link survives every new draft/validated version), `Project.default_repo` as the default target repo, manual CRUD for links (`/api/issue-links/`, with a one-shot Forgejo fetch at creation to seed `cached_state`/title), and a "create issue from spec" action (`/api/specs/<id>/create-issue/`) that opens the issue via the Forgejo API and links it immediately. `SpecVersion.is_implemented` is now derived from linked issues (every one closed) once a spec has >=1 link, falling back to the existing manual boolean otherwise (non-software specs have no link) -- `set_implemented()` refuses a manual write once a link exists. Webhook-driven sync, polling fallback, body-detection of a spec code typed in an issue, and the PDF-extract comment are later slices, not in this PR. ## Test plan - [x] `manage.py test apps.specs apps.orgs` -- 127/127 passing (16 new) - [x] `pylint apps config` -- 10.00/10 - [x] `autopep8 --diff` clean - [x] `bandit -r apps config` -- 0 issues - [x] Migrations apply cleanly on a fresh database --- 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014HiJrn6J6vhyFfC2qyY4uh
feature: link specs to Forgejo issues (model, manual link, create-issue button)
All checks were successful
ci / test (pull_request) Successful in 3m27s
ci / e2e (pull_request) Has been skipped
ci / docker (pull_request) Has been skipped
ci / deploy (pull_request) Has been skipped
cd8a24b7bb
Closes #25.

First slice of the Forgejo issue <-> spec link feature: a
SpecVersionIssueLink model keyed on Spec (not a single SpecVersion, so
the link survives every new draft/validated version), Project.default_repo
as the default target repo, manual CRUD for links (/api/issue-links/,
with a one-shot Forgejo fetch at creation to seed cached_state/title),
and a "create issue from spec" action (/api/specs/<id>/create-issue/)
that opens the issue via the Forgejo API and links it immediately.

SpecVersion.is_implemented is now derived from linked issues (every
one closed) once a spec has >=1 link, falling back to the existing
manual boolean otherwise (non-software specs have no link) --
set_implemented() refuses a manual write once a link exists.

Webhook-driven sync, polling fallback, body-detection of a spec code
typed in an issue, and the PDF-extract comment are later slices, not
in this PR.

## Test plan
- [x] `manage.py test apps.specs apps.orgs` -- 127/127 passing (16 new)
- [x] `pylint apps config` -- 10.00/10
- [x] `autopep8 --diff` clean
- [x] `bandit -r apps config` -- 0 issues
- [x] Migrations apply cleanly on a fresh database

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014HiJrn6J6vhyFfC2qyY4uh
Author
Owner
<!-- argus-link-bot:thierryade/backend --> 📊 [Rapports Argus pour cette PR](https://reports.stationmyr.net/thierryade/backend/pr/26)
Gilles merged commit b9e5940848 into master 2026-10-31 19:40:22 +00:00
Gilles deleted branch feat/spec-issue-links 2026-10-31 19:40:22 +00:00
Sign in to join this conversation.
No description provided.