-
Notifications
You must be signed in to change notification settings - Fork 208
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
Extend variable expansion to consider variables from worker config #6047
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -193,28 +193,36 @@ by different means: | |||||
|
||||||
|
||||||
=== Variable expansion | ||||||
Any job setting can refer to another variable using this syntax: `%NAME%`. When | ||||||
the test job is created, the string will be substituted with the value of the | ||||||
specified variable at that time. | ||||||
|
||||||
Any variable defined in Test Suite, Machine, Product or Job Template table can | ||||||
refer to another variable using this syntax: `%NAME%`. When the test job is created, | ||||||
the string will be substituted with the value of the specified variable at that time. | ||||||
The variable expansion applies to job settings defined in test suites, machines, | ||||||
products and job templates. It also applies to job settings specified when | ||||||
creating a single set of jobs and to variables specified in the worker config. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure if this applies, if the above is added. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wanted to keep it short. Our documentation is long enough and the addition seems redundant. |
||||||
|
||||||
For example this variable defined for Test Suite: | ||||||
Consider this example where a variable is defined within a test suite: | ||||||
|
||||||
[source,sh] | ||||||
-------------------------------------------------------------------------------- | ||||||
PUBLISH_HDD_1 = %DISTRI%-%VERSION%-%ARCH%-%DESKTOP%.qcow2 | ||||||
-------------------------------------------------------------------------------- | ||||||
|
||||||
may be expanded to this job variable: | ||||||
It may expanded to this job setting: | ||||||
|
||||||
[source,sh] | ||||||
-------------------------------------------------------------------------------- | ||||||
PUBLISH_HDD_1 = opensuse-13.1-i586-kde.qcow2 | ||||||
-------------------------------------------------------------------------------- | ||||||
|
||||||
=== Variable precedence | ||||||
NOTE: Variables from the worker config are not considered if such a variable is | ||||||
also present in any of the other mentioned places. To give variable values from | ||||||
the worker config precedence, use double percentage signs. Expansions by the | ||||||
worker will *not* be shown in the "Settings" tab on the web UI. They are only | ||||||
present in `vars.json` and `worker-log.txt`. | ||||||
|
||||||
It's possible to define the same variable in multiple places that would all be | ||||||
=== Variable precedence | ||||||
It is possible to define the same variable in multiple places that would all be | ||||||
used for a single job - for instance, you may have a variable defined in both | ||||||
a test suite and a product that appear in the same job template. The precedence | ||||||
order for variables is as follows (from lowest to highest): | ||||||
|
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.
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.
I would go as far as to say that also protected values like
SECRET
or_PASSWORD
would also be a great case for https://progress.opensuse.org/issues/109019 and https://progress.opensuse.org/issues/105624but for now that's a random crazy idea
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.
I wouldn't make this so long and avoid generic expressions like "the string". However, maybe I'll incorporate some parts of it.