livery.workshop._legs¶
livery.workshop._legs ¶
Plan a CI run's check legs and shard counts from the selected test items.
A check leg whose configured shard count is above one does not need all
of its configured shards when only a handful of test items are selected.
plan_legs runs in the workflow's opening legs job (via fm
ci.legs): for each platform leg it asks the proved record which suites
and test items are selected, reads the leg's item durations and balance
measures, and calls livery.workshop._shard.shards_for_selection to
choose 1 .. max_shards shards. It writes the planned shard counts to
plan/<run_id> (livery.workshop._shard.write_shard_plan) so the
gate job's fold validates the exact shards started for the run, and
emits the matrix JSON for fromJSON(needs.legs.outputs.matrix).
Functions:
| Name | Description |
|---|---|
plan_legs |
Compute the check matrix and planned shard counts per platform leg. |
plan_legs ¶
plan_legs(root: Path, *, point: str = 'gate', run: RunContext | None = None, output: Path | None = None, store: StateStore | None = None, record: bool = True) -> tuple[dict[str, Any], dict[str, int]]
Compute the check matrix and planned shard counts per platform leg.
Sizes each sharded platform leg to the shards its selected test items
need, writes the planned counts to plan/<run_id> when inside CI
(and record is true), prints one summary line per leg, and appends
matrix=<json> and skip_check=<bool> to output when given.
On a push to main, checks the hybrid proved-tree record first:
when HEAD's exact git tree was already proved green across every required
leg (for example on an up-to-date pull request that just merged), promotes
the branch's proved rows and extension parts to main, records the
verified tree on plan/<run_id>, and emits skip_check=true.
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
|
dict[str, int]
|
platform leg label ( |
Source code in packages/workshop/src/livery/workshop/_legs.py
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 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 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 | |