Repository navigation
[ci][raydepsets] Add JSON schema validation for depset configs - #65305
elliot-barn wants to merge 2 commits into
Conversation
Add ci/raydepsets/depsets.schema.json defining a per-operation schema (compile, expand, subset, relax) for *.depsets.yaml configs, and validate every depset against its operation's schema at config load time in workspace.py. - Unknown/misplaced fields, missing required fields, and wrong types now fail fast at load time with errors pointing at the exact field, instead of being silently ignored or failing mid-uv-run. - Validation targets the operation's schema branch directly (picked by the operation discriminator), avoiding jsonschema's unhelpful oneOf union errors. - Add yaml-language-server schema modelines to all configs for editor autocomplete and inline validation. - Remove a stray, silently-ignored `depsets` key from docbuild_depset (operation: compile) in docs.depsets.yaml; no behavior change. - jsonschema is already in release/requirements_py310.txt, so no new dependency pins. Co-Authored-By: Claude Fable 5 <[email protected]> Signed-off-by: elliot-barn <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request introduces JSON schema validation for *.depsets.yaml configuration files in ci/raydepsets. It adds a JSON schema file, integrates jsonschema validation into the workspace configuration loader, and adds corresponding unit tests. The review feedback suggests specifying encoding="utf-8" when opening files to prevent UnicodeDecodeError on Windows, implementing top-level configuration validation (in addition to per-depset validation), and adding a test case for invalid top-level configuration structures.
| def _get_operation_validators() -> Dict[str, jsonschema.Draft202012Validator]: | ||
| """Load per-operation validators from depsets.schema.json, once.""" | ||
| if not _operation_validators: | ||
| with open(_SCHEMA_PATH, "r") as f: | ||
| schema = json.load(f) | ||
| for operation in schema["$defs"]["depset"]["properties"]["operation"]["enum"]: | ||
| # Validate directly against the operation's branch so errors point | ||
| # at the offending field instead of a generic oneOf mismatch. | ||
| _operation_validators[operation] = jsonschema.Draft202012Validator( | ||
| {"$defs": schema["$defs"], "$ref": f"#/$defs/{operation}"} | ||
| ) | ||
| return _operation_validators |
There was a problem hiding this comment.
The schema file is opened without specifying an encoding, which can lead to UnicodeDecodeError on Windows systems where the default encoding is not UTF-8. Additionally, the top-level configuration structure (such as build_arg_sets and checking for unexpected top-level keys) is never validated against the schema. We can define a shallow top-level validator to ensure the config structure is correct and each depset is an object, while leaving the detailed per-depset validation to the existing validate_depset logic.
_config_validator: Optional[jsonschema.Draft202012Validator] = None
def _get_config_validator() -> jsonschema.Draft202012Validator:
"""Load the top-level config validator from depsets.schema.json, once."""
global _config_validator
if _config_validator is None:
with open(_SCHEMA_PATH, "r", encoding="utf-8") as f:
schema = json.load(f)
shallow_schema = {
"$schema": schema.get("$schema"),
"type": "object",
"required": ["depsets"],
"additionalProperties": False,
"properties": {
"build_arg_sets": schema["properties"]["build_arg_sets"],
"depsets": {
"type": "array",
"items": {"type": "object"},
},
},
}
_config_validator = jsonschema.Draft202012Validator(shallow_schema)
return _config_validator
def _get_operation_validators() -> Dict[str, jsonschema.Draft202012Validator]:
"""Load per-operation validators from depsets.schema.json, once."""
if not _operation_validators:
with open(_SCHEMA_PATH, "r", encoding="utf-8") as f:
schema = json.load(f)
for operation in schema["$defs"]["depset"]["properties"]["operation"]["enum"]:
# Validate directly against the operation's branch so errors point
# at the offending field instead of a generic oneOf mismatch.
_operation_validators[operation] = jsonschema.Draft202012Validator(
{"$defs": schema["$defs"], "$ref": f"#/$defs/{operation}"}
)
return _operation_validators| def validate_depset(depset: dict, config_name: str) -> None: | ||
| """Validate a raw depset dict against the schema for its operation.""" | ||
| name = depset.get("name", "<unnamed>") | ||
| operation = depset.get("operation") | ||
| validators = _get_operation_validators() | ||
| if operation not in validators: | ||
| raise ValueError( | ||
| f"Invalid operation: {operation} for depset {name} in config {config_name}" | ||
| ) | ||
| errors = sorted( | ||
| validators[operation].iter_errors(depset), key=lambda e: e.json_path | ||
| ) | ||
| if errors: | ||
| details = "\n".join(f" {_format_schema_error(e)}" for e in errors) | ||
| raise ValueError( | ||
| f"Invalid {operation} depset {name} in config {config_name}:\n{details}" | ||
| ) |
There was a problem hiding this comment.
Add a validate_config helper to validate the top-level config structure against the shallow schema before processing individual depsets.
def validate_config(data: Any, config_name: str) -> None:
"""Validate the top-level config structure (e.g. build_arg_sets and allowed keys)."""
if not isinstance(data, dict):
raise ValueError(f"Config {config_name} must be a YAML object/dictionary")
validator = _get_config_validator()
errors = sorted(validator.iter_errors(data), key=lambda e: e.json_path)
if errors:
details = "\n".join(
f" {e.json_path}: {e.message}" if e.json_path != "$" else f" {e.message}"
for e in errors
)
raise ValueError(f"Invalid config structure in {config_name}:\n{details}")
def validate_depset(depset: dict, config_name: str) -> None:
"""Validate a raw depset dict against the schema for its operation."""
name = depset.get("name", "<unnamed>")
operation = depset.get("operation")
validators = _get_operation_validators()
if operation not in validators:
raise ValueError(
f"Invalid operation: {operation} for depset {name} in config {config_name}"
)
errors = sorted(
validators[operation].iter_errors(depset), key=lambda e: e.json_path
)
if errors:
details = "\n".join(f" {_format_schema_error(e)}" for e in errors)
raise ValueError(
f"Invalid {operation} depset {name} in config {config_name}:\n{details}"
)| def _load_config_from_yaml(tmpdir, yaml_contents: str): | ||
| with open(Path(tmpdir) / "test.depsets.yaml", "w") as f: | ||
| f.write(yaml_contents) | ||
| workspace = Workspace(dir=tmpdir) | ||
| return workspace.load_config(config_path=Path(tmpdir) / "test.depsets.yaml") |
There was a problem hiding this comment.
Specify encoding="utf-8" when writing the temporary YAML file to prevent potential encoding issues on Windows.
| def _load_config_from_yaml(tmpdir, yaml_contents: str): | |
| with open(Path(tmpdir) / "test.depsets.yaml", "w") as f: | |
| f.write(yaml_contents) | |
| workspace = Workspace(dir=tmpdir) | |
| return workspace.load_config(config_path=Path(tmpdir) / "test.depsets.yaml") | |
| def _load_config_from_yaml(tmpdir, yaml_contents: str): | |
| with open(Path(tmpdir) / "test.depsets.yaml", "w", encoding="utf-8") as f: | |
| f.write(yaml_contents) | |
| workspace = Workspace(dir=tmpdir) | |
| return workspace.load_config(config_path=Path(tmpdir) / "test.depsets.yaml") |
| if __name__ == "__main__": | ||
| sys.exit(pytest.main(["-v", __file__])) |
There was a problem hiding this comment.
Add a unit test to verify that invalid top-level config structures (such as unexpected keys) are correctly rejected by the new top-level validation.
| if __name__ == "__main__": | |
| sys.exit(pytest.main(["-v", __file__])) | |
| def test_schema_invalid_top_level_config(): | |
| with tempfile.TemporaryDirectory() as tmpdir: | |
| with pytest.raises(ValueError) as e: | |
| _load_config_from_yaml( | |
| tmpdir, | |
| """ | |
| invalid_top_key: some_value | |
| depsets: [] | |
| """, | |
| ) | |
| assert "Invalid config structure" in str(e.value) | |
| assert "invalid_top_key" in str(e.value) | |
| if __name__ == "__main__": | |
| sys.exit(pytest.main(["-v", __file__])) |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bf74d79. Configure here.
| "description": "Schema for ci/raydepsets *.depsets.yaml config files. Each depset entry is validated against the schema for its operation: compile, expand, subset, or relax.", | ||
| "type": "object", | ||
| "required": ["depsets"], | ||
| "additionalProperties": false, |
There was a problem hiding this comment.
Schema rejects YAML anchor keys
Medium Severity
Root-level additionalProperties: false forbids keys like .common_settings, but that documented YAML-anchor pattern is used in real configs that now point at this schema via modelines. Editors will flag valid configs as invalid even though runtime loading ignores those keys.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit bf74d79. Configure here.
## Summary Regenerates `python/deplocks/ray-torch/ray-torch-cu128_base_py3.14.lock`, which has been failing `raydepsets --check` since 2026-08-05. #65114 added the file pinning `aiohttp==3.13.5`, but aiohttp 3.14.3 was published on 2026-07-23 — before that PR landed. A fresh `uv pip compile` therefore resolves 3.14.3, and `build: raydepsets: compile all dependencies` reports the committed lock as out of date: ``` --- python/deplocks/ray-torch/ray-torch-cu128_base_py3.14.lock +++ /tmp/.../python/deplocks/ray-torch/ray-torch-cu128_base_py3.14.lock @@ -13,127 +13,126 @@ -aiohttp==3.13.5 +aiohttp==3.14.3 ``` `aiohttp` is the only package that moves. The rest of the diff is its hash block, one line shorter — which matches the `@@ -13,127 +13,126 @@` hunk the checker produced. ## Why this went unnoticed for five days The check is gated on the `python_dependencies` tag (`.buildkite/dependencies.rayci.yml:22-27`), which a PR only earns by touching `python/deplocks/`, `ci/raydepsets/configs/` or `python/requirements*`. **1 of the last 40 premerge builds ran the step at all.** So almost nothing trips it, and the PRs that do inherit an unrelated red X, because the step runs `--all-configs` and checks every lock in the repo rather than the one the PR edited. Postmerge ignores tags, so it is also failing there — including on `releases/2.58.0` (postmerge build 19108), which puts it in the 2.58.0 release path. ## Testing Regenerated with the depset's own config rather than by hand, so the output is whatever the checker computes: ```bash bazelisk run //ci/raydepsets:raydepsets -- build \ ci/raydepsets/configs/ray_torch.depsets.yaml \ --name ray_torch_cu128_base_depset_314 ``` Then the full gate, exactly as CI runs it: ```bash bazelisk run //ci/raydepsets:raydepsets -- build --all-configs --check ``` - **Passes** (exit 0) with this change applied. - Only `python/deplocks/ray-torch/ray-torch-cu128_base_py3.14.lock` is modified — `git status` is otherwise clean after the full check, so no other lock has drifted and the fix is complete rather than the first of several. - Verified against master beforehand: the same command fails on `origin/master` with the diff quoted above. One note for anyone re-running this locally: `--all-configs` intermittently dies on `503 Service Unavailable` from `download.pytorch.org` while resolving the GPU configs (it hit `.../whl/cu128/jupyter-lsp/` on my first attempt). That's transient and unrelated — a retry passed. Worth distinguishing from a genuine lock mismatch, since both surface as exit 1. ## Not a duplicate No open PR touches this file. Checked the plausible candidates' file lists directly rather than by title: #65305 (depset config JSON schema validation), #65318 (wanda image rename), #65206 (dependabot bumping aiohttp in `ci/raydepsets/tests/test_data/`, a test fixture rather than a real deplock), #64885 (text_embedding release-test depset) — none of them modify `python/deplocks/ray-torch/`. `python/deplocks/ray-torch/` has exactly one commit in its history, #65114, which is the one that introduced the drift. No commit has touched any deplock since 2026-08-05. cc the author of #65114 for awareness, since this is their file. ## AI assistance Prepared with AI assistance (Claude Code). I have reviewed the change and can defend it: it is a mechanical regeneration, the diff is one package plus its hashes, and the verification above is the same command CI runs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Ronny Roland <[email protected]>
…ject#65343) ## Summary Regenerates `python/deplocks/ray-torch/ray-torch-cu128_base_py3.14.lock`, which has been failing `raydepsets --check` since 2026-08-05. ray-project#65114 added the file pinning `aiohttp==3.13.5`, but aiohttp 3.14.3 was published on 2026-07-23 — before that PR landed. A fresh `uv pip compile` therefore resolves 3.14.3, and `build: raydepsets: compile all dependencies` reports the committed lock as out of date: ``` --- python/deplocks/ray-torch/ray-torch-cu128_base_py3.14.lock +++ /tmp/.../python/deplocks/ray-torch/ray-torch-cu128_base_py3.14.lock @@ -13,127 +13,126 @@ -aiohttp==3.13.5 +aiohttp==3.14.3 ``` `aiohttp` is the only package that moves. The rest of the diff is its hash block, one line shorter — which matches the `@@ -13,127 +13,126 @@` hunk the checker produced. ## Why this went unnoticed for five days The check is gated on the `python_dependencies` tag (`.buildkite/dependencies.rayci.yml:22-27`), which a PR only earns by touching `python/deplocks/`, `ci/raydepsets/configs/` or `python/requirements*`. **1 of the last 40 premerge builds ran the step at all.** So almost nothing trips it, and the PRs that do inherit an unrelated red X, because the step runs `--all-configs` and checks every lock in the repo rather than the one the PR edited. Postmerge ignores tags, so it is also failing there — including on `releases/2.58.0` (postmerge build 19108), which puts it in the 2.58.0 release path. ## Testing Regenerated with the depset's own config rather than by hand, so the output is whatever the checker computes: ```bash bazelisk run //ci/raydepsets:raydepsets -- build \ ci/raydepsets/configs/ray_torch.depsets.yaml \ --name ray_torch_cu128_base_depset_314 ``` Then the full gate, exactly as CI runs it: ```bash bazelisk run //ci/raydepsets:raydepsets -- build --all-configs --check ``` - **Passes** (exit 0) with this change applied. - Only `python/deplocks/ray-torch/ray-torch-cu128_base_py3.14.lock` is modified — `git status` is otherwise clean after the full check, so no other lock has drifted and the fix is complete rather than the first of several. - Verified against master beforehand: the same command fails on `origin/master` with the diff quoted above. One note for anyone re-running this locally: `--all-configs` intermittently dies on `503 Service Unavailable` from `download.pytorch.org` while resolving the GPU configs (it hit `.../whl/cu128/jupyter-lsp/` on my first attempt). That's transient and unrelated — a retry passed. Worth distinguishing from a genuine lock mismatch, since both surface as exit 1. ## Not a duplicate No open PR touches this file. Checked the plausible candidates' file lists directly rather than by title: ray-project#65305 (depset config JSON schema validation), ray-project#65318 (wanda image rename), ray-project#65206 (dependabot bumping aiohttp in `ci/raydepsets/tests/test_data/`, a test fixture rather than a real deplock), ray-project#64885 (text_embedding release-test depset) — none of them modify `python/deplocks/ray-torch/`. `python/deplocks/ray-torch/` has exactly one commit in its history, ray-project#65114, which is the one that introduced the drift. No commit has touched any deplock since 2026-08-05. cc the author of ray-project#65114 for awareness, since this is their file. ## AI assistance Prepared with AI assistance (Claude Code). I have reviewed the change and can defend it: it is a mechanical regeneration, the diff is one package plus its hashes, and the verification above is the same command CI runs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Ronny Roland <[email protected]>
…http 3.14.3) (#65343) (#65378) ## Summary Regenerates `python/deplocks/ray-torch/ray-torch-cu128_base_py3.14.lock`, which has been failing `raydepsets --check` since 2026-08-05. #65114 added the file pinning `aiohttp==3.13.5`, but aiohttp 3.14.3 was published on 2026-07-23 — before that PR landed. A fresh `uv pip compile` therefore resolves 3.14.3, and `build: raydepsets: compile all dependencies` reports the committed lock as out of date: ``` --- python/deplocks/ray-torch/ray-torch-cu128_base_py3.14.lock +++ /tmp/.../python/deplocks/ray-torch/ray-torch-cu128_base_py3.14.lock @@ -13,127 +13,126 @@ -aiohttp==3.13.5 +aiohttp==3.14.3 ``` `aiohttp` is the only package that moves. The rest of the diff is its hash block, one line shorter — which matches the `@@ -13,127 +13,126 @@` hunk the checker produced. ## Why this went unnoticed for five days The check is gated on the `python_dependencies` tag (`.buildkite/dependencies.rayci.yml:22-27`), which a PR only earns by touching `python/deplocks/`, `ci/raydepsets/configs/` or `python/requirements*`. **1 of the last 40 premerge builds ran the step at all.** So almost nothing trips it, and the PRs that do inherit an unrelated red X, because the step runs `--all-configs` and checks every lock in the repo rather than the one the PR edited. Postmerge ignores tags, so it is also failing there — including on `releases/2.58.0` (postmerge build 19108), which puts it in the 2.58.0 release path. ## Testing Regenerated with the depset's own config rather than by hand, so the output is whatever the checker computes: ```bash bazelisk run //ci/raydepsets:raydepsets -- build \ ci/raydepsets/configs/ray_torch.depsets.yaml \ --name ray_torch_cu128_base_depset_314 ``` Then the full gate, exactly as CI runs it: ```bash bazelisk run //ci/raydepsets:raydepsets -- build --all-configs --check ``` - **Passes** (exit 0) with this change applied. - Only `python/deplocks/ray-torch/ray-torch-cu128_base_py3.14.lock` is modified — `git status` is otherwise clean after the full check, so no other lock has drifted and the fix is complete rather than the first of several. - Verified against master beforehand: the same command fails on `origin/master` with the diff quoted above. One note for anyone re-running this locally: `--all-configs` intermittently dies on `503 Service Unavailable` from `download.pytorch.org` while resolving the GPU configs (it hit `.../whl/cu128/jupyter-lsp/` on my first attempt). That's transient and unrelated — a retry passed. Worth distinguishing from a genuine lock mismatch, since both surface as exit 1. ## Not a duplicate No open PR touches this file. Checked the plausible candidates' file lists directly rather than by title: #65305 (depset config JSON schema validation), #65318 (wanda image rename), #65206 (dependabot bumping aiohttp in `ci/raydepsets/tests/test_data/`, a test fixture rather than a real deplock), #64885 (text_embedding release-test depset) — none of them modify `python/deplocks/ray-torch/`. `python/deplocks/ray-torch/` has exactly one commit in its history, #65114, which is the one that introduced the drift. No commit has touched any deplock since 2026-08-05. cc the author of #65114 for awareness, since this is their file. ## AI assistance Prepared with AI assistance (Claude Code). I have reviewed the change and can defend it: it is a mechanical regeneration, the diff is one package plus its hashes, and the verification above is the same command CI runs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) > Thank you for contributing to Ray! 🚀 > Please review the [Ray Contribution Guide](https://docs.ray.io/en/master/ray-contribute/getting-involved.html) before opening a pull request. >⚠️ Remove these instructions before submitting your PR. > 💡 Tip: Mark as draft if you want early feedback, or ready for review when it's complete. ## Description > Briefly describe what this PR accomplishes and why it's needed. ## Related issues > Link related issues: "Fixes #1234", "Closes #1234", or "Related to #1234". ## Additional information > Optional: Add implementation details, API changes, usage examples, screenshots, etc. Signed-off-by: Ronny Roland <[email protected]> Co-authored-by: Ronny <[email protected]>
…ject#65343) ## Summary Regenerates `python/deplocks/ray-torch/ray-torch-cu128_base_py3.14.lock`, which has been failing `raydepsets --check` since 2026-08-05. ray-project#65114 added the file pinning `aiohttp==3.13.5`, but aiohttp 3.14.3 was published on 2026-07-23 — before that PR landed. A fresh `uv pip compile` therefore resolves 3.14.3, and `build: raydepsets: compile all dependencies` reports the committed lock as out of date: ``` --- python/deplocks/ray-torch/ray-torch-cu128_base_py3.14.lock +++ /tmp/.../python/deplocks/ray-torch/ray-torch-cu128_base_py3.14.lock @@ -13,127 +13,126 @@ -aiohttp==3.13.5 +aiohttp==3.14.3 ``` `aiohttp` is the only package that moves. The rest of the diff is its hash block, one line shorter — which matches the `@@ -13,127 +13,126 @@` hunk the checker produced. ## Why this went unnoticed for five days The check is gated on the `python_dependencies` tag (`.buildkite/dependencies.rayci.yml:22-27`), which a PR only earns by touching `python/deplocks/`, `ci/raydepsets/configs/` or `python/requirements*`. **1 of the last 40 premerge builds ran the step at all.** So almost nothing trips it, and the PRs that do inherit an unrelated red X, because the step runs `--all-configs` and checks every lock in the repo rather than the one the PR edited. Postmerge ignores tags, so it is also failing there — including on `releases/2.58.0` (postmerge build 19108), which puts it in the 2.58.0 release path. ## Testing Regenerated with the depset's own config rather than by hand, so the output is whatever the checker computes: ```bash bazelisk run //ci/raydepsets:raydepsets -- build \ ci/raydepsets/configs/ray_torch.depsets.yaml \ --name ray_torch_cu128_base_depset_314 ``` Then the full gate, exactly as CI runs it: ```bash bazelisk run //ci/raydepsets:raydepsets -- build --all-configs --check ``` - **Passes** (exit 0) with this change applied. - Only `python/deplocks/ray-torch/ray-torch-cu128_base_py3.14.lock` is modified — `git status` is otherwise clean after the full check, so no other lock has drifted and the fix is complete rather than the first of several. - Verified against master beforehand: the same command fails on `origin/master` with the diff quoted above. One note for anyone re-running this locally: `--all-configs` intermittently dies on `503 Service Unavailable` from `download.pytorch.org` while resolving the GPU configs (it hit `.../whl/cu128/jupyter-lsp/` on my first attempt). That's transient and unrelated — a retry passed. Worth distinguishing from a genuine lock mismatch, since both surface as exit 1. ## Not a duplicate No open PR touches this file. Checked the plausible candidates' file lists directly rather than by title: ray-project#65305 (depset config JSON schema validation), ray-project#65318 (wanda image rename), ray-project#65206 (dependabot bumping aiohttp in `ci/raydepsets/tests/test_data/`, a test fixture rather than a real deplock), ray-project#64885 (text_embedding release-test depset) — none of them modify `python/deplocks/ray-torch/`. `python/deplocks/ray-torch/` has exactly one commit in its history, ray-project#65114, which is the one that introduced the drift. No commit has touched any deplock since 2026-08-05. cc the author of ray-project#65114 for awareness, since this is their file. ## AI assistance Prepared with AI assistance (Claude Code). I have reviewed the change and can defend it: it is a mechanical regeneration, the diff is one package plus its hashes, and the verification above is the same command CI runs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Ronny Roland <[email protected]> Signed-off-by: 400Ping <[email protected]>
|
This pull request has been automatically marked as stale because it has not had You can always ask for help on our discussion forum or Ray's public slack channel. If you'd like to keep this open, just leave any comment, and the stale label will be removed. |
|
This pull request has been automatically closed because there has been no more activity in the 14 days Please feel free to reopen or open a new pull request if you'd still like this to be addressed. Again, you can always ask for help on our discussion forum or Ray's public slack channel. Thanks again for your contribution! |
…ject#65343) ## Summary Regenerates `python/deplocks/ray-torch/ray-torch-cu128_base_py3.14.lock`, which has been failing `raydepsets --check` since 2026-08-05. ray-project#65114 added the file pinning `aiohttp==3.13.5`, but aiohttp 3.14.3 was published on 2026-07-23 — before that PR landed. A fresh `uv pip compile` therefore resolves 3.14.3, and `build: raydepsets: compile all dependencies` reports the committed lock as out of date: ``` --- python/deplocks/ray-torch/ray-torch-cu128_base_py3.14.lock +++ /tmp/.../python/deplocks/ray-torch/ray-torch-cu128_base_py3.14.lock @@ -13,127 +13,126 @@ -aiohttp==3.13.5 +aiohttp==3.14.3 ``` `aiohttp` is the only package that moves. The rest of the diff is its hash block, one line shorter — which matches the `@@ -13,127 +13,126 @@` hunk the checker produced. ## Why this went unnoticed for five days The check is gated on the `python_dependencies` tag (`.buildkite/dependencies.rayci.yml:22-27`), which a PR only earns by touching `python/deplocks/`, `ci/raydepsets/configs/` or `python/requirements*`. **1 of the last 40 premerge builds ran the step at all.** So almost nothing trips it, and the PRs that do inherit an unrelated red X, because the step runs `--all-configs` and checks every lock in the repo rather than the one the PR edited. Postmerge ignores tags, so it is also failing there — including on `releases/2.58.0` (postmerge build 19108), which puts it in the 2.58.0 release path. ## Testing Regenerated with the depset's own config rather than by hand, so the output is whatever the checker computes: ```bash bazelisk run //ci/raydepsets:raydepsets -- build \ ci/raydepsets/configs/ray_torch.depsets.yaml \ --name ray_torch_cu128_base_depset_314 ``` Then the full gate, exactly as CI runs it: ```bash bazelisk run //ci/raydepsets:raydepsets -- build --all-configs --check ``` - **Passes** (exit 0) with this change applied. - Only `python/deplocks/ray-torch/ray-torch-cu128_base_py3.14.lock` is modified — `git status` is otherwise clean after the full check, so no other lock has drifted and the fix is complete rather than the first of several. - Verified against master beforehand: the same command fails on `origin/master` with the diff quoted above. One note for anyone re-running this locally: `--all-configs` intermittently dies on `503 Service Unavailable` from `download.pytorch.org` while resolving the GPU configs (it hit `.../whl/cu128/jupyter-lsp/` on my first attempt). That's transient and unrelated — a retry passed. Worth distinguishing from a genuine lock mismatch, since both surface as exit 1. ## Not a duplicate No open PR touches this file. Checked the plausible candidates' file lists directly rather than by title: ray-project#65305 (depset config JSON schema validation), ray-project#65318 (wanda image rename), ray-project#65206 (dependabot bumping aiohttp in `ci/raydepsets/tests/test_data/`, a test fixture rather than a real deplock), ray-project#64885 (text_embedding release-test depset) — none of them modify `python/deplocks/ray-torch/`. `python/deplocks/ray-torch/` has exactly one commit in its history, ray-project#65114, which is the one that introduced the drift. No commit has touched any deplock since 2026-08-05. cc the author of ray-project#65114 for awareness, since this is their file. ## AI assistance Prepared with AI assistance (Claude Code). I have reviewed the change and can defend it: it is a mechanical regeneration, the diff is one package plus its hashes, and the verification above is the same command CI runs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Ronny Roland <[email protected]>


Why are these changes needed?
raydepsets config parsing is currently schema-less: the
Depsetdataclass is a flat union of every field for all four operations, and_dict_to_depset()reads fields with.get()defaults. A typo'd or misplaced field (e.g.depsets:on acompiledepset, or a missingsource_depseton asubset) is silently ignored, or only fails later mid-uvrun.This PR adds
ci/raydepsets/depsets.schema.json— a JSON Schema with a per-operation definition for each ofcompile,expand,subset, andrelax— and validates every depset entry against its operation's schema at config load time.Field contracts encoded in the schema:
name,operation,outputoutputoptional)requirementspackagesconstraintssource_depsetdepsetsappend_flags/override_flags/include_setuptoolspre_hooks,build_arg_setsDetails:
operationdiscriminator and validates against it directly, so errors point at the exact field (e.g.'depsets' is a required property) instead of jsonschema's generic oneOf union error. Unknown operations keep the existingInvalid operation: ...error message.additionalProperties: falseper branch catches typos and fields that the operation silently ignores.# yaml-language-server: $schema=../depsets.schema.jsonmodeline, so editors provide autocomplete and inline validation from the same schema file.cli.py(references exist, subset ⊆ source) are unchanged; the schema covers field shape only.jsonschemais already pinned inrelease/requirements_py310.txt(the lock backingci_require), so no new dependency pins.This also surfaced one real config bug:
docbuild_depsetindocs.depsets.yamlisoperation: compilebut carried a silently-ignoreddepsets:key. This PR removes the stray key (no behavior change — the compiled lock is identical). If it was actually intended to beoperation: expandlike its siblingdoctest_depset, that's a lock-changing follow-up.Related issue number
N/A
Checks
git commit -s) in this PR.scripts/format.shto lint the changes in this PR. (pre-commit hooks ran on commit: ruff, black, buildifier, check-json all passed)ci/raydepsets/tests/test_workspace.pytests pass (8 new schema tests), 56/60test_cli.pypass locally — the 4 failures (uv version pin, pre-hook runfiles paths) reproduce identically on clean master outside Bazel. All 17 real configs inci/raydepsets/configs/load cleanly through the validator.🤖 Generated with Claude Code