Skip to content
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

Avoid submitting packages to Factory that we haven't actually tested yet #352

Merged

Conversation

Martchus
Copy link
Contributor

The packages on devel:openQA might change while openQA-in-openQA tests are executing. So far we submit packages directly from devel:openQA after openQA-in-openQA have passed. This means we don't neccassarily submit the version of the packages we have actually tested.

With this change we "release" a snapshot of devel:openQA to the staging repository devel:openQA:testing when triggering tests and use that within openQA-in-openQA tests (see
os-autoinst/os-autoinst-distri-openQA#215). We then only submit from this staging repository when tests have passed. This way we only submit what we've tested despite changes on devel:openQA.

Packages in the staging repository are cleaned up when openQA-in-openQA tests fail or after packages have been submitted. This trigger script will only release a new version into the staging project if it has been cleaned up ensuring its contents stay the same while tests/submissions are pending.

This commit also adds the new script cleanup-obs-project. It conveniently deletes all packages in an OBS project without deleting the project itself. We might want to add it on Jenkins as post-failure action for monitoring and submissions to avoid leftovers. (It is also useful to test the deletion code on its own.)

Related ticket: https://progress.opensuse.org/issues/167395


I tested this locally by running the individual added/changed parts of the scripts. I tested whether the osc commands to what they are supposed to against the real OBS instance where the project https://build.opensuse.org/project/show/devel:openQA:testing already exists.

I haven't adjusted any pipelines on Jenkins yet. I suppose this is also not necessary. It might be nice invoke cleanup-obs-project as post-failure action on http://jenkins.qa.suse.de/job/monitor-openQA_in_openQA-TW/configure and http://jenkins.qa.suse.de/job/submit-openQA-TW-to-oS_Fctry/configure. One cannot configure post-failure actions explicitly but I suppose we can just append an || … in the shell script.

Copy link
Member

@baierjan baierjan left a comment

Choose a reason for hiding this comment

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

So if I get it correctly, we have one staging place (testing) which will be used by the oQA-in-oQA and if the tests pass, the packages will be "released" to the tested for the automated submission into Factory, otherwise it will be cleanup upon failure to make space for next (I guess Jenkins) run to copy the code from the devel repo to testing for the actual testing. If we manage to make multiple changes and there is still something in the staging, it will be hold for a moment and batched together in the next opportunity, right? And the current release process does not need any change, because we only changed the way how to get the packages into the "tested" space...

I do have one question inline, otherwise it looks good to me.

trigger-openqa_in_openqa Outdated Show resolved Hide resolved
@Martchus
Copy link
Contributor Author

Martchus commented Nov 15, 2024

So if I get it correctly, we have one staging place (testing) which will be used by the oQA-in-oQA and if the tests pass, the packages will be "released" to the tested for the automated submission into Factory,

Not exactly. devel:openQA will be "release" to devel:openQA:testing. Only then we run tests (using devel:openQA:testing). If tests pass, devel:openQA:testing will be copied to devel:openQA:tested. There we disable reliance on source services. Then we submit that to openSUSE:Factory.

I am quoting "release" here because this is how the osc command is called. What we are actually doing here is creating a snapshot for the sake of testing and creating a submit request if tests pass.

otherwise it will be cleanup upon failure to make space for next (I guess Jenkins) run

Yes, we're talking about hourly scheduled pipeline runs on Jenkins here.

If we manage to make multiple changes and there is still something in the staging, it will be hold for a moment and batched together in the next opportunity, right?

That will effectively happen. However, nothing is ever explicitly batched up. If there are still pending tests (or the submission itself is still pending) when Jenkins runs the next trigger job this trigger job will simply return early and do nothing. One hour later there will hopefully no pending tests/submissions anymore so we can trigger tests again (with all the changes that have been made meanwhile).

And the current release process does not need any change, because we only changed the way how to get the packages into the "tested" space...

Yes, there's no additional step involved (that needed to be configured in Jenkins).

@Martchus Martchus force-pushed the avoid-submitting-untested-packages branch from 40ef775 to 5372e66 Compare November 15, 2024 16:21
monitor-openqa_job Outdated Show resolved Hide resolved
@baierjan
Copy link
Member

Thank you for the explanation. Yes, we are on the same page here.

@Martchus Martchus force-pushed the avoid-submitting-untested-packages branch from 5372e66 to af3b461 Compare November 15, 2024 16:30
trigger-openqa_in_openqa Outdated Show resolved Hide resolved
The packages on `devel:openQA` might change while openQA-in-openQA tests
are executing. So far we submit packages directly from `devel:openQA`
after openQA-in-openQA have passed. This means we don't neccassarily submit
the version of the packages we have actually tested.

With this change we "release" a snapshot of `devel:openQA` to the staging
repository `devel:openQA:testing` when triggering tests and use that within
openQA-in-openQA tests (see
os-autoinst/os-autoinst-distri-openQA#215). We then
only submit from this staging repository when tests have passed. This way
we only submit what we've tested despite changes on `devel:openQA`.

Packages in the staging repository are cleaned up when openQA-in-openQA
tests fail or after packages have been submitted. This trigger script will
only release a new version into the staging project if it has been cleaned
up ensuring its contents stay the same while tests/submissions are pending.

This commit also adds the new script `cleanup-obs-project`. It conveniently
deletes all packages in an OBS project without deleting the project itself.
We might want to add it on Jenkins as post-failure action for monitoring
and submissions to avoid leftovers. (It is also useful to test the deletion
code on its own.)

Related ticket: https://progress.opensuse.org/issues/167395
@Martchus Martchus force-pushed the avoid-submitting-untested-packages branch from af3b461 to c92befb Compare November 15, 2024 16:41
@Martchus
Copy link
Contributor Author

I suppose it would be best if we merge this only after hackweek. There might be further changes required we'll only discover when it actually runs on Jenkins.

@mergify mergify bot merged commit f1c8c4b into os-autoinst:master Nov 26, 2024
4 checks passed
@Martchus Martchus deleted the avoid-submitting-untested-packages branch November 26, 2024 17:34
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.

4 participants