Skip to content

New config parser - #1481

Merged
prandla merged 2 commits into
cms-dev:mainfrom
e-i-o:config-refactor
Aug 4, 2025
Merged

New config parser#1481
prandla merged 2 commits into
cms-dev:mainfrom
e-i-o:config-refactor

Conversation

@prandla

@prandla prandla commented Jul 27, 2025

Copy link
Copy Markdown
Member

I wrote a custom parser that turns the output from tomllib into a strongly-typed dataclass-based config object. (This is basically the same as what pydantic does, but it's much smaller. We really don't need to bring in such a big dependency for this, as was pointed out by Martin.)

I also reorganized the config file format into sections, which are used in both CMS code and in the config file. This means the PR is quite huge though... The main things to review are the .sample.toml files, cms/conf.py, and cmscommon/conf_parser.py.

I also:

  • added all undocumented options into cms.sample.toml and cms_ranking.sample.toml
  • removed other_services from the config and replaced core_services with just services
  • removed the deprecated is_proxy_used option. People need to port their configs anyways, so they can replace the deprecated option with the new one.
  • removed the undocumented and unused timeout parameter from the RWS config.
  • removed the ability to set web_dir in RWS config. I can't see any reason why anyone would need to change that.

This is an even more substantial change than the json->toml one. I'd like to get this in before we release 1.6, to avoid people having to port their configs twice (or well, the ones who were using the git version need to do it twice anyways, but that's unavoidable).

Maybe we should also provide a script that auto-converts json to the new config format.

@veluca93 veluca93 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(but please don't merge until end of IOI ;-))

Comment thread cms/conf.py Outdated
Comment thread cms/conf.py Outdated
Comment thread config/cms.sample.toml Outdated
@prandla
prandla force-pushed the config-refactor branch 2 times, most recently from 2b1d576 to 47b2c2b Compare July 27, 2025 10:05
@prandla
prandla merged commit 800a0fc into cms-dev:main Aug 4, 2025
3 checks passed
@prandla
prandla deleted the config-refactor branch August 5, 2025 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants