Skip to content

Commit 006a6e3

Browse files
fix: remove extra code
1 parent 6849b11 commit 006a6e3

File tree

14 files changed

+15
-60
lines changed

14 files changed

+15
-60
lines changed

src/taskgraph/config.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
class WorkerAlias(Schema):
2727
"""Worker alias configuration."""
28+
2829
provisioner: optionally_keyed_by("level", str) # type: ignore
2930
implementation: str
3031
os: str
@@ -90,11 +91,6 @@ class GraphConfigSchema(Schema, forbid_unknown_fields=False):
9091
task_expires_after: Optional[str] = None # Maps from "task-expires-after"
9192

9293

93-
94-
# Msgspec schema is now the main schema
95-
graph_config_schema = GraphConfigSchema
96-
97-
9894
@dataclass(frozen=True, eq=False)
9995
class GraphConfig:
10096
_config: Dict

src/taskgraph/decision.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ class TryTaskConfigSchemaV2(Schema):
4545
parameters: Optional[Dict[str, Any]] = None
4646

4747

48-
try_task_config_schema_v2 = TryTaskConfigSchemaV2
49-
50-
5148
def full_task_graph_to_runnable_tasks(full_task_json):
5249
runnable_tasks = {}
5350
for label, node in full_task_json.items():
@@ -355,7 +352,7 @@ def set_try_config(parameters, task_config_file):
355352
task_config_version = task_config.pop("version")
356353
if task_config_version == 2:
357354
validate_schema(
358-
try_task_config_schema_v2,
355+
TryTaskConfigSchemaV2,
359356
task_config,
360357
"Invalid v2 `try_task_config.json`.",
361358
)

src/taskgraph/parameters.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ class BaseSchema(Schema):
7979
code_review: Optional[CodeReviewConfig] = None
8080

8181

82-
# Keep backward compatibility
83-
base_schema = BaseSchema
84-
85-
8682
def get_contents(path):
8783
with open(path) as fh:
8884
contents = fh.readline().rstrip()
@@ -168,7 +164,7 @@ def extend_parameters_schema(schema, defaults_fn=None):
168164
dict mapping parameter name to default value in the
169165
event strict=False (optional).
170166
"""
171-
global base_schema
167+
global BaseSchema
172168
global defaults_functions
173169
global _schema_extensions
174170

@@ -249,7 +245,7 @@ def check(self):
249245
# Strict mode: validate against schema and check for extra fields
250246
# Get all valid field names from the base schema
251247
schema_fields = {
252-
f.encode_name for f in msgspec.structs.fields(base_schema)
248+
f.encode_name for f in msgspec.structs.fields(BaseSchema)
253249
}
254250

255251
# Check for extra fields
@@ -260,17 +256,17 @@ def check(self):
260256
)
261257

262258
# Validate all parameters against the schema
263-
msgspec.convert(kebab_params, base_schema)
259+
msgspec.convert(kebab_params, BaseSchema)
264260
else:
265261
# Non-strict mode: only validate fields that exist in the schema
266262
# Filter to only include fields defined in the schema
267263
schema_fields = {
268-
f.encode_name for f in msgspec.structs.fields(base_schema)
264+
f.encode_name for f in msgspec.structs.fields(BaseSchema)
269265
}
270266
filtered_params = {
271267
k: v for k, v in kebab_params.items() if k in schema_fields
272268
}
273-
msgspec.convert(filtered_params, base_schema)
269+
msgspec.convert(filtered_params, BaseSchema)
274270
except (msgspec.ValidationError, msgspec.DecodeError) as e:
275271
raise ParameterMismatch(f"Invalid parameters: {e}")
276272

src/taskgraph/transforms/docker_image.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ class DockerImageSchema(Schema):
5454
cache: Optional[bool] = None
5555

5656

57-
# Backward compatibility
58-
docker_image_schema = DockerImageSchema
59-
60-
6157
transforms.add_validate(DockerImageSchema)
6258

6359

src/taskgraph/transforms/fetch.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ def __post_init__(self):
6464
raise msgspec.ValidationError("fetch must be a dict with a 'type' field")
6565

6666

67-
# Backward compatibility
68-
FETCH_SCHEMA = FetchSchema
69-
7067
# define a collection of payload builders, depending on the worker implementation
7168
fetch_builders = {}
7269

src/taskgraph/transforms/from_deps.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,6 @@ class FromDepsSchema(Schema, forbid_unknown_fields=False):
9595
from_deps: FromDepsConfig
9696

9797

98-
# Backward compatibility
99-
FROM_DEPS_SCHEMA = FromDepsSchema
100-
10198
transforms = TransformSequence()
10299
transforms.add_validate(FromDepsSchema)
103100

src/taskgraph/transforms/matrix.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,8 @@ class MatrixSchema(Schema, forbid_unknown_fields=False):
5050
matrix: Optional[MatrixConfig] = None
5151

5252

53-
MATRIX_SCHEMA = MatrixSchema
54-
5553
transforms = TransformSequence()
56-
transforms.add_validate(MATRIX_SCHEMA)
54+
transforms.add_validate(MatrixSchema)
5755

5856

5957
def _resolve_matrix(tasks, key, values, exclude):

src/taskgraph/transforms/notify.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,6 @@ def __post_init__(self):
173173
self.notify.recipients = validated_recipients
174174

175175

176-
# Backward compatibility
177-
NOTIFY_SCHEMA = NotifySchema
178-
179176
transforms = TransformSequence()
180177
transforms.add_validate(NotifySchema)
181178

src/taskgraph/transforms/run/__init__.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,8 @@ class RunDescriptionSchema(Schema):
105105
worker: Dict[str, Any] = msgspec.field(default_factory=dict)
106106

107107

108-
# Use the msgspec class directly for fetches
109-
fetches_schema = FetchesSchema
110-
111-
#: Schema for a run transforms - now using msgspec
112-
run_description_schema = RunDescriptionSchema
113-
114-
115108
transforms = TransformSequence()
116-
transforms.add_validate(run_description_schema)
109+
transforms.add_validate(RunDescriptionSchema)
117110

118111

119112
@transforms.add

src/taskgraph/transforms/run/index_search.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ class RunTaskSchema(Schema):
2525
index_search: List[str]
2626

2727

28-
run_task_schema = RunTaskSchema
29-
30-
31-
@run_task_using("always-optimized", "index-search", schema=run_task_schema)
28+
@run_task_using("always-optimized", "index-search", schema=RunTaskSchema)
3229
def fill_template(config, task, taskdesc):
3330
run = task["run"]
3431
taskdesc["optimization"] = {

0 commit comments

Comments
 (0)