Skip to content

Conversation

foursixnine
Copy link
Member

@foursixnine foursixnine commented Oct 9, 2025

Ticket: https://progress.opensuse.org/issues/190158

This script is only a proof of concept based of what I understood of what openqabot does.

I basically started off from #468 for some boilerplate and ended up with this script. So aside from requiring GITEA_TOKEN as environment variable, it also requires osc credentials for the given build service api (--bs, defaults to api.opensuse.org)

To call it:

python3 manual-maintenance-tests-trigger.py --project products/PackageHub --branch leap-16.0 --pr-id 158

Which results in the following openqa-cli call:

openqa-cli schedule --host http://localhost:9526 PRIO=100 \
 CI_TARGET_URL=http://localhost:9526 \
 GITEA_REPO=products/PackageHub \
 GITEA_SHA=f95b1c7c0e005e5a9db095f430fdfbde147d9198797284e066a05e8aaf9f4af2 \
 GITEA_STATUSES_URL=https://src.opensuse.org/api/v1/repos/products/PackageHub/statuses/f95b1c7c0e005e5a9db095f430fdfbde147d9198797284e066a05e8aaf9f4af2 \
 GITEA_PR_URL=https://src.opensuse.org/products/PackageHub/pulls/158 \
 webhook_id=gitea:pr:158 \
 VERSION=16.0 \
 DISTRI=opensuse \
 FLAVOR=staged-updates \
 ARCH=x86_64 \
 BUILD=:158:chromium \
 INCIDENT_REPO=http://download.opensuse.org/repositories/openSUSE:/Backports:/SLE-16.0:/PullRequest:/158 \
 INCIDENT_PATCH=158 \
 IMPORT_GPG_KEYS=gpg-pubkey-b3fd7e48-5549fd0f \
 ZYPPER_ADD_REPO_PREFIX=staged-updates \
 INSTALL_PACKAGES=chromedriver chromedriver-debuginfo chromium chromium-debuginfo \
 VERIFY_PACKAGE_VERSIONS=chromedriver 141.0.7390.65-bp160.1.1 chromedriver-debuginfo 141.0.7390.65-bp160.1.1 chromium 141.0.7390.65-bp160.1.1 chromium-debuginfo 141.0.7390.65-bp160.1.1

This is mostly the flow for incident updates (or staged updates), I don't quite get yet how the aggregated updates are handled.

There's also a hardcoded architecture, but that shouldn't be a blocker at this stage, I tried this on my local openQA instance with the following job-group:

defaults:
  x86_64:
    machine: uefi-3G
    priority: 50
products:
  opensuse-staged-updates-x86_64:
    distri: opensuse
    flavor: staged-updates
    version: '16.0'
scenarios:
  x86_64:
    opensuse-staged-updates-x86_64:
      - gnome-agama

Machine and test settings were taken from openqa.opensuse.org

PR data can be passed with --pr-data tests/data/opensuse-maintenance/by-autogits_workflow_pr_bot-151-20251007-154142.json, there's a switch to store the pr data too.

@foursixnine foursixnine changed the title PoC: "Manual" triggering of maintenance tests PoC: triggering of maintenance tests for openSUSE Oct 15, 2025
Avoid multiple nested ifs, to the code more readable
This is mainly to avoid collisions later on
Build parameter was missing, so query would return all jobs for given parameters
from collections import namedtuple
import osc.core

USER_AGENT = "manual-trigger.py (https://github.com/os-autoinst/scripts)"
Copy link
Member

Choose a reason for hiding this comment

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

git-openqa-maintenance.py?

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.

2 participants