Skip to content

Move the format crates from plugins/<id> to crates/formats/<id> #443

Closed

Description

@schmitch

Part of #442. Since #437 the server links in every format, so plugins/ is now just a second directory of workspace crates. The format crates move under crates/, to crates/formats/<id>/. Each directory keeps the format id as its name. The crate names (forge-format-nuget, forge-format-raw) and their code stay the same.

Change

  • Run git mv plugins/<id> crates/formats/<id> for every crate in plugins/ at the time: nuget, plus raw once Raw repositories as a built-in format plugin over a host file store #441 has merged. Move plugins/README.md to crates/formats/README.md. plugins/ is then gone.
  • Fix the paths that depend on directory depth:
    • the workspace members in Cargo.toml;
    • the path dependencies on the format crates in crates/core, crates/e2e and crates/server (../../plugins/nuget becomes ../formats/nuget);
    • the format crates' own dependency on forge-plugin-api (../../crates/plugin-api becomes ../../plugin-api);
    • tests/parse.rs of NuGet, which reads the fixtures as CARGO_MANIFEST_DIR/../../fixtures/nuget and is now one level deeper.
  • Fix the tooling that names plugins. In each place below, crates already covers the new location:
    • the Rust paths in .github/scripts/ci-changes.sh;
    • the touches check in .github/workflows/codeql.yml;
    • the comment in .github/codeql/codeql-config.yml;
    • /plugins/*/target in .gitignore and .dockerignore.
  • Rewrite the AGENTS.md section Formats: every format plugin lives under plugins/ as every format lives under crates/formats/:
  • Update every other mention of plugins/<id>:
    • README.md: the crate table and Every format is a plugin in plugins/;
    • DEVELOPMENT.md: the layout and the CI path tables;
    • docs/format-plugins.md and crates/formats/README.md;
    • the module docs of forge-plugin, forge-plugin-api, forge-core and forge-server;
    • the expect messages that name plugins/nuget/plugin.toml;
    • fixtures/nuget/make_fixtures.py.

No changelog fragment is needed, since nothing changes for anyone running Forge.

Acceptance criteria

  • plugins/ does not exist, and crates/formats/<id>/ holds every format crate it used to hold.
  • cargo clippy --workspace --all-targets -- -D warnings and cargo test --workspace pass, including the NuGet fixture tests.
  • git grep finds no path into the old plugins/ directory outside CHANGELOG.md and docs/changes/.
  • A change under crates/formats/ still starts the Rust jobs of CI and of CodeQL.
  • AGENTS.md, README.md and DEVELOPMENT.md name crates/formats/<id> as the place for a format.

Start after #440 and #441 merge. Both rewrite or add files under plugins/.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions