Skip to content

Conversation

rezib
Copy link
Collaborator

@rezib rezib commented Aug 1, 2025

The pull requests deprecates all vm_* and gerrit_* configuration parameters and introduces new vm and gerrit hashes to hold all related parameters.

2 parents commits are also included to:

  • fix a bug with required parameters validation when hashes are merged from multiple configuration files
  • introduce generic management of deprecated parameters and raise user warnings

@rezib rezib force-pushed the pr/conf-struct branch 2 times, most recently from 1adf462 to 1602dbc Compare August 1, 2025 09:14
@rezib rezib requested review from qa-cea and valeriyoann August 1, 2025 09:42
@rezib rezib requested a review from qa-cea August 25, 2025 08:06
tests/VM.py Outdated
'image': '/my_image',
}
)
print(self.config.get('vm'))
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: seems unnecessary

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My bad, fixed in 3aae0dd.

Instead of checking for required in params in sub dictionnaries at load
time, check them recursively after everything is loaded.

This change notably fixes bug in case required parameter in a sub
dictionnary is not defined in a configuration file but defined in
another file and in merged options eventually.
This is now possible to mark configuration parameters as deprecated, by
specifying the name of their replacement. Arbitrary levels of dict keys
can be specified in the name using dot separator (ex: hash1.hash2.key3).

A FutureWarning is emitted when deprecated parameter is loaded, to alert
user of the change and inform of the new parameter name.

When both the deprecated and replacement parameters are defined, the
deprecated parameter is ignored.

Unit tests are introduced to cover all cases of this feature.
Replace all vm_* parameters by the same parameters in vm dict (eg.
vm_image is becoming vm > image). All vm_* parameters are marked as
deprecated, ie. they are still supported but Rift emits warning visible
by end users to report the new parameter name.
Replace all gerrit_* parameters by the same parameters in gerrit dict
(eg. gerrit_realm is becoming gerrit > realm). All gerrit_* parameters
are marked as deprecated, ie. they are still supported but Rift emits
warning visible by end users to report the new parameter name.

Also add unit tests to cover Gerrit module.
@valeriyoann valeriyoann merged commit a8f35df into cea-hpc:master Sep 9, 2025
3 checks passed
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.

3 participants