Skip to content

Fixed required settings not being enforced by the settings schema - #779

Merged
david-yz-liu merged 2 commits into
masterfrom
fix-settings-schema-required
Nov 7, 2026
Merged

david-yz-liu merged 2 commits into
masterfrom
fix-settings-schema-required

Conversation

@david-yz-liu

Copy link
Copy Markdown
Contributor

Proposed Changes

settings_schema.json is used to validate the server config each time it is loaded. It is meant to require the top-level settings workspace, redis_url, supervisor_url and workers, and user and queues on each worker. But both required lists were inside properties, which defines a setting named "required" rather than requiring anything. So {} and {"workers": [{}]} both passed validation, and jsonschema's own check_schema rejects the schema file.

In practice the top-level keys are always set by the bundled settings.yml. But a config file given by AUTOTESTER_CONFIG replaces the whole workers list, so a worker missing queues or user passed validation and then crashed with a KeyError in start_stop.py start (worker_data["queues"]) or in install.py/test runs (w["user"]). It now fails when the config is loaded, with an error naming the missing setting.

The configs in this repo (settings.yml, docker-config.yml, the test fixture) already satisfy the schema.

Change: moved both required lists out of properties to sit next to them.

Tests

  • Replaced the xfail test added in Added server test suite with full coverage, and Coveralls reporting #775 with tests that check_schema accepts the schema, that each required top-level and worker setting is enforced, and that loading a config whose worker has no queues raises a ValidationError. These fail without the fix and pass with it.
  • test_schema_requires_string_ai_tester_env_values and test_files_merged_in_priority_order validated incomplete configs that only passed because of this bug; they now use complete ones.

🤖 Generated with Claude Code

david-yz-liu and others added 2 commits November 7, 2026 14:53
settings_schema.json listed the required top-level and worker settings
inside "properties", which defines a setting named "required" instead of
requiring anything. A worker missing "user" or "queues" passed validation
and then crashed with a KeyError when the server started.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coveralls

coveralls commented Nov 7, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 42408392527

Coverage remained the same at 99.296%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 1136
Covered Lines: 1128
Line Coverage: 99.3%
Coverage Strength: 0.99 hits per line

💛 - Coveralls

@david-yz-liu
david-yz-liu merged commit 9b70367 into master Nov 7, 2026
15 checks passed
@david-yz-liu
david-yz-liu deleted the fix-settings-schema-required branch November 7, 2026 20:01
@david-yz-liu david-yz-liu added this to the v2.10.5 milestone Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants