Skip to content

SI-5: Deprecate rest-api-core and remove from workspace - #1957

Merged
josecelano merged 8 commits into
torrust:developfrom
josecelano:1943-si-5-deprecate-rest-api-core
Jun 29, 2026
Merged

SI-5: Deprecate rest-api-core and remove from workspace#1957
josecelano merged 8 commits into
torrust:developfrom
josecelano:1943-si-5-deprecate-rest-api-core

Conversation

@josecelano

Copy link
Copy Markdown
Member

SI-5: Deprecate rest-api-core and remove from workspace

Closes #1943

Summary

After SI-4 migrated the stats context to the contract-first architecture, the rest-api-core package became an empty shell with a single consumer (axum-rest-api-server). This PR:

  1. Moves TrackerHttpApiCoreContainer (DI container) into rest-api-runtime-adapter
  2. Removes the entire packages/rest-api-core/ directory
  3. Updates all import paths across the workspace
  4. Removes workspace dependency and deny.toml wrapper rules
  5. Removes the crate from the deployment publish workflow
  6. Updates all documentation references (AGENTS.md, docs/packages.md)

Changes

Code Changes

  • Moved TrackerHttpApiCoreContainer from rest-api-core to rest-api-runtime-adapter/src/container.rs
  • Updated 7 import paths across axum-rest-api-server and src/ to use rest_api_runtime_adapter::container
  • Added tokio dependency to rest-api-runtime-adapter/Cargo.toml (needed for the container)
  • Removed rest-api-core dependency from axum-rest-api-server/Cargo.toml and root Cargo.toml
  • Deleted entire packages/rest-api-core/ directory (~1100 lines removed)
  • Updated deny.toml — removed rest-api-core from 3 wrapper rules
  • Updated .github/workflows/deployment.yaml — removed cargo publish step

Documentation Changes

  • Converted issue spec to folder format (ISSUE.md)
  • Updated AGENTS.md, packages/AGENTS.md, docs/packages.md
  • Added new use-rest-api skill under .github/skills/usage/
  • Added manual verification evidence to the issue spec

Verification

  • Workspace builds cleanly (cargo check --workspace)
  • Pre-commit checks pass
  • Pre-push checks pass (full test suite incl. workspace-coupling)
  • Manual verification: all API endpoints working correctly (stats, metrics, announce)

Copilot AI review requested due to automatic review settings June 29, 2026 15:19
@josecelano
josecelano requested a review from a team as a code owner June 29, 2026 15:19
@josecelano josecelano self-assigned this Jun 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the now-redundant torrust-tracker-rest-api-core crate from the workspace after the contract-first REST API migration, relocating the remaining DI container wiring into rest-api-runtime-adapter and updating workspace references, publishing workflow, and documentation accordingly.

Changes:

  • Moved TrackerHttpApiCoreContainer into torrust-tracker-rest-api-runtime-adapter and re-exported it from the crate.
  • Updated import paths and Cargo dependencies across the tracker binary and axum-rest-api-server; removed rest-api-core from the workspace, deny wrapper rules, and deployment publishing.
  • Updated documentation/issue specs and added a new use-rest-api skill with skill-link markers.

Reviewed changes

Copilot reviewed 30 out of 31 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/container.rs Switches container import to torrust-tracker-rest-api-runtime-adapter.
src/bootstrap/jobs/tracker_apis.rs Updates REST API container imports (including test module).
share/default/config/tracker.development.sqlite3.toml Adds skill-link: use-rest-api marker for REST API usage workflow.
packages/rest-api-runtime-adapter/src/lib.rs Exposes the new container module publicly.
packages/rest-api-runtime-adapter/src/container.rs New home for TrackerHttpApiCoreContainer wiring.
packages/rest-api-runtime-adapter/Cargo.toml Adds torrust-tracker-configuration and tokio (sync) for container wiring.
packages/rest-api-core/src/statistics/services.rs Deleted as part of removing rest-api-core.
packages/rest-api-core/src/statistics/mod.rs Deleted as part of removing rest-api-core.
packages/rest-api-core/src/statistics/metrics.rs Deleted as part of removing rest-api-core.
packages/rest-api-core/src/lib.rs Deleted as part of removing rest-api-core.
packages/rest-api-core/README.md Deleted as part of removing rest-api-core.
packages/rest-api-core/LICENSE Deleted as part of removing rest-api-core.
packages/rest-api-core/Cargo.toml Deleted as part of removing rest-api-core.
packages/axum-rest-api-server/src/v1/routes.rs Switches REST API container import to runtime-adapter.
packages/axum-rest-api-server/src/v1/middlewares/auth.rs Adds skill-link: use-rest-api marker in rustdoc header.
packages/axum-rest-api-server/src/testing/environment.rs Switches REST API container import to runtime-adapter.
packages/axum-rest-api-server/src/server.rs Switches REST API container import to runtime-adapter (incl. tests).
packages/axum-rest-api-server/src/routes.rs Switches REST API container import to runtime-adapter.
packages/axum-rest-api-server/Cargo.toml Drops dependency on torrust-tracker-rest-api-core.
packages/AGENTS.md Updates architecture docs to remove rest-api-core references.
docs/packages.md Removes rest-api-core references and documents SI-5 removal.
docs/issues/open/1943-1938-si-5-deprecate-rest-api-core/ISSUE.md New folder-based issue spec with manual verification evidence.
docs/issues/open/1943-1938-si-5-deprecate-rest-api-core.md Removes the old single-file issue spec (replaced by folder format).
docs/issues/open/1938-rest-api-contract-first-migration/EPIC.md Updates SI-5 link to point to the folder-based issue spec.
deny.toml Removes rest-api-core from wrapper rules.
Cargo.toml Removes workspace dependency on torrust-tracker-rest-api-core; adds runtime-adapter entry.
Cargo.lock Removes torrust-tracker-rest-api-core package; updates dependencies accordingly.
AGENTS.md Updates package catalog entry from rest-api-core to rest-api-runtime-adapter.
.github/workflows/deployment.yaml Removes cargo publish -p torrust-tracker-rest-api-core step.
.github/skills/usage/use-rest-api/SKILL.md Adds a new skill describing how to use/verify the REST API.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/AGENTS.md
Comment thread AGENTS.md Outdated
Comment thread docs/issues/open/1943-1938-si-5-deprecate-rest-api-core/ISSUE.md Outdated
Comment thread docs/issues/open/1943-1938-si-5-deprecate-rest-api-core/ISSUE.md Outdated
Comment thread docs/issues/open/1943-1938-si-5-deprecate-rest-api-core/ISSUE.md Outdated
Comment thread docs/issues/open/1943-1938-si-5-deprecate-rest-api-core/ISSUE.md Outdated
Comment thread .github/skills/usage/use-rest-api/SKILL.md
- Fix AGENTS.md: change rest-api-runtime-adapter layer from 'client tools' to 'runtime adapter'
- Fix packages/AGENTS.md: add Runtime Adapter layer to diagram, update description
- Fix ISSUE.md: update status to 'completed', last-updated-utc, check prerequisites and verification
- Fix use-rest-api SKILL.md: add Skill Links section
@josecelano

Copy link
Copy Markdown
Member Author

ACK 5dda558

@josecelano
josecelano merged commit ec8336b into torrust:develop Jun 29, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SI-5: Deprecate rest-api-core and remove from workspace

2 participants