Repository navigation
Commit 2b53cf9
committed
fix(release): resolve backport targets the way the freeze contract does
backport.yaml stopped resolving its target branches from
getLatestRelease in 6ff5b98: it now lists the repository's branches,
keeps release-X.Y, and takes the two newest by version. The audit still
reproduced the old rule, so it was correct only outside a freeze window
-- and a freeze window is the whole point, because release-X.Y is
created when the first vX.Y.0-rc.N is cut, potentially weeks before
vX.Y.0 publishes, and the frozen branch is the only way into that
release. At the next rc cut the audit would have started attributing
every kind/backport PR to the line behind the one it was written for:
false MISSING on the old line, and silence on the new one.
Carry both rules and pick by the PR's merge date. A single cutover is
faithful because both halves landed in the same push -- 53a7fc4 made
cutting an rc freeze the line, 6ff5b98 pointed the bot at the branch
list -- and before it a release branch was created at promote time, so
the newest branch and the newest published stable named the same line
and the two rules could not disagree.
The branch-push moment is read exactly rather than approximated, from
the committer date of the commit the first vX.Y.0-rc.N tag points at.
cut-prerelease.yaml creates the branch AT that commit, in the same job
and immediately after the tag push, and the stale-tip guard just above
that push refuses to proceed unless the commit is still main's tip. So
nothing merges to main in between: every PR merged after that commit
merged after the branch existed, and every PR merged before it merged
before. There is no window for the two to disagree. The rc release's
publishedAt could not offer that -- it lands hours later, once
tags.yaml has finished building.
Rank the live lines by version rather than by when they opened, which
is the sort backport.yaml applies to its own branch list. The two
orders come apart as soon as a freeze overlaps the previous line's
stabilisation, and version order is also what keeps release-1.10 above
release-1.9.
Verified two ways. Output is byte-identical over 98 verdicts across
release-1.6, release-1.5 and release-1.4, which is the expected result
rather than a weak one: no line has been frozen since the cutover, so
no verdict may move yet. Moving the cutover back so that v1.6.0-rc.1
counts as a freeze then shifts exactly the 12 PRs merged inside 1.6's
real freeze window from release-1.5 to release-1.6, and every one of
them lands in-branch there -- they merged to main before that branch
was cut, which is what the enumeration rule says and what the
published-stable rule missed.
main_test.go pins the rule itself and `make unit-tests` now runs it.
The mapping is stated in this repo but enforced by backport.yaml and
cut-prerelease.yaml, so a change there that is not mirrored here turns
a release gate silently permissive, which is the one failure mode a
gate must not have.
Assisted-By: Claude <[email protected]>
Signed-off-by: Myasnikov Daniil <[email protected]>1 parent 45523d7 commit 2b53cf9
5 files changed
Lines changed: 330 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
152 | 162 | | |
153 | 163 | | |
154 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
69 | 72 | | |
70 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
71 | 80 | | |
72 | 81 | | |
73 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
28 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
84 | 89 | | |
85 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
86 | 104 | | |
87 | 105 | | |
88 | 106 | | |
| |||
444 | 462 | | |
445 | 463 | | |
446 | 464 | | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
452 | 475 | | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
459 | 485 | | |
460 | 486 | | |
461 | 487 | | |
| |||
485 | 511 | | |
486 | 512 | | |
487 | 513 | | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
488 | 522 | | |
489 | 523 | | |
490 | 524 | | |
| |||
493 | 527 | | |
494 | 528 | | |
495 | 529 | | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
496 | 586 | | |
497 | 587 | | |
498 | 588 | | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
499 | 597 | | |
500 | 598 | | |
501 | 599 | | |
502 | 600 | | |
503 | 601 | | |
504 | 602 | | |
505 | 603 | | |
| 604 | + | |
506 | 605 | | |
507 | | - | |
| 606 | + | |
508 | 607 | | |
509 | | - | |
| 608 | + | |
510 | 609 | | |
511 | 610 | | |
512 | 611 | | |
| |||
0 commit comments