Skip to content

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Oct 17, 2025

Moves API response serialization types into dedicated workspace crate:

  • src/views.rscrates/crates_io_api_types/src/lib.rs
  • src/views/krate_publish.rscrates/crates_io_api_types/src/krate_publish.rs
  • src/external_urls.rscrates/crates_io_api_types/src/external_urls.rs

Updates src/lib.rs to re-export the new crate as views for backward compatibility, maintaining existing imports throughout the codebase.

Uses sentry-core instead of sentry for library-appropriate error reporting in the EncodableCrate::from() method.

This will allow us to depend on these types from a future test utils crate, without having to pull in the full crates_io crate as a dependency.

@Turbo87 Turbo87 added the C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear label Oct 17, 2025
Moves API response serialization types into dedicated workspace crate:
- `src/views.rs` → `crates/crates_io_api_types/src/lib.rs`
- `src/views/krate_publish.rs` → `crates/crates_io_api_types/src/krate_publish.rs`
- `src/external_urls.rs` → `crates/crates_io_api_types/src/external_urls.rs`

Updates `src/lib.rs` to re-export the new crate as `views` for backward
compatibility, maintaining existing imports throughout the codebase.

Uses `sentry-core` instead of `sentry` for library-appropriate error
reporting in the `EncodableCrate::from()` method.
Moves `GitHubConfig` and `NewGitHubConfig` from controller-specific types
into a dedicated `trustpub` module in the `crates_io_api_types` crate.

These types represent the API request/response models for GitHub Actions
trusted publishing configuration, distinct from the database models in
`crates_io_database::models::trustpub`.
Moves `ReleaseTracks`, `ReleaseTrackName`, and `ReleaseTrackDetails` from
`controllers/krate/versions.rs` into a dedicated `release_tracks` module
in the `crates_io_api_types` crate.

These types represent version release tracking metadata used in the crate
versions API endpoint when `?include=release_tracks` is specified.

Unit tests for the release tracking logic are also moved to the new module.
@Turbo87 Turbo87 merged commit e633757 into rust-lang:main Oct 17, 2025
11 checks passed
@Turbo87 Turbo87 deleted the api-types-crate branch October 17, 2025 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants