feat(tenancy): library of a tenant, read from the repository it declares #46

Merged
crapougnax merged 3 commits from feat/45-tenant-library into develop 2026-11-17 22:29:00 +00:00
Member

Closes #45. Part of #38 (step 4, reading).

What changes

  • Working copy per tenant. The Studio fetches the repository a tenant declares with the token of that tenant, under TENANT_DATA_PATH (default data/tenants, on the data volume in the deployment), one directory per tenant and per repository. It is fetched on first use, then again once a minute old.
  • Address checked before each call. The host is resolved and refused when it leads to the machine or to a private network.
  • Library page /t/<tenant>/library, for every member: themes declared by the tenant, then the other folders of content/, their documents, a filter by theme, a search, the state of the repository and a Refresh button. When a fetch fails the page says so and keeps the documents fetched before; the message of the forge is for the administrators of the tenant.
  • Routes GET and POST /t/<tenant>/api/tenant/library.
  • Fix: TenantSettingsError used a parameter property, which the type stripping of Node refuses. The administration command now imports that file, so the migration container of a deployment would have failed to start. A test now loads the command the way the deployment does.

Nothing is written to a repository yet: editing documents and ingesting files are the next steps of #38.

Verified

  • yarn test: 169 tests pass, with @quatrain/git 1.0.1-beta.1 (pinned exactly: a range would resolve to 1.0.1, released before GitWorkingCopy).
  • On a local database, with a public repository on GitHub: 41 documents listed by theme, for an administrator and for a curator of the tenant; a host that does not resolve is reported on the page; a non-member gets 404. Page checked in a browser.
  • Not verified: a private repository on GitHub with a token (the token path is verified against a private repository of the forge in Quatrain/Core#68).

🤖 Generated with Claude Code

Closes #45. Part of #38 (step 4, reading). ## What changes - **Working copy per tenant.** The Studio fetches the repository a tenant declares with the token of that tenant, under `TENANT_DATA_PATH` (default `data/tenants`, on the data volume in the deployment), one directory per tenant and per repository. It is fetched on first use, then again once a minute old. - **Address checked before each call.** The host is resolved and refused when it leads to the machine or to a private network. - **Library page** `/t/<tenant>/library`, for every member: themes declared by the tenant, then the other folders of `content/`, their documents, a filter by theme, a search, the state of the repository and a Refresh button. When a fetch fails the page says so and keeps the documents fetched before; the message of the forge is for the administrators of the tenant. - Routes `GET` and `POST /t/<tenant>/api/tenant/library`. - **Fix:** `TenantSettingsError` used a parameter property, which the type stripping of Node refuses. The administration command now imports that file, so the migration container of a deployment would have failed to start. A test now loads the command the way the deployment does. Nothing is written to a repository yet: editing documents and ingesting files are the next steps of #38. ## Verified - `yarn test`: 169 tests pass, with `@quatrain/git` 1.0.1-beta.1 (pinned exactly: a range would resolve to 1.0.1, released before `GitWorkingCopy`). - On a local database, with a public repository on GitHub: 41 documents listed by theme, for an administrator and for a curator of the tenant; a host that does not resolve is reported on the page; a non-member gets 404. Page checked in a browser. - Not verified: a private repository on GitHub with a token (the token path is verified against a private repository of the forge in Quatrain/Core#68). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(tenancy): library of a tenant, read from the repository it declares (#45)
Some checks failed
Build and Publish OCI Image / Build & Push ARM64 OCI Image (pull_request) Failing after 1m1s
ae5e352c75
The Studio keeps a working copy of the repository of each tenant, fetched
with the token of the tenant through GitWorkingCopy of @quatrain/git, and
lists its documents by theme on a Library page for the members.

Before it calls the address of a tenant, the Studio resolves the host and
refuses a local or private address.

TenantSettingsError no longer uses a parameter property: the administration
command, which now imports that file, runs with the type stripping of Node
and would have stopped the migrations of a deployment. A test loads the
command the way the deployment does.

Refs #45

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
claude-bot changed title from WIP: feat(tenancy): library of a tenant, read from the repository it declares to feat(tenancy): library of a tenant, read from the repository it declares 2026-11-17 22:23:11 +00:00
build: depend on the @quatrain/git build that carries GitWorkingCopy (#45)
All checks were successful
Build and Publish OCI Image / Build & Push ARM64 OCI Image (pull_request) Successful in 3m23s
a721c3bf49
Pinned exactly: the range would resolve to 1.0.1, released before it.

Closes #45

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
fix(tenancy): keep the administration command loadable from the container image (#45)
All checks were successful
Build and Publish OCI Image / Build & Push ARM64 OCI Image (pull_request) Successful in 4m41s
94f3e0ac22
The command imported the tenancy module, which now reaches the workspaces and,
through the tenant settings, a file of src/lib the image does not ship: the
migration container of a deployment would have failed to start. The tenancy
service the command needs moves to a module of its own, and the test now runs
the command from a copy of what the image holds.

Refs #45

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
crapougnax merged commit 1502977312 into develop 2026-11-17 22:29:00 +00:00
crapougnax deleted branch feat/45-tenant-library 2026-11-17 22:29:00 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
modaka/studio!46
No description provided.