Skip to content

Self-describing config#764

Open
languitar wants to merge 7 commits intomainfrom
feature/self-describing-config
Open

Self-describing config#764
languitar wants to merge 7 commits intomainfrom
feature/self-describing-config

Conversation

@languitar
Copy link
Owner

@languitar languitar commented Feb 15, 2026

Adds a new schema subcommand that prints something like a schema of the configuration file including all built-in (and functional due to optional dependencies) checks. This is intended to build configuration UIs based on the output.

@codecov
Copy link

codecov bot commented Feb 15, 2026

Codecov Report

❌ Patch coverage is 98.51852% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.89%. Comparing base (1a54610) to head (4e2d015).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/autosuspend/config.py 96.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #764      +/-   ##
==========================================
+ Coverage   95.63%   95.89%   +0.25%     
==========================================
  Files          20       21       +1     
  Lines        1353     1487     +134     
  Branches      120      129       +9     
==========================================
+ Hits         1294     1426     +132     
- Misses         45       46       +1     
- Partials       14       15       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@languitar languitar force-pushed the feature/self-describing-config branch 2 times, most recently from 72fb401 to 11e4164 Compare February 15, 2026 23:24
The new schema subcommand prints out a custom JSON format with all
options / checks that are built-in and can be configured in the
autosuspend configuration file. This is intended to be used graphical
configuration UIs for autosuspend. These can use the printed schema to
dynamically configure the UI without having to hard-code known checks.

I was unable to use established formats such as JSON schema due to the
way checks can be configured in the configuration. By default the
section header is the class name. As a special case, users can give a
custom name and provide the class manually. This doesn't map well to
JSON schema.
This completes the new schema subcommand so that all checks have
declared options.
This avoids having to redefine parameters.
This only makes the document longer with no benefit.
This avoids duplicate definitions of checks and parameters
Instead of including the internal class names in the schema and the
generated documentation, use the well-known names that used to exist
before and that are mandatory for the config mechanism to work.
Otherwise, the dynamic check documentation cannot be built.
@languitar languitar force-pushed the feature/self-describing-config branch from 11e4164 to 4e2d015 Compare February 15, 2026 23:30
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.

1 participant