Link specs to Forgejo issues (data model, manual link, create-issue button) #25

Closed
opened 2026-10-31 19:00:49 +00:00 by Gilles · 0 comments
Owner

First slice of the Forgejo issue <-> spec link feature (see plan discussed in chat).

Scope (PR 1 of 3 -- webhook sync and PDF extract come later):

  • SpecVersionIssueLink model: spec (FK to Spec, not a specific SpecVersion), repo_full_name, issue_number, cached_state (open/closed), cached_title, last_synced_at, last_synced_via (manual/webhook/poll), sync_error, created_via (manual/issue_button/detected_in_body).
  • Project.default_repo field (owner/repo), optional, used as the default target for the create-issue button.
  • SpecVersion.implemented becomes derived: when >=1 link exists on the spec, implemented = all linked issues closed; otherwise falls back to the existing manual boolean (non-software specs have no link).
  • API: CRUD for links on a spec (create manual link by repo+issue number, delete), read-only cached_state/cached_title (no live sync yet -- that's PR 2).
  • API action "create issue from spec": calls the Forgejo API to open an issue in repo_full_name (project's default_repo or an explicit override) with title [code] title and body = current spec content + a link back to the spec in Thierryade, then creates the link with created_via=issue_button and cached_state=open.

Labels, webhook registration, status sync and PDF extract are out of scope here (PR 2 and PR 3).

First slice of the Forgejo issue <-> spec link feature (see plan discussed in chat). Scope (PR 1 of 3 -- webhook sync and PDF extract come later): - `SpecVersionIssueLink` model: `spec` (FK to `Spec`, not a specific `SpecVersion`), `repo_full_name`, `issue_number`, `cached_state` (open/closed), `cached_title`, `last_synced_at`, `last_synced_via` (manual/webhook/poll), `sync_error`, `created_via` (manual/issue_button/detected_in_body). - `Project.default_repo` field (`owner/repo`), optional, used as the default target for the create-issue button. - `SpecVersion.implemented` becomes derived: when >=1 link exists on the spec, `implemented` = all linked issues `closed`; otherwise falls back to the existing manual boolean (non-software specs have no link). - API: CRUD for links on a spec (create manual link by repo+issue number, delete), read-only `cached_state`/`cached_title` (no live sync yet -- that's PR 2). - API action "create issue from spec": calls the Forgejo API to open an issue in `repo_full_name` (project's `default_repo` or an explicit override) with title `[code] title` and body = current spec content + a link back to the spec in Thierryade, then creates the link with `created_via=issue_button` and `cached_state=open`. Labels, webhook registration, status sync and PDF extract are out of scope here (PR 2 and PR 3).
Sign in to join this conversation.
No description provided.