File tree Expand file tree Collapse file tree 2 files changed +3
-11
lines changed
rock/sdk/agent/models/job Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -139,16 +139,6 @@ class JobConfig(BaseModel):
139139 # ── Rock environment (Rock sandbox config + Harbor EnvironmentConfig, not serialized to Harbor YAML) ──
140140 environment : RockEnvironmentConfig = Field (default_factory = RockEnvironmentConfig )
141141
142- @model_validator (mode = "before" )
143- @classmethod
144- def _coerce_environment (cls , values ):
145- """Allow passing a plain EnvironmentConfig; upcast it to RockEnvironmentConfig."""
146- if isinstance (values , dict ):
147- env = values .get ("environment" )
148- if isinstance (env , EnvironmentConfig ) and not isinstance (env , RockEnvironmentConfig ):
149- values ["environment" ] = RockEnvironmentConfig .model_validate (env .model_dump ())
150- return values
151-
152142 # ── Harbor native fields ──
153143 namespace : str | None = Field (
154144 default = None ,
Original file line number Diff line number Diff line change @@ -120,11 +120,13 @@ def test_namespace_at_top_level_in_yaml(self):
120120 from rock .sdk .agent .models .job .config import JobConfig
121121 from rock .sdk .agent .models .trial .config import OssMirrorConfig
122122
123+ from rock .sdk .agent .models .trial .config import RockEnvironmentConfig
124+
123125 cfg = JobConfig (
124126 job_name = "mirror-test" ,
125127 namespace = "my-ns" ,
126128 experiment_id = "exp-1" ,
127- environment = EnvironmentConfig (
129+ environment = RockEnvironmentConfig (
128130 oss_mirror = OssMirrorConfig (
129131 enabled = True ,
130132 oss_bucket = "test-bucket" ,
You can’t perform that action at this time.
0 commit comments