Commit cb66ba5
committed
hostagent: unify requirement progress logging with (N/total) counter
Pre-compute the total number of requirement steps (essential + optional
+ guest-agent wait + final) and thread a shared counter through
waitForRequirements so each progress line is prefixed with (N/total).
Progress is emitted as a structured RequirementProgress event so the
limactl-side event watcher can render it two ways:
* TTY: each step occupies a single line that flips from 🕐 to
✅ in place when it completes.
* Non-TTY (piped output, log files, CI): two regular log lines per
step, matching the previous behaviour.
Built-in requirement descriptions are reworded so they read naturally
in the new form (e.g. systemd must be available -> systemd is
available). capitalizeFirst is kept so user-supplied probe descriptions
render uniformly with the built-in ones, and is rune-safe.
Fix replaying of RequirementProgress events: the progress field was kept
on currentStatus after emit, so every subsequent unrelated event
(port-forward, vsock, cloud-init) carried the previous RequirementProgress
along and the limactl-side renderer re-emitted the pending line
for each one. Clear the transient field from the cached status inside
emitEvent so only the event that explicitly carries it renders. Add a
defensive dedup in renderRequirementProgress keyed on step/total:done
so any future re-emit path cannot reintroduce the spam.
Reword the built-in descriptions back to the to be form
so the pending line reads as a goal, not a premature completion claim.
Closes: #4553
Signed-off-by: mn-ram <235066282+mn-ram@users.noreply.github.com>1 parent 943e2ef commit cb66ba5
4 files changed
Lines changed: 168 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
29 | 55 | | |
30 | 56 | | |
31 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
333 | 338 | | |
334 | 339 | | |
335 | 340 | | |
| |||
362 | 367 | | |
363 | 368 | | |
364 | 369 | | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
365 | 381 | | |
366 | 382 | | |
367 | 383 | | |
| |||
556 | 572 | | |
557 | 573 | | |
558 | 574 | | |
559 | | - | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
560 | 585 | | |
561 | 586 | | |
562 | 587 | | |
| |||
608 | 633 | | |
609 | 634 | | |
610 | 635 | | |
611 | | - | |
612 | 636 | | |
613 | 637 | | |
614 | 638 | | |
| |||
628 | 652 | | |
629 | 653 | | |
630 | 654 | | |
631 | | - | |
| 655 | + | |
632 | 656 | | |
633 | 657 | | |
634 | 658 | | |
635 | | - | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
636 | 665 | | |
637 | 666 | | |
638 | | - | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
639 | 673 | | |
640 | 674 | | |
641 | 675 | | |
642 | 676 | | |
643 | | - | |
| 677 | + | |
644 | 678 | | |
645 | 679 | | |
646 | 680 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
20 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
21 | 40 | | |
22 | 41 | | |
23 | 42 | | |
24 | 43 | | |
25 | 44 | | |
26 | 45 | | |
27 | | - | |
28 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
29 | 63 | | |
30 | 64 | | |
31 | 65 | | |
32 | 66 | | |
33 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
34 | 73 | | |
35 | 74 | | |
36 | 75 | | |
37 | 76 | | |
38 | | - | |
| 77 | + | |
39 | 78 | | |
40 | 79 | | |
41 | 80 | | |
42 | | - | |
| 81 | + | |
43 | 82 | | |
44 | 83 | | |
45 | 84 | | |
| |||
159 | 198 | | |
160 | 199 | | |
161 | 200 | | |
162 | | - | |
| 201 | + | |
163 | 202 | | |
164 | 203 | | |
165 | 204 | | |
| |||
170 | 209 | | |
171 | 210 | | |
172 | 211 | | |
173 | | - | |
| 212 | + | |
174 | 213 | | |
175 | 214 | | |
176 | 215 | | |
| |||
182 | 221 | | |
183 | 222 | | |
184 | 223 | | |
185 | | - | |
| 224 | + | |
186 | 225 | | |
187 | 226 | | |
188 | 227 | | |
| |||
209 | 248 | | |
210 | 249 | | |
211 | 250 | | |
212 | | - | |
| 251 | + | |
213 | 252 | | |
214 | 253 | | |
215 | 254 | | |
| |||
228 | 267 | | |
229 | 268 | | |
230 | 269 | | |
231 | | - | |
| 270 | + | |
232 | 271 | | |
233 | 272 | | |
234 | 273 | | |
| |||
275 | 314 | | |
276 | 315 | | |
277 | 316 | | |
278 | | - | |
| 317 | + | |
279 | 318 | | |
280 | 319 | | |
281 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
312 | 313 | | |
313 | 314 | | |
314 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
315 | 325 | | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
316 | 330 | | |
317 | 331 | | |
318 | 332 | | |
| |||
388 | 402 | | |
389 | 403 | | |
390 | 404 | | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
391 | 442 | | |
392 | 443 | | |
393 | 444 | | |
| |||
0 commit comments