Skip to content

Format crates under crates/formats/, each described in Rust instead of plugin.toml #442

Closed
3 of 3 issues completed

Description

@schmitch

After #437, Forge loads no WebAssembly plugins. Every package format is a crate the server links in. Two things are left over from when a format could also ship as a component that an operator installs:

  • plugins/ is a second top-level directory of workspace crates. It used to set apart the crates that build for wasm32-wasip2. Now it only adds an entry to the CI change filter (.github/scripts/ci-changes.sh), to CodeQL's filter (.github/workflows/codeql.yml), to .gitignore and to .dockerignore, and it backs a rule in AGENTS.md that keeps formats out of crates/.
  • plugin.toml was the manifest an installed component carried next to its .wasm. A built-in format still reads it at startup:
    • the crate embeds it as text (forge_plugin_api::plugin_toml!, an include_str!);
    • the server parses it with toml and expects the result ("plugins/nuget/plugin.toml is valid");
    • the id is leaked to get a &'static str;
    • its version must equal the crate's, and a test in each crate checks that;
    • its api (the contract version) can no longer disagree with the host, because both compile together.

Target

crates/formats/
├── README.md   # was plugins/README.md
├── nuget/      # forge-format-nuget
├── raw/        # forge-format-raw (#431)
└── docker/     # was crates/format-oci (forge-oci)

Each format describes itself in Rust, next to its impl FormatPlugin: id, name, description, kinds, assets and storage. There is no plugin.toml and no plugins/.

Steps, one pull request each

  1. Move the format crates from plugins/<id> to crates/formats/<id> #443: move plugins/<id> to crates/formats/<id>, and change the AGENTS.md rule to match.
  2. Describe each format in Rust and remove plugin.toml #444: replace plugin.toml with a descriptor in Rust.
  3. Move the Docker / OCI crate from crates/format-oci to crates/formats/docker #445: move crates/format-oci to crates/formats/docker.

#443 and #444 are independent of each other but touch the same files, so land one before starting the other. #445 follows #443, which sets the new rule in AGENTS.md.

Before starting

These open changes rewrite or add files under plugins/ or in plugin.toml. Work started before they merge will conflict with each of them.

Out of scope

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions