-
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
Add verification run scheduler #5647
base: master
Are you sure you want to change the base?
Add verification run scheduler #5647
Conversation
Following the discussion slack:
|
4d0130e
to
23b2be0
Compare
script/openqa-verify_pr
Outdated
elif [ "$source" = "suse" ]; then | ||
echo "Dispatching verification run for suse..." | ||
openqa-clonse-custom-git-refspec "https://github.com/os-autoinst-distri-opensuse/pull/$pr_id" \ | ||
"https://openqa.suse.de/tests/$test_id" \ |
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 wonder, are you aware of the existing support for job URL's within the PR description? See https://github.com/os-autoinst/openQA/blob/master/script/openqa-clone-custom-git-refspec#L52
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 actually wasn't aware of this, thanks for making me aware. That'd make integrating parts of the ideas into openqa-clone-custom-git-refspec
even more alluring to take advantage of this feature. @foursixnine, what do you think?
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'd like to mention that we came to the conclusion that it is better to avoid the @
-syntax as one probably don't want to mention the @openqa
organization on GitHub here. Of course this makes the mentioned feature of the refspec script less interesting - unless one would change it.
However, I suggest to use https://github.com/os-autoinst/scripts/blob/master/openqa-clone-and-monitor-job-from-pr instead (which is already setup for the openSUSE test distribution and uses the openqa: Clone …
syntax). It will soon also support creating clones by creating/editing comments but it is so far limited to the PR description.
(You can also read https://open.qa/docs/#_create_and_monitor_openqa_jobs_from_within_the_ci_runner for more information on the broader topic.)
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 actually wasn't aware of this, thanks for making me aware. That'd make integrating parts of the ideas into
openqa-clone-custom-git-refspec
even more alluring to take advantage of this feature. @foursixnine, what do you think?
Yep its the first point here: #5647 (comment)
I wonder, are you aware of the existing support for job URL's within the PR description?
the extract URLs from description sounds nice, but only useful if it would edit the description and add the badges; I'd say lets keep that out of scope :)
support custom domains of openqa instances. Configurable in the config file.
Please capitalize the first letter of the commit message subject lines. It would also be much nicer if Note that additional scripts could also be added to https://github.com/os-autoinst/scripts - although if it is supposed to be distributed via an RPM package keeping it here might be the better option. |
Thanks for your feedback, I have changed the name and added the |
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.
Generally we use a more compact coding style. I gave a few concrete suggestions in inline-comments.
01deb94
to
b7737ac
Compare
d26812f
to
dbac7fb
Compare
Co-authored-by: Santiago Zarate <[email protected]>
echo "Dispatching verification run for opensuse..." | ||
openqa-clone-custom-git-refspec "https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/$pr_id" \ | ||
"https://openqa.opensuse.org/tests/$test_id" \ | ||
SCHEDULE="tests/installation/bootloader_start,tests/boot/boot_to_desktop,$modules" \ |
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.
Remember to move this to the openqa-clone-custom-git-refspec behind a switch i.e --modules a,b,c
so it gets appended via the for loop, before calling cone job.
and then there's the consideration that if the caller is passing:
- YAML_SCHEDULE + SCHEDULE, die (as one of them has to be overwritten.
- if the switch is passed, and so is either (yaml_schedule or schedule) die, as options aren't compatible
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.
Yep, currently looking into that :)
@@ -157,6 +182,12 @@ Please try 'curl $json_url' or select another job, e.g. in the same scenario: $h | |||
local scriptdir | |||
scriptdir=$(dirname "${BASH_SOURCE[0]}") | |||
local cmd="$dry_run $scriptdir/openqa-clone-job $clone_args \"$host\" \"$job\" _GROUP=\"$GROUP\" TEST+=\"$test_suffix\" BUILD=\"$build\" CASEDIR=\"$casedir\" PRODUCTDIR=\"$productdir\" NEEDLES_DIR=\"$needles_dir\"" | |||
if [[ $cmd =~ (SCHEDULE|YAML_SCHEDULE) ]]; then |
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.
is this an and? or an or?
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.
it's an or, my bad. Though changing it to
if [[ $cmd =~ SCHEDULE ]] && [[ $cmd =~ YAML_SCHEDULE ]]; then
...
doesnt seem to change anythin rn so my problem may be that I am using cmd
?
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.
As suggested in chat originally I appreciate that you try to bring in new ideas with pull requests but we should be careful about introducing new scripts. And the same probably goes for the modules command line parameter which is redundant considering the support for generic openQA test variables. Before investing more effort into that I recommend you look into this variables concept in general. Maybe for now you want to focus only on the aspect of reading the github token from a config file which seems independent of the other changes
This pull request is now in conflicts. Could you fix it? 🙏 |
What?
Add a script which wraps the standard use cases for
openqa-clone-custom-git-refspec
into a more usable form. Instead of requiring the user to type out the URLs of theopenqa.opensuse.org
test they want to use it injects all information - like the PR number, base test ID, test modules to load, etc. - into aopenqa-clone-custom-git-refspec
call.This script itself does not implement new functionality or behaviour, but is simply a different "front-end" - with a more descriptive name - to use for quickly scheduling verification runs for PRs against e.g
os-autoinst
.This is just a thought experiment and could theoretically be integrated into other components without the need for a separate script.
How?
Several parameters are mandatory for the script to function:
$SOURCE
- Which specifies whether to useopenqa.opensuse.org
oropenqa.suse.de
(with custom targets potentially supported via config file)$PR_ID
- The ID the GitHub PR$BASE_TEST_ID
- The ID of the test the user wants to use as a base$[test/module,...]
- A comma sperated list of test modules to load$TEST_NAME
- TheTEST
parameter for the callThe GitHub access token is provided via a config file at
~/.config/gh.conf
(name temporary).Why?
This PR aims to lower the barrier of entry for new contributors and make general test writing easier by having a easy-to-use, descriptively named script a user can call to provide a run for their PR. Instead of going around trying to find the right command.