FedWiki and Discourse are built into the console instead of connecting through the published contract #174

Open
opened 2026-10-06 18:12:03 +00:00 by cgalo5758 · 3 comments
Owner

What a person cannot do today

Connect FedWiki or Discourse the way any other application would. FedWiki needs code on both sides, the farm plugin and internal/integrations/fedwiki, which have to agree; Discourse's code lives in the console; and each keeps its own schema in the console's database. A newcomer has no worked example of the contract and no way to test a connector of their own.

What they should be able to do

  • Test a connector with a conformance harness, start one from a quickstart, and use helpers for the parts every connector repeats.
  • Run Discourse through the contract first, as a bridge the project maintains, then FedWiki through its farm plugin. Each moves by shadow migration, with one writer at a time.
  • Read an example application that acquires usage, as a model for the classes the two first-party connectors do not use.
  • Have any application claim, place and release a domain through a names capability, with the domains registry staying in core (#44, and a path for #87).

Why it matters

The contract is only credible if the project's own applications use it. Moving both before launch means a deployment sees connectors it can copy, and the fedwiki and discourse schemas leave the console's database; stripe stays, because payments are not part of the contract (#80).

Where

internal/integrations/fedwiki, internal/integrations/discourse, the farm plugin, the specification repository from #171, a harness and an example application.

Done when

FedWiki and Discourse both run through the contract with no code under internal/integrations; the conformance harness passes for both and for the example application; the fedwiki and discourse schemas are retired; #46 is resolved with them.

Order

Comes after #173; the last of the four, after #171 and #172.

## What a person cannot do today Connect FedWiki or Discourse the way any other application would. FedWiki needs code on both sides, the farm plugin and `internal/integrations/fedwiki`, which have to agree; Discourse's code lives in the console; and each keeps its own schema in the console's database. A newcomer has no worked example of the contract and no way to test a connector of their own. ## What they should be able to do - Test a connector with a conformance harness, start one from a quickstart, and use helpers for the parts every connector repeats. - Run Discourse through the contract first, as a bridge the project maintains, then FedWiki through its farm plugin. Each moves by shadow migration, with one writer at a time. - Read an example application that acquires usage, as a model for the classes the two first-party connectors do not use. - Have any application claim, place and release a domain through a names capability, with the domains registry staying in core (#44, and a path for #87). ## Why it matters The contract is only credible if the project's own applications use it. Moving both before launch means a deployment sees connectors it can copy, and the `fedwiki` and `discourse` schemas leave the console's database; `stripe` stays, because payments are not part of the contract (#80). ## Where `internal/integrations/fedwiki`, `internal/integrations/discourse`, the farm plugin, the specification repository from #171, a harness and an example application. ## Done when FedWiki and Discourse both run through the contract with no code under `internal/integrations`; the conformance harness passes for both and for the example application; the `fedwiki` and `discourse` schemas are retired; #46 is resolved with them. ## Order Comes after #173; the last of the four, after #171 and #172.
cgalo5758 added this to the Public launch milestone 2026-10-06 18:12:03 +00:00
cgalo5758 added the
kind
enhancement
area/fedwikiarea/discoursearea/integrations
labels 2026-10-06 18:12:03 +00:00
Author
Owner

The first candidate for the shared helpers is how FedWiki takes in a lifecycle request today, in internal/integrations/fedwiki/web/requests.go: parsing the instance address, building the request, starting its workflow and answering a repeated request. Only the mapping from a request's answer to what the page shows is free of FedWiki specifics; the rest has to be separated first. The conformance harness is where each operation a connector declares meets its implementation.

The first candidate for the shared helpers is how FedWiki takes in a lifecycle request today, in `internal/integrations/fedwiki/web/requests.go`: parsing the instance address, building the request, starting its workflow and answering a repeated request. Only the mapping from a request's answer to what the page shows is free of FedWiki specifics; the rest has to be separated first. The conformance harness is where each operation a connector declares meets its implementation.
Author
Owner

Two lessons for the shared helpers from how FedWiki answers a repeated request.

The JSON delete (DeleteSite in internal/integrations/fedwiki/web/api.go) answers a repeat from a second read of the request, taken after its recording commits and outside the instance lock, and it does not check whether that read found anything. When two identical deletes arrive together, the second is recorded as a repeat of the first. If the first request's workflow start is then refused, its unstarted row is deleted, the second request's read finds nothing, and it answers 200 with {"success":false,"status":""}. The JSON create reads again the same way and answers 409 when the row has gone. The recording's answer already carries the status, the reason and the workflow id, so a helper that answers repeats should answer from it, with no second read, and the protocol's answer should carry what a response needs.

finishAllWith (internal/integrations/fedwiki/workflows/request_activities.go) restates in Go the rule that FinishLifecycleRequest states in SQL: a finished request with the same status and reason is a repeat, and anything else is not found. A connector helper for finishing a request should state it once.

Two lessons for the shared helpers from how FedWiki answers a repeated request. The JSON delete (`DeleteSite` in `internal/integrations/fedwiki/web/api.go`) answers a repeat from a second read of the request, taken after its recording commits and outside the instance lock, and it does not check whether that read found anything. When two identical deletes arrive together, the second is recorded as a repeat of the first. If the first request's workflow start is then refused, its unstarted row is deleted, the second request's read finds nothing, and it answers 200 with `{"success":false,"status":""}`. The JSON create reads again the same way and answers 409 when the row has gone. The recording's answer already carries the status, the reason and the workflow id, so a helper that answers repeats should answer from it, with no second read, and the protocol's answer should carry what a response needs. `finishAllWith` (`internal/integrations/fedwiki/workflows/request_activities.go`) restates in Go the rule that `FinishLifecycleRequest` states in SQL: a finished request with the same status and reason is a repeat, and anything else is not found. A connector helper for finishing a request should state it once.
Author
Owner

One of the temporary lint exemptions this issue owns is gone: swapActiveSite (internal/integrations/fedwiki/web/site_actions.go) came down to the cognitive-complexity limit when its site checks moved into helpers, so its pinned rule in .golangci.yml was removed. The FedWiki create handler's rule (CreateSite, complexity 48) is the one left under this issue.

Commit: 9767f9ac

One of the temporary lint exemptions this issue owns is gone: `swapActiveSite` (`internal/integrations/fedwiki/web/site_actions.go`) came down to the cognitive-complexity limit when its site checks moved into helpers, so its pinned rule in `.golangci.yml` was removed. The FedWiki create handler's rule (`CreateSite`, complexity 48) is the one left under this issue. Commit: 9767f9ac
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wiki-cafe/member-console#174