Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add default config logic #1835

Merged
merged 21 commits into from
Aug 6, 2024

Conversation

MichaelsJP
Copy link
Member

This adds a streamlined and well-tested config structure with clear default classes and a tested config hierarchy settings management.

We have the following hierarchy objects:

  • Profile settings: What the user sets under profile_name in the profiles list.
  • Global profile defaults: What the user sets under profile_defaults.
  • System profile defaults: Settings that are hardcoded and special for a specific profile. E.g. Wheelchair has a different snapping radius defined.
  • System global profile defaults: Settings that are hardcoded defaults for the profile_default section.

The hierarchy is implemented as followed:

  • Per profile settings always have the highest precedence and overwrite: User global profile defaults, System profile defaults, System global profile defaults.
  • User set Global profile defaults have the next precedence and overwrite: System profile defaults, System global profile defaults.

If something is not set by the user at all, the internal logic is as followed:

  • System profile defaults are very rare and overwrite System global profile defaults.
  • System global profile defaults have the least precedence and set only what has not been set either by the user or as a System profile default.

These functions are used for a variety of tasks mainly around deep copy and deep comparisons of arbitrary objects.
This covers all possible and supported variants of the parameters.
This introduces proper default structures for all different config parts. For settings where a profile makes a difference some switch case are implemented for that logic.
This covers all possible and supported variants of the parameter.
@MichaelsJP MichaelsJP self-assigned this Aug 2, 2024
@MichaelsJP MichaelsJP marked this pull request as draft August 2, 2024 12:33
This functionality is anyway shared the same way by all the subclasses.
This fixes some access errors resulting from the merge and adds an initializer to finalize the config once read. Additionally, some tests have been introduced.
This is necessary since most of the code still just uses toString to use the variable. Not a good idea in the first place to work with string variables. But heyho. Let's change that. This behaviour was causing the traffic tests to fail.
This is in case the ors-config.yml doesn't have it.
The folder content changed. Adapting the count entries.
@takb takb marked this pull request as ready for review August 6, 2024 09:59
@takb takb merged commit d608792 into feat/config-wrapup Aug 6, 2024
19 of 40 checks passed
@takb takb deleted the feat/introduce-default-config-behavior branch August 6, 2024 09:59
@github-actions github-actions bot removed the feature label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Awaiting release
Development

Successfully merging this pull request may close these issues.

2 participants