openQA icon indicating copy to clipboard operation
openQA copied to clipboard

Add verification run scheduler

Open ByteOtter opened this issue 1 year ago • 4 comments

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 the openqa.opensuse.org test they want to use it injects all information - like the PR number, base test ID, test modules to load, etc. - into a openqa-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 use openqa.opensuse.org or openqa.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 - The TEST parameter for the call

The 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.

ByteOtter avatar May 17 '24 14:05 ByteOtter

Following the discussion slack:

  • This could be integrated inside clone-custom-git-refspec directly. That’s more due to how we already work, and I fear introducing a new script might not be 100% the best idea, but its a start already
  • The handling of github tokens is a great adition!
  • on the spec file, perhaps once we figure out what to do, it could be aliased to openqa-verify-pr or a nice short name :D (because openqa-clone-custom-git-refspec is... well, a bit long

foursixnine avatar May 17 '24 14:05 foursixnine

Please capitalize the first letter of the commit message subject lines. It would also be much nicer if openqa-verify_pr was openqa-verify-pr. The formatting of the help text and general coding style is unfortunately not in-line with what we generally use in our scripts. I would at least add a set -e or perhaps even set -eux -o pipefail at the beginning.

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.

Martchus avatar May 21 '24 16:05 Martchus

Thanks for your feedback, I have changed the name and added the set -o pipefail line. Could you elaborate a bit on what you mean with "general coding style"? What do I need to do differently? Thanks :)

ByteOtter avatar May 22 '24 08:05 ByteOtter

This pull request is now in conflicts. Could you fix it? 🙏

mergify[bot] avatar Jun 10 '24 12:06 mergify[bot]

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 26 '25 03:04 stale[bot]