-
Notifications
You must be signed in to change notification settings - Fork 117
[feat] Introduce variable aliases #2647
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
Conversation
This practically extends on the field aliasing that we used to have and brings the same concept to variables. Users can now define a variable as an alias of another one. This is quite useful for transitional periods and deprecations when a variable is renamed. This commit also introduces implementation improvements on how variables are inherited.
victorusu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
teojgo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, I only have a question. Is the null string the default one when the alias is not loggable? I couldn't find where it comes from
The alias get their default value from their target. See the |
|
@jenkins-cscs retry all |
Ok, yeah it was difficult to find where the |
This practically extends on the field aliasing that we used to have and brings the same concept to variables. Users can now define a variable as an alias of another one. This is quite useful for transitional periods and deprecations when a variable is renamed. An aliased can be defined as follows:
The variable
ymay not have a default value, but it can be independently loggable. Any update of variablexwill be visible toyand vice versa. Aliased variables can refer also to inherited variables.This feature is useful for transitional periods when a variable is renamed and a deprecation is introduced and we want to keep both names for a while. The new variable can also be wrapped with
deprecate()to mark a deprecation. This allows us to introduces variable aliases and deprecations effortlessly.This commit also introduces implementation improvements on how variables are inherited. In particular, inherited variables are no more set redundantly as they are being inherited by classes lower in the hierarchy.