Skip to content

Conversation

d3flex
Copy link

@d3flex d3flex commented Oct 6, 2025

Automate the livepatch isos posts. Due to the logic of the script generation this commit contains an injection of a for loop for all the livepatches which will be found in the spdx.json, after the sync in the server.

  • the loop always run even if no livepatches found. However it will only append to the isos posts the variable in the case that actually livepatch versions inclue in the array. The approach is just a bit dirty, as any other approach would require further and bigger changes.
  • The injection is in the rsync_iso after all the necessary variables are set and before the beginning writing to the print_openqa.sh. At that point the spdx.json should be available and it needs only to grep for the kernel_livepatch in the server. Before that point, the scriptgen.py would have to make a request to each repo in the dist.s.d and it is likely it would be less flexible as the logic of the isos post is mainly in the generated print_openqa.sh.

depends-on: https://gitlab.suse.de/openqa/openqa-trigger-from-ibs-plugin/-/merge_requests/263
issue: https://progress.opensuse.org/issues/190134

@d3flex d3flex added the do not merge Proposed changes that require further discussion label Oct 6, 2025
@d3flex
Copy link
Author

d3flex commented Oct 6, 2025

need testing on obs. as is for now, it breaks the print_openqa.sh for t/obs

@mdoucha
Copy link

mdoucha commented Oct 6, 2025

This approach will schedule tests for livepatch packages which haven't been updated in the product increment.

@d3flex d3flex force-pushed the try/investigate_possible_issue branch from d01fe01 to c995f33 Compare October 6, 2025 14:55
@Martchus
Copy link
Contributor

Martchus commented Oct 7, 2025

Can you update the ticket reference?

The use of NONE seems also needlessly complicated. Why not just use an empty array?

@d3flex d3flex force-pushed the try/investigate_possible_issue branch from c995f33 to 2a3ce59 Compare October 7, 2025 11:54
@d3flex
Copy link
Author

d3flex commented Oct 7, 2025

Can you update the ticket reference?

The use of NONE seems also needlessly complicated. Why not just use an empty array?

this will make the for runs once, netherless if the grep return something or not. That was to avoid bigger changes with if else and duplication as there are different pieces in different fuctions which construct the final script.

@d3flex
Copy link
Author

d3flex commented Oct 7, 2025

This approach will schedule tests for livepatch packages which haven't been updated in the product increment.

In the ticket, you said that This is the product increment repository with new packages to test + everything already released (in SCC): https://download.suse.de/ibs/SUSE:/ALP:/Products:/Marble:/6.0:/ToTest/product/repo/SL-Micro-6.0-x86_64/.
The obs-sync already syncs this repo with openQA https://openqa.suse.de/admin/obs_rsync/SUSE:ALP:Products:Marble:6.0:ToTest/runs/.run_last/download/rsync_iso.cmd

What am I missing?

@mdoucha
Copy link

mdoucha commented Oct 7, 2025

Can you update the ticket reference?
The use of NONE seems also needlessly complicated. Why not just use an empty array?

this will make the for runs once, netherless if the grep return something or not. That was to avoid bigger changes with if else and duplication as there are different pieces in different fuctions which construct the final script.

The base isos post command has to run once every time, even when there are livepatches. Also, you schedule all livepatch isos post with the same default BUILD value. You need to add the kernel version and flavor to BUILD.

This approach will schedule tests for livepatch packages which haven't been updated in the product increment.

In the ticket, you said that This is the product increment repository with new packages to test + everything already released (in SCC): https://download.suse.de/ibs/SUSE:/ALP:/Products:/Marble:/6.0:/ToTest/product/repo/SL-Micro-6.0-x86_64/. The obs-sync already syncs this repo with openQA https://openqa.suse.de/admin/obs_rsync/SUSE:ALP:Products:Marble:6.0:ToTest/runs/.run_last/download/rsync_iso.cmd

What am I missing?

You're missing that the repo contains everything that was already released. We don't want to test everything, we want to test only the packages that are new since the last product increment.

Automate the livepatch isos posts. Due to the logic of the script generation
this commit contains an injection of a for loop for all the livepatches which
will be scrapped from test repository.

- the loop always run even if no livepatches found. However it will only
append to the isos posts the variable in the case that actually livepatch
versions inclue in the array. The approach is just a bit dirty, as any other
approach would require further and bigger changes.

depends-on: https://gitlab.suse.de/openqa/openqa-trigger-from-ibs-plugin/-/merge_requests/263
issue: https://progress.opensuse.org/issues/190134
Signed-off-by: Ioannis Bonatakis <[email protected]>
@d3flex d3flex force-pushed the try/investigate_possible_issue branch from 2a3ce59 to f3db332 Compare October 10, 2025 07:10
Copy link
Contributor

@Martchus Martchus left a comment

Choose a reason for hiding this comment

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

I guess the idea isn't that bad in general. I guess it'll only ever return the latest livepatch, though (unless I'm misreading the code). It would maybe make more sense to return all livepatches that are newer than the creation date of the increment (as an increment can probably contain multiple livepatches and we want all of them and not just the latest).

def openqa_fetch_livepatch_list():
kpatches = {}
for arch in ['x86_64','aarch64','s390x','ppc64le']:
totest_url = f"https://download.suse.de/ibs/SUSE:/ALP:/Products:/Marble:/6.0:/ToTest/product/repo/SL-Micro-6.0-{arch}/{arch}/"
Copy link
Contributor

Choose a reason for hiding this comment

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

You can append ?jsontable to that URL and parse the JSON (instead of having to parse HTML with BeautifulSoup).


# def pre_openqa_call_find_kernel_livepatch_versions():
# return f"($(grep -oP '(?<=kernel-livepatch-)\d+_\d+_\d+-\d+' \"/var/lib/openqa/factory/iso/${{iso}}\" | uniq))"
def _find_latest_livepatches(url):
Copy link
Contributor

Choose a reason for hiding this comment

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

It would probably make sense to be able to execute this standalone (in the absence of unit tests, so it can at least be tested easily manually).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Proposed changes that require further discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants