image: match the final 100% qemu-img convert progress line #4347
Hi @amalsaidov. Thanks for your PR.
PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.
I understand the commands that are listed here.
<details>
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
</details>
Thanks!
/cc @akalenyu

coverage: 50.376%. remained the same — amalsaidov:fix-qemu-progress-100 into kubevirt:main
thanks! this is definitely correct but note the controller guard already drops 100 regardless https://github.com/kubevirt/containerized-data-importer/pull/3293 (third commit)
/approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: <a href="https://github.com/kubevirt/containerized-data-importer/pull/4347#pullrequestreview-5936259027" title="Approved">akalenyu</a>
The full list of commands accepted by this bot can be found here.
The pull request process is described here
<details >
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
</details>
<!-- META={"approvers":[]} -->
/retest
Thanks for merging 🙏
Acedus
amalsaidov
What this PR does / why we need it:
reportProgressparses the progress lines thatqemu-img convertwrites while converting an image, for example(45.34/100%), and feeds the percentage into theimport_progressmetric. The regexp used is:The integer part (
\d?\d) only allows one or two digits, so the very last lineqemu-imgemits,(100.00/100%), does not match. The metric therefore stops at the last sub-100 line that was seen and never reaches 100% once the conversion is actually done, which is misleading for anyone watching import progress.This widens the integer part to one to three digits (
\d{1,3}) so the terminal100.00line is parsed and the metric reaches 100% on completion. All previously matched lines keep matching.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
A unit test is added next to the existing
reportProgresscases that feeds(100.00/100%)and asserts the metric reaches 100. It fails before the regexp change and passes after.AI-assisted; directed, reviewed and tested by the author.
Release note:
``
release-note
``Fix import progress metric not reaching 100% for image format conversions