Files

92 lines
6.3 KiB
Markdown
Raw Permalink Normal View History

# Gitea risks to test on a throwaway crate
Nothing here has been run against `forge.metabarcoding.org`. Each item states what the kit does (read in
`crate-kit` 0.2.5 sources), why it may fail on this forge, and a test. Publish nothing from `obiskim`
or from a real crate until the pilot below passes.
**Pilot**: a throwaway crate `obi/obi-pilot` (repository in the `obi` organization, registry `obi`),
adopted with `make -C obi-kit adopt CRATE=../obi-pilot`. Delete the packages, tags and releases afterwards
(a published package version can be deleted from the forge UI/API, but cannot be re-published under the
same version on some setups: use a name and versions that are disposable).
## 1. Gitea version and Cargo registry (sparse index)
- Kit: `REGISTRY_INDEX = sparse+https://forge.metabarcoding.org/api/packages/obi/cargo/`; `cargo publish
--registry obi`; `deps-check*.sh` read the public index and `Cargo.lock` entries containing `/api/packages/obi/`.
- Risk: the Cargo package registry exists only in recent Gitea/Forgejo; the **sparse** protocol requires
a recent enough version (older ones only serve a git index). The packages feature may also be disabled
in `app.ini` (`[packages] ENABLED`).
- Test: `curl -s https://forge.metabarcoding.org/api/healthz`/`/api/v1/version` for the version; `curl -I
<index>/config.json` must answer 200 with `dl` and `api` keys; `cargo search --registry obi x` or
`cargo publish --dry-run`; real publish of `obi-pilot 0.1.0`, then a consumer project resolving it.
- Risk: the index is **private** if the organization or repository is private: anonymous index reads in
`deps-check.sh` would then get 401/404. Test with and without token; check whether the organization
`obi` is public.
## 2. `/api/v1` endpoints of `forgejo-release.sh`
- Kit calls: `GET /api/v1/repos/$REPO/releases/tags/$TAG`, `GET .../git/refs/tags/$TAG`,
`GET .../git/tags/$SHA`, `POST .../releases`, `POST .../releases/$ID/assets?name=...` (multipart
`attachment`). Header `Authorization: token $FORGETOKEN`.
- Risk: written against Forgejo; Gitea's API is close but not identical (response shapes of
`git/refs`, asset upload, annotated-tag message). The existing `obiskim/.gitea/workflows/release.yml`
already uses `-F attachment=@...` against this forge, which is a good sign for assets only.
- Test: replay the release workflow on a pilot tag twice (idempotency: "release already exists: reused",
"asset already attached").
## 3. Wiki repository `.wiki.git`
- Kit: `wiki.sh` clones `${origin%.git}.wiki.git` (token via `http.extraHeader`), regenerates the pages,
pushes.
- Risks: (a) the wiki must be **enabled and initialized** on the repository (first page created) or the
clone fails; (b) the wiki of `obiskim` is a separate checkout (`../obiskim.wiki`) whose remote still points to
`OBIKmers/obikmer.wiki.git`; (c) `wiki.sh` derives the URL from `origin`, so it depends on the origin
fix done in `obiskim` (now `obi/obiskim.git`); (d) a token without wiki rights.
- Test: enable the wiki on `obi-pilot`, run `make wiki DRY_RUN=1` then for real.
- Note: `wiki.sh` is for crates (API doc); the application's user-doc wiki stays on `make wiki` of
`obiskim` (`pmotransdoc`).
## 4. Secret `FORGETOKEN`
- Workflows read `${{ secrets.FORGETOKEN }}` (repository secret) and use it for clone, publish, wiki
and release.
- Risks: the secret must exist **per repository** (or at organization level, to be tested: set it once on
the `obi` organization and check that it is inherited); token scopes must cover packages, repository,
wiki and releases (`write:package`, `write:repository`, `write:organization` may be needed to see the
organization's package registry); token owner must be a member of `obi` with write access.
- Test: a workflow step that prints only `${FORGETOKEN:+set}`; never echo the token.
- Local: `secrets/forge.metabarcoding.org.token` in `secrets/` of the cluster `obi` (outside every repository,
mode 0600; see crate-kit README, "Forge tokens").
## 5. Runner
- Crate workflow: `runs-on: ubuntu-latest`, `apt-get install ... build-essential pkg-config`, rustup
install, `cargo install cargo-doc-md --locked` (a long compile at every release).
- Risks: no runner registered for the `obi` organization (runners are per instance/organization/repo);
label `ubuntu-latest` may not exist (the existing obiskim workflow may use other labels: compare with
`obiskim/.gitea/workflows/release.yml`); runner needs network access to crates.io and the forge; `apt-get`
assumes a Debian/Ubuntu container running as root; timeout 30 min.
- Test: trigger a no-op workflow on `obi-pilot`; compare with the labels used by the working release.yml.
## 6. `crate-kit` location for the extension-kit workflow
- Decision (2026-12-01): `crate-kit` lives on `gargoton.petite-maison-orange.fr` and nowhere else; it is the
single reference, there is no `obi/crate-kit` mirror on `forge.metabarcoding.org`.
- `obi-kit/.gitea/workflows/release.yaml` clones it from `$CRATE_KIT_URL` (default
`https://gargoton.petite-maison-orange.fr/LLM/crate-kit`; override: repository variable `CRATE_KIT_URL`).
The repository is public: anonymous clone, no token. `FORGETOKEN` is never sent to gargoton.
- Test on the pilot: the runner must reach gargoton over HTTPS (network, certificate) and clone anonymously.
## 7. Other points seen while reading
- `dev-patch.sh` scans `Cargo.toml` and `*/Cargo.toml` of the project root only. In `obiskim` the members
are under `src/`: local `[patch.obi]` to neighbouring extracted crates will **not** be generated until
this is handled (set `CARGO_TOML`, or enrich `dev-patch.sh` in `crate-kit` to take a members directory).
`deps-check.sh` may have the same limitation. To test with the first extracted crate.
- `make check` (crate.mk) requires `publish = ["obi"]` in publishable crates: add it when extracting
(not in application crates, which are not published).
- `obiskim/Makefile` `release` target still uses `git tag` / `git push` (pre-existing); not touched.
- `jjrelease` needs the `jj` aliases `auto-doc` and `release-notes` (pmojj) and a `main` bookmark tracking
`main@origin`: check on the pilot, not on `obiskim`.
- `obiskim.wiki` remote and `obiskim`'s CI paths (`.gitea/workflows/release.yml` mentions the binary name
`obikmer`) must follow the rename decision (see report).