Repository navigation
feat: add plugin pack install API - #201
Conversation
Adds the plugin_packs and plugin_pack_resources tables (chatdmig node), their forkdb queries with dbauthz and dbmetrics wrappers, and coderd/x/pluginpacks, which fetches one commit of a pack directory over smart HTTP with a host allowlist and fixed size caps. Packs reuse the organization skill RBAC object, so only organization admins and auditors read or manage them.
The 64 MiB transfer cap does not bound memory, because go-git inflates every fetched object into memory storage before the per-file limits run. Read the pack first and reject it when its object headers, and the target sizes of its deltas, add up to more than 256 MiB.
Organization admins can allowlist Git hosts and install, update, list and
delete plugin packs through /api/v2/chats/fork/organizations/{organization}
behind the fork-plugin-packs experiment. An install or update fetches the
pack, pins the resolved commit and stores its files. Members cannot see
packs and auditors can only read them.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac807c1972
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…nstall-api # Conflicts: # coderd/database/dbauthz/fork_forkdb.go # coderd/database/dbauthz/fork_forkdb_test.go # coderd/database/dbmetrics/fork_forkdb.go # coderd/database/forkdb/forkdbmock/forkdbmock.go # coderd/database/forkdb/models.go # coderd/database/forkdb/plugin_packs.sql.go # coderd/database/forkdb/querier.go # coderd/database/forkdb/queries/plugin_packs.sql # coderd/database/forkdb/sqlc.yaml # coderd/x/pluginpacks/fetch_test.go
|
@codex review
|
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Merged as a squash of head
|
Third step of plugin packs (R7.2), stacked on #200: the API that installs, lists, updates and deletes plugin packs, and the per-organization allowlist of Git hosts they can come from.
What changes
/api/v2/chats/fork/organizations/{organization}, behind thefork-plugin-packsexperiment and hidden from the API docs like the other fork routes:GET/PUT plugin-pack-sources: read or replace the allowlisted hosts (lowercased, deduplicated, host names only).GET/POST plugin-packs: list packs (without files), or install one from a source URL, path and ref.GET/DELETE plugin-packs/{pluginPack}: one pack with its file list (path, size, SHA-256), or delete it.POST plugin-packs/{pluginPack}/update: fetch again, at the current ref or a new one.plugin_pack_sourcesadds one row per organization with its host list, plusGetPluginPackSources/UpsertPluginPackSourceswith dbauthz and dbmetrics wrappers.pluginpackstest.Reposerves a realgit http-backendrepository over TLS, shared by the fetcher and API tests.Validation
forkdb/generate.sh,chatdmig check,go build ./coderd/... ./enterprise/... ./codersdk/..., vet, swag and apitypings regen (only the plugin pack entries are kept incoderd/apidocandtypesGenerated.ts)../coderd/x/pluginpacks/..., forkdbTestPluginPack*, dbauthzTestForkQuerier, coderdTestForkPluginPacksandTestForkChatRoutes, the swagger tests incoderdtestandcoderdenttest, and./coderd/database/migrations/chatdmig/against Postgres 17 with a matchingpg_dump.main, so it does not run on this PR until feat: store plugin packs and fetch them from Git #200 merges.