Project

General

Profile

Actions

action #167395

open

QA - coordination #162890: [saga][epic] feature discoverability

coordination #162896: [epic] Job triggering on jobless openQA instances

Ensure only the tested revision of devel:openQA packages are submitted to openSUSE:Factory size:M

Added by okurz about 2 months ago. Updated 3 days ago.

Status:
Feedback
Priority:
Normal
Assignee:
Category:
Feature requests
Target version:
Start date:
2024-09-25
Due date:
2024-11-28 (Due in 9 days)
% Done:

0%

Estimated time:

Description

Motivation

A problem related to #166658 showed up in Tumbleweed openQA-in-openQA tests, reported in https://bugzilla.suse.com/show_bug.cgi?id=1230953 , but not devel:openQA based openQA-in-openQA tests in https://openqa.opensuse.org/group_overview/24. We conducted a deeper analysis in #167335 identifying a point for improvement:

The state of the OBS repository can change after tests were triggered/monitored. We should copy a specific revision, e.g. osc -r $rev co into devel:openQA:tested to make sure we only submit a version which we triggered tests for. However in that case it can still be that while openQA-in-openQA are running but have not yet installed packages that devel:openQA receives an update. This would become problematic if the revision we copied is actually faulty, the newer version picked up in tests ends up with passed tests but then we submit the faulty packages. We maybe need to combine copying a fixed revision with also disabling OBS services or build of packages until the pipeline completes.

Acceptance criteria

  • AC1: Given devel:openQA contains an os-autoinst package revision N When trigger+monitor+submit on jenkins.qa.suse.de is triggered Then revision N is submitted to openSUSE:Factory
  • AC2: Given devel:openQA contains an os-autoinst package revision N And trigger+monitor+submit on jenkins.qa.suse.de is triggered When a new pull request is merged in either https://github.com/os-autoinst/openQA/ or https://github.com/os-autoinst/os-autoinst/ And trigger+monitor+submit is still running Then trigger+monitor+submit does Not submit package revision N+1 And a new trigger+monitor+submit workflow is triggered for package revision N+1
  • AC3: Given devel:openQA contains an os-autoinst package revision N And trigger+monitor+submit on jenkins.qa.suse.de is triggered When a new pull request is merged in either https://github.com/os-autoinst/openQA/ or https://github.com/os-autoinst/os-autoinst/ And trigger+monitor+submit is still running Then still revision N is submitted to openSUSE:Factory

Suggestions

Further details

Alternatives to the idea mentioned in the motivation are

  1. When submitting, we need to make sure the OBS repository hasn't changed in the meantime to submit only what we have tested. This means we would not be able to submit anything if we frequently update the OBS repo.
  2. An alternative to avoid this would be to save the OBS repo upfront (e.g. make a branch) so we can later always submit the exact version we have tested.
  3. Disable the build or services while we are testing in our pipelines until we have copied into devel:openQA:tested
  4. Or https://en.opensuse.org/openSUSE:Build_Service_Tips_and_Tricks , "Disable build of packages", osc api -X POST "/source/PROJECT/PACKAGE?cmd=set_flag&flag=build&status=disable" # and later ...

Related issues 1 (0 open1 closed)

Copied from openQA Project - action #167335: Conduct "lessons learned" with Five Why analysis for GRU git cloning related errorsResolvedokurz2024-09-25

Actions
Actions #1

Updated by okurz about 2 months ago

  • Copied from action #167335: Conduct "lessons learned" with Five Why analysis for GRU git cloning related errors added
Actions #2

Updated by livdywan 26 days ago

  • Subject changed from Ensure only the tested revision of devel:openQA packages are submitted to openSUSE:Factory to Ensure only the tested revision of devel:openQA packages are submitted to openSUSE:Factory size:M
  • Description updated (diff)
  • Status changed from New to Workable
Actions #3

Updated by mkittler 19 days ago

  • Target version changed from Tools - Next to Ready
Actions #4

Updated by okurz 14 days ago

  • Parent task set to #162896
Actions #5

Updated by mkittler 5 days ago

  • Status changed from Workable to In Progress
  • Assignee set to mkittler
Actions #6

Updated by mkittler 5 days ago · Edited

We could do the following:

  1. Save the current revision of the set of packages (auto_submit_packages=${packages:-$($osc ls "$dst_project" | grep -v '\-test$')}) via e.g. osc log devel:openQA openQA | grep/sed/… in trigger-openqa_in_openqa like we already save job_post_response.
  2. Submit that revision via osc -r $rev co in os-autoinst-obs-auto-submit. We need to use the same approach for copying artifacts as in monitor-openQA_in_openQA-TW.

The problem with this is that the revision saved in 1. might not be the revision we have actually tested. Until the test is scheduled and reaches the point where packages are installed from OBS a new version might have been published on OBS.

It would probably make more sense if we do the following:

  1. Keep the triggering as-is.
  2. Upload the exact package versions that were installed during the test run.
  3. Download the log from 2. in scripts/os-autoinst-obs-auto-submit. For this we need to know the job IDs be we have it in job_post_response and just need to restore them like in monitor-openQA_in_openQA-TW.
  4. Check whether that version matches what we still have on OBS. If not, either skip the submission or try to figure out what revision had this version and submit that via osc -r $rev co.

Note that step 2 makes actually only sense for the scenarios that install packages from OBS. So within the set of jobs that we start only some jobs will contain the information about the package versions. This is presumably ok. Considering that there are multiple scenarios that install from OBS there can actually be the case when those tests did not all run on the same version of every package. Maybe we should then in step 4 simply reject the whole submission (will hopefully not happen very often).

Actions #7

Updated by openqa_review 5 days ago

  • Due date set to 2024-11-28

Setting due date based on mean cycle time of SUSE QE Tools

Actions #8

Updated by mkittler 4 days ago · Edited

We discussed that it would be better to look into the "branching" alternative (mentioned as 2nd suggestion in the ticket description).

So I invoked to create a "fixed" copy of some packages in our devel:openQA project under devel:openQA:testing¹:

osc linkpac --current --disable-build devel:openQA os-autoinst devel:openQA:testing
osc linkpac --current --disable-build devel:openQA openQA devel:openQA:testing

It looks like --disable-build simply sets the build flag in the config of the package to false. The publish flag is still true, though.

Unfortunately this kind of setup doesn't work. OBS says "Repository has been published" but https://download.opensuse.org/repositories/devel:/openQA:/testing/openSUSE_Tumbleweed has not been populated so far.

So also I tried:

osc branch --force --disable-build devel:openQA openQA devel:openQA:testing

But the repo is still not populated.

I guess I'll have to research how this can be done or ask for help. We could of course also download the repo manually and serve it via some HTTP server outside the scope of OBS.

EDIT: Asked on Slack: https://suse.slack.com/archives/C02BXKBMXNV/p1731605574673919


¹ Probably we should create and delete this project on the fly. The trigger script would delete it when not already there and otherwise abort. The monitoring/submission script would delete the project when done. This way the presence of the project would act as a flag to know whether testing/submissions are still pending (and be able to avoid triggering new tests/submissions if there is still one pending).

Actions #9

Updated by mkittler 4 days ago

It turns out that one needs to use osc release for this (thanks to @bmwiedemann pointing this out to me).

So the following does the trick:

for package in os-autoinst openQA; do osc release --target-project devel:openQA:testing --no-delay --target-repository=openSUSE_Tumbleweed -r openSUSE_Tumbleweed -a x86_64 devel:openQA "$package"; done

This command populated https://download.opensuse.org/repositories/devel:/openQA:/testing/openSUSE_Tumbleweed/x86_64/ with no delay (so I suppose --no-delay works as advertised).

Actions #10

Updated by mkittler 4 days ago

PR for being able to use the snapshot project in openQA-in-openQA tests: https://github.com/os-autoinst/os-autoinst-distri-openQA/pull/215

Actions #12

Updated by mkittler 3 days ago

  • Status changed from In Progress to Feedback
Actions

Also available in: Atom PDF