deprecate enum variants

This commit is contained in:
Hanashi
2026-08-10 01:18:28 -04:00
parent abebbf398e
commit 220a9353e5
20 changed files with 91 additions and 0 deletions
@@ -1,3 +1,8 @@
// Deprecated model variants (e.g. the Seedance 2.0 Ultra tier) must keep
// their classification arms here so historical rows still map; suppress the
// deprecation lint file-wide.
#![allow(deprecated)]
use std::collections::BTreeSet;
#[cfg(test)]
@@ -1,3 +1,8 @@
// Deprecated model variants (e.g. the Seedance 2.0 Ultra tier) must keep
// their classification arms here so historical rows still map; suppress the
// deprecation lint file-wide.
#![allow(deprecated)]
use std::collections::BTreeSet;
#[cfg(test)]
@@ -1,3 +1,8 @@
// Deprecated model variants (e.g. the Seedance 2.0 Ultra tier) must keep
// their classification arms here so historical rows still map; suppress the
// deprecation lint file-wide.
#![allow(deprecated)]
use std::collections::BTreeSet;
#[cfg(test)]
@@ -1,3 +1,7 @@
// The deprecated Seedance 2.0 Ultra variants must stay referenced by this
// enum's own coders, variant lists, and tests; suppress the lint file-wide.
#![allow(deprecated)]
use std::collections::BTreeSet;
#[cfg(test)]
@@ -204,8 +208,10 @@ pub enum InferenceModelType {
Seedance2p0BytePlus,
#[serde(rename = "seedance_2p0_bp_fast")]
Seedance2p0BytePlusFast,
#[deprecated(note = "Never launched and unroutable; kept only so historical database rows keep decoding")]
#[serde(rename = "seedance_2p0_u")]
Seedance2p0Ultra,
#[deprecated(note = "Never launched and unroutable; kept only so historical database rows keep decoding")]
#[serde(rename = "seedance_2p0_u_fast")]
Seedance2p0UltraFast,
#[serde(rename = "seedance_2p0_bpu")]
@@ -1,3 +1,8 @@
// Deprecated model variants (e.g. the Seedance 2.0 Ultra tier) must keep
// their classification arms here so historical rows still map; suppress the
// deprecation lint file-wide.
#![allow(deprecated)]
use std::collections::BTreeSet;
#[cfg(test)]
@@ -1,3 +1,8 @@
// Deprecated model variants (e.g. the Seedance 2.0 Ultra tier) must keep
// their classification arms here so historical rows still map; suppress the
// deprecation lint file-wide.
#![allow(deprecated)]
use std::collections::BTreeSet;
use serde::Deserialize;
@@ -1,3 +1,8 @@
// Deprecated model variants (e.g. the Seedance 2.0 Ultra tier) must keep
// their classification arms here so historical rows still map; suppress the
// deprecation lint file-wide.
#![allow(deprecated)]
use std::collections::BTreeSet;
use serde::Deserialize;
@@ -1,3 +1,8 @@
// Deprecated model variants (e.g. the Seedance 2.0 Ultra tier) must keep
// their classification arms here so historical rows still map; suppress the
// deprecation lint file-wide.
#![allow(deprecated)]
use std::collections::BTreeSet;
#[cfg(test)]
@@ -1,3 +1,8 @@
// Deprecated model variants (e.g. the Seedance 2.0 Ultra tier) must keep
// their classification arms here so historical rows still map; suppress the
// deprecation lint file-wide.
#![allow(deprecated)]
use std::collections::BTreeSet;
use serde::Deserialize;
@@ -1,3 +1,8 @@
// Deprecated model variants (e.g. the Seedance 2.0 Ultra tier) must keep
// their classification arms here so historical rows still map; suppress the
// deprecation lint file-wide.
#![allow(deprecated)]
use std::collections::BTreeSet;
#[cfg(test)]
@@ -1,3 +1,8 @@
// Deprecated model variants (e.g. the Seedance 2.0 Ultra tier) must keep
// their classification arms here so historical rows still map; suppress the
// deprecation lint file-wide.
#![allow(deprecated)]
use std::collections::BTreeSet;
#[cfg(test)]
@@ -1,3 +1,7 @@
// The deprecated Seedance 2.0 Ultra variants must stay referenced by this
// enum's own coders, variant lists, and tests; suppress the lint file-wide.
#![allow(deprecated)]
use std::collections::BTreeSet;
use serde::Deserialize;
@@ -53,8 +57,10 @@ pub enum UploadedVideoNoteReportedModelType {
Seedance2p0BytePlus,
#[serde(rename = "seedance_2p0_bp_fast")]
Seedance2p0BytePlusFast,
#[deprecated(note = "Never launched and unroutable; kept only so historical database rows keep decoding")]
#[serde(rename = "seedance_2p0_u")]
Seedance2p0Ultra,
#[deprecated(note = "Never launched and unroutable; kept only so historical database rows keep decoding")]
#[serde(rename = "seedance_2p0_u_fast")]
Seedance2p0UltraFast,
#[serde(rename = "seedance_2p0_bpu")]
@@ -1,3 +1,7 @@
// The deprecated Seedance 2.0 Ultra variants must stay referenced by this
// enum's own coders, variant lists, and tests; suppress the lint file-wide.
#![allow(deprecated)]
use std::collections::BTreeSet;
use serde::Deserialize;
@@ -53,8 +57,10 @@ pub enum UploadedVideoDetectedModelType {
Seedance2p0BytePlus,
#[serde(rename = "seedance_2p0_bp_fast")]
Seedance2p0BytePlusFast,
#[deprecated(note = "Never launched and unroutable; kept only so historical database rows keep decoding")]
#[serde(rename = "seedance_2p0_u")]
Seedance2p0Ultra,
#[deprecated(note = "Never launched and unroutable; kept only so historical database rows keep decoding")]
#[serde(rename = "seedance_2p0_u_fast")]
Seedance2p0UltraFast,
#[serde(rename = "seedance_2p0_bpu")]
@@ -1,3 +1,8 @@
// Deprecated model variants (e.g. the Seedance 2.0 Ultra tier) must keep
// their classification arms here so historical rows still map; suppress the
// deprecation lint file-wide.
#![allow(deprecated)]
use std::collections::BTreeSet;
#[cfg(test)]
@@ -1,3 +1,7 @@
// The deprecated Seedance 2.0 Ultra variants must stay referenced by this
// enum's own coders, variant lists, and tests; suppress the lint file-wide.
#![allow(deprecated)]
use std::collections::BTreeSet;
#[cfg(test)]
@@ -175,8 +179,10 @@ pub enum CommonModelType {
Seedance2p0BytePlus,
#[serde(rename = "seedance_2p0_bp_fast")]
Seedance2p0BytePlusFast,
#[deprecated(note = "Never launched and unroutable; kept only so historical database rows keep decoding")]
#[serde(rename = "seedance_2p0_u")]
Seedance2p0Ultra,
#[deprecated(note = "Never launched and unroutable; kept only so historical database rows keep decoding")]
#[serde(rename = "seedance_2p0_u_fast")]
Seedance2p0UltraFast,
#[serde(rename = "seedance_2p0_bpu")]
@@ -1,3 +1,7 @@
// The deprecated Seedance 2.0 Ultra variants must stay referenced by this
// enum's own coders, variant lists, and tests; suppress the lint file-wide.
#![allow(deprecated)]
use utoipa::ToSchema;
/// Video models available for generation.
@@ -74,9 +78,11 @@ pub enum CommonVideoModel {
#[serde(rename = "seedance_2p0_bp_fast")]
Seedance2p0BytePlusFast,
#[deprecated(note = "Never launched and unroutable; kept only so historical database rows keep decoding")]
#[serde(rename = "seedance_2p0_u")]
Seedance2p0Ultra,
#[deprecated(note = "Never launched and unroutable; kept only so historical database rows keep decoding")]
#[serde(rename = "seedance_2p0_u_fast")]
Seedance2p0UltraFast,
@@ -148,6 +148,7 @@ fn map_video_model(model: CommonVideoModel) -> Result<RouterVideoModel, HandlerE
CommonVideoModel::Seedance2p0 => RouterVideoModel::Seedance2p0,
CommonVideoModel::Seedance2p0Fast => RouterVideoModel::Seedance2p0Fast,
// Deprecated: these never launched and have no execution route.
#[allow(deprecated)]
CommonVideoModel::Seedance2p0Ultra
| CommonVideoModel::Seedance2p0UltraFast => {
return Err(HandlerError::InvalidInput(format!("Model is not supported: {:?}", model)));
@@ -1045,6 +1045,7 @@ mod seedance_2p0_u_fast {
/// must be written for it.
#[tokio::test]
#[cfg_attr(feature = "skip_database_tests", ignore)]
#[allow(deprecated)]
async fn seedance_2p0_ultra_fast_is_unroutable_and_charges_nothing() {
let harness = TestHarness::create().await;
@@ -1088,6 +1089,7 @@ mod premium {
/// real pricing tests are required.
#[tokio::test]
#[cfg_attr(feature = "skip_database_tests", ignore)]
#[allow(deprecated)]
async fn seedance_2p0_ultra_fast_is_deprecated_and_cannot_be_quoted() {
use actix_web::web::Json;
@@ -1068,6 +1068,7 @@ mod seedance_2p0_u {
/// written for it.
#[tokio::test]
#[cfg_attr(feature = "skip_database_tests", ignore)]
#[allow(deprecated)]
async fn seedance_2p0_ultra_is_unroutable_and_charges_nothing() {
let harness = TestHarness::create().await;
@@ -103,6 +103,8 @@ pub fn model_family_for_type(
| Type::Kling3p0Standard
| Type::Kling3p0Pro => Family::Kling,
Type::HappyHorse1p0 => Family::HappyHorse,
// Historical rows may carry the deprecated Ultra tier variants.
#[allow(deprecated)]
Type::Seedance10Lite
| Type::Seedance1p5Pro
| Type::Seedance2p0