Give each channel a package index
orbit-index:latest in a channel lists its packages. Search reads it and falls back to the catalog; publish keeps it current and 'orbit index' rebuilds it. Installs never use it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2026319f61
commit
4271a084b6
7 files changed
+498
-25
No files matched your search
@@ -51,6 +51,21 @@ ship one under `files/share/doc/<name>/README.md`, as the `greet` example does.
|
||||
|
||||
Because these are ordinary OCI artifacts, you can sign them with `cosign` or `notation` and attach SBOMs using the registry's own tooling.
|
||||
|
||||
### Channel index
|
||||
|
||||
A channel can hold an index of its packages at `<channel url>/orbit-index:latest` (the name is reserved), so `orbit search` takes two requests per channel, matches descriptions too, and needs no catalog API. Each namespace (a Gitea user or organisation) has its own index, written by whoever can publish there. A nested channel such as `nandi/example` is separate from `nandi`. Without an index, search asks the registry's catalog.
|
||||
|
||||
The manifest has `artifactType` `application/vnd.latha.orbit.index.v1` and one JSON layer (`application/vnd.latha.orbit.index.v1+json`):
|
||||
|
||||
```json
|
||||
{"packages":[{"name":"mytool","version":"1.4.0","description":"...","versions":["1.4.0"]}]}
|
||||
```
|
||||
|
||||
- `orbit publish` adds the package to the index, and creates the index from the catalog if there is none. `--no-index` skips this.
|
||||
- `orbit index [--channel <name>]` rebuilds it from the catalog. Use it after deleting a package, or if two publishes ran at once and one entry was lost. On a registry without a catalog, name the packages: `orbit index mytool othertool`.
|
||||
- Installs and version lookups never read the index, so a stale one can't change what is installed.
|
||||
- The index is built with the publisher's login. On a registry where packages in one namespace can be private while others are public, a public index reveals the private names, descriptions and versions. Gitea sets visibility per owner, so this doesn't apply there.
|
||||
|
||||
## Usage
|
||||
|
||||
### Global environment
|
||||
@@ -230,6 +245,7 @@ src/main/
|
||||
semver.mbt versions, relational/compound constraints, parsing over src/kernel (+ tests)
|
||||
model.mbt orbit.json / state.json / config.json (+ tests)
|
||||
registry.mbt OCI registry ops: tags, resolve, cached manifests, fetch, publish, login
|
||||
index.mbt channel index: build, publish, read (+ tests)
|
||||
solver.mbt lazy Resolvo-style CDCL SAT solver & UNSAT explainer (+ tests)
|
||||
ops.mbt SAT-backed global install/upgrade, remove/rollback/gc/search
|
||||
project.mbt orbit.toml, orbit.lock, .orbit/ environments, project CLI (+ tests)
|
||||
@@ -252,4 +268,4 @@ Fixes needed for current MoonBit, kept here in case you build with an older comp
|
||||
- There's no lock file for concurrent runs, and no install hooks, by design.
|
||||
- `orbit gc` only preserves global current and rollback builds (run `orbit install` / `orbit sync` in a project to re-populate missing store entries from its `orbit.lock`).
|
||||
- `orbit info <name>` reads globally installed package details without contacting the registry. Use `orbit versions <name>` to check published versions.
|
||||
- `search` needs the registry's catalog API (Gitea has it, also without a login). If a registry doesn't offer it, use `orbit versions <name>`.
|
||||
- `search` needs a channel index or the registry's catalog API (Gitea has it, also without a login). Otherwise use `orbit versions <name>`.
|
||||
Reference in new issue
Block a user