action #180812
openopenQA Project (public) - coordination #180626: [saga][epic] Support switch to gitea for openSUSE/SUSE based products, e.g. SLE16
qem-bot+qem-dashboard reading from/writing to gitea instead of IBS
0%
Description
Motivation¶
As explained in the parent #180806 new maintenance workflows are planned based on Gitea. SMELT is planned to be adapted right now it is not yet there, see https://gitlab.suse.de/tools/smash/-/issues/1458.
https://gitlab.suse.de/tools/smelt/-/issues/1147, still the plan exists to have a first "dry run" of the SLE 16 maintenance workflow ready by 2025-07-08 as decided as part of #180602. As QE engineers so far rely on features like "approvable_for" comments we should find out if and how feasible an adaptation of qem-bot+qem-dashboard to such workflow is.
Acceptance criteria¶
- AC1: qem-bot+qem-dashboard is used to trigger+monitor+approve SLE 16 maintenance updates based on src.suse.de (can be separate instances)
Suggestions¶
Note that I highlighted open "TODOs" from previous spikes in bold. This doesn't mean we need to do them as long as ACs are fulfilled. I just want to highlight what next steps we should at least consider.
-
DONE: Await and incorporate results from spikes #180809 and #182591 and if we can rely on SMELT https://gitlab.suse.de/tools/smash/-/issues/1458- We clarified in a meeting that reading data from SMELT is not wanted. We should use Gitea directly.
- Results from #182591 have been incorporated into the subsequent suggestions.
- The following change for the dashboard has already been merged: https://github.com/openSUSE/qem-dashboard/pull/2482
- Subsequent suggestions refer to https://github.com/openSUSE/qem-bot/pull/195 as "draft PR" so check it out. It makes probably most sense to base further development on that PR.
- The draft PR adds fake responses in the "responses" directory which are used by dry runs and the extended test suite. The
--dry
flag will prevent modifications to the dashboard. The--fake-data
flag will prevent querying live data from Gitea. - Checkout #182591#note-15 for how the draft PR was/is tested and deployed.
- The draft PR adds fake responses in the "responses" directory which are used by dry runs and the extended test suite. The
- After #180809#note-14 and discussions on Slack and #182591#note-15 we established the following:
- qem-bot should check PRs on Gitea like this dummy PR using the Gitea API to list PRs and then do the subsequent actions for each PR.
- The draft PR already does this. It goes through all open PRs as there doesn't seem to exist an API parameter for server-side filtering of PRs by requested reviewer. The team
products/qam-openqa
e.g. on https://src.suse.de/products/SLFO/pulls/120 doesn't even show up in the immediate response from querying PRs. So the draft PR requests reviews for each and every open PR and only decides then whether it is relevant based on whether a review fromproducts/qam-openqa
is requested. This might also need tweaking to consider already approved PRs as such. (The approval will probably be done by a concrete user and not a team and so far the logic doesn't take that into account.)
- The draft PR already does this. It goes through all open PRs as there doesn't seem to exist an API parameter for server-side filtering of PRs by requested reviewer. The team
- So far the draft PR reads the relevant OBS projects from a comment of an OBS bot. However, the staging.config file and the PR number could also be used to determine the project on OBS instead of parsing "human readable" comments. (It is going to be
:SLES
instead of:SLES-15.99
as in the linked example which was from an old config.)- The staging project can be composed via
<StagingProject>:<PR>
. - The test productbuilds are in
<StagingProject>:<PR>:<QA.Name>
.- "IIRC you wanted to test only these (basically the binaries filtered by the list of packages which are delivered for the product)."
- Additional remarks by Adrian:
- The main project is also publishing, but these are the in filtered rpms.
- IIRC you wanted to have the filtered repos for each product in addition.
- Similar to what we had with channels before. Just that we organize it in subprojects now. This allows use to test current product source against it or even prepare changes in the product, eg. when a package split happened or packages got added which requires also an adaption in the produtcompose files.
- The staging project can be composed via
- The OBS-API http://api.suse.de/build/$PROJECT/_result can then be used to determine the build status and affected packages and archs.
- If the OBS build status looks good qem-bot can trigger tests.
- This is already done by the draft PR.
- The draft PR also introduces the flag
--allow-build-failures
because at this point I haven't found a PR with OBS project where all builds are successful and all repos are published. This also means the logic for determining whether the build results on OBS look good might still need further tweaking. - The draft PR just schedules dummy tests (see next open point). For these dummy tests I created meta-data you can find on #182591#note-15. It also contains a remark on the versioning I'm not sure about.
- The draft PR also introduces the flag
- How it knows what tests to trigger still needs clarification.
- We could reuse the existing meta-data approach as done by the draft PR.
- From OBS we know affected packages/archs so we could base the decision on that.
- "yes, that's the updateinfo file, that should be enough for us to know which packages are under test, we just need to parse the xml"
- This is already done by the draft PR.
- qem-bot can approve/reject a change by creating a review on the PR.
-
DONE: The draft PR already does this. However, so far I only used my own account and reviews therefore didn't show up with the correct user. One cannot just specify a user when making the API call. Hence I created a dedicated user and https://sd.suse.com/servicedesk/customer/portal/1/SD-189112 to give it the required permissions (according to https://confluence.suse.com/display/devops/How+to+request+IBS+access) which needs to be followed-up with.- For account credentials, see https://gitlab.suse.de/openqa/password/-/merge_requests/23. We just need to create a token with that account on https://src.suse.de/user/settings/applications and specify that via
--gitea-token
when invoking the bot.
- For account credentials, see https://gitlab.suse.de/openqa/password/-/merge_requests/23. We just need to create a token with that account on https://src.suse.de/user/settings/applications and specify that via
-
- We should try to keep features mentioned at the end of #180809#note-11 working.
- There will be "staging triggered tests" and "product increment triggered tests", see https://jira.suse.com/browse/MSQA-949. We need to figure out how those match with the current "incidents" and "aggregates". So this still needs clarification. So far the draft PR only cares about "incidents".
-
We could check whether the
updateinfo.xml.gz
file exists in the OBS repo and if not we can stop processing (probably we should still dismiss the pending review via https://src.suse.de/api/swagger#/repository/repoDismissPullReview so the PR is not stuck). (This idea came up in one of the meetings and hasn't been implemented in the draft PR.)
- qem-bot should check PRs on Gitea like this dummy PR using the Gitea API to list PRs and then do the subsequent actions for each PR.
Updated by okurz about 2 months ago
- Copied from action #180809: [spike][timeboxed:20h] qem-bot+qem-dashboard reading from/writing to gitea instead of smelt/IBS size:M added
Updated by okurz about 2 months ago
- Subject changed from qem-bot+qem-dashboard reading from/writing to gitea instead of smelt/IBS to qem-bot+qem-dashboard reading from/writing to gitea instead of IBS
- Description updated (diff)
- Status changed from New to Blocked
Blocking on #180809 and https://gitlab.suse.de/tools/smash/-/issues/1458
Updated by okurz about 2 months ago
- Target version changed from future to Tools - Next
This is now a blocking ticket for https://jira.suse.com/browse/MSQA-960
Updated by okurz 20 days ago
- Status changed from Workable to New
- Assignee deleted (
okurz)
ok, let's try without https://gitlab.suse.de/tools/smash/-/issues/1458 for now
Updated by okurz 12 days ago
- Related to action #182591: [spike][timeboxed:20h] qem-bot+qem-dashboard reading from/writing to gitea instead of smelt/IBS - take 2 size:M added
Updated by okurz 12 days ago
- Related to deleted (action #182591: [spike][timeboxed:20h] qem-bot+qem-dashboard reading from/writing to gitea instead of smelt/IBS - take 2 size:M)
Updated by okurz 12 days ago
- Blocked by action #182591: [spike][timeboxed:20h] qem-bot+qem-dashboard reading from/writing to gitea instead of smelt/IBS - take 2 size:M added
Updated by mkittler about 12 hours ago ยท Edited
I guess as next step it makes sense to bring what I have so far closer to production and see what's missing from there. So I created:
- A dashboard deployment: http://10.168.194.29:3000/
- A job group on OSD: https://openqa.suse.de/admin/job_templates/654 using a dedicated medium type (search for "Foo-Bar-Incidents" on https://openqa.suse.de/admin/products)
- Meta-data to use on GitLab pipelines: https://progress.opensuse.org/attachments/download/20567/slfo.yml
- Adjustments to pipelines so we can add pipeline schedules for Gitea: https://gitlab.suse.de/qa-maintenance/bot-ng/-/merge_requests/85
- I have already configured the Gitea token on https://gitlab.suse.de/groups/qa-maintenance/-/settings/ci_cd#ci-variables.
- A pipline schedule on my fork to test the
gitea-sync
comment against my dashboard deployment: https://gitlab.suse.de/mkittler/bot-ng/-/pipeline_schedules-
It doesn't work because I can't figure out how to make authentication against IBS work. I tried using the new user qam-openqa for this creating an SSH key pair. I added the private key on https://gitlab.suse.de/mkittler/bot-ng/-/settings/ci_cd#js-cicd-variables-settings and deployed the public key on https://idp-mfa.suse.de.For some reason it works now. Maybe it took some time for the key to be actually enrolled.
-