91 lines
6.2 KiB
Markdown
91 lines
6.2 KiB
Markdown
# 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-token` in `obi-kit` (gitignored, mode 0600).
|
||
|
|
|
||
|
|
## 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
|
||
|
|
|
||
|
|
- `obi-kit/.gitea/workflows/release.yaml` clones `crate-kit` from `$SERVER/$CRATE_KIT_REPO`, default
|
||
|
|
`LLM/crate-kit`, on **the same forge as `obi-kit`** (`SERVER` = `forge.metabarcoding.org`).
|
||
|
|
- Risk: `crate-kit` currently lives on `gargoton.petite-maison-orange.fr`, another forge: `LLM/crate-kit` does
|
||
|
|
not exist on `forge.metabarcoding.org`, so the obi-kit release workflow fails at its second clone.
|
||
|
|
- Options to decide: mirror/push `crate-kit` to the `obi` organization and set the repository variable
|
||
|
|
`CRATE_KIT_REPO=obi/crate-kit`, or change the clone URL. Not decided.
|
||
|
|
|
||
|
|
## 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).
|