Commit ef4f98f
committed
fix(release-sweep): handle ts/node draft shape (.tgz + checksums)
The post-publish draft sweep used a single asset-count threshold
(`>= 10 = un-draft, else delete`), which made sense when the only
release shape was rust/go (9 binaries + checksums.txt = 10 assets).
After plugin-publish.yml started producing ts/node releases via
`npm pack` (commit c079171), a complete ts/node release has only
2 assets: `<binary_name>.tgz` + `checksums.txt`. The old threshold
would classify any such draft as `incomplete` and delete it + the
git tag — wiping a perfectly valid release.
Rewritten policy is shape-aware. We can't read plugin.yaml at sweep
time (the release page is the only signal), so the type is inferred
from the assets themselves:
- `checksums.txt` is required in both shapes (consumer-side SHA256
verify in the inject pre-flight depends on it).
- If any `*.tgz` is present → ts/node shape: complete = .tgz +
checksums.txt (≥ 2 assets).
- Else → rust/go shape: complete = 9 binary-named assets +
checksums.txt (≥ 10 total, ≥ 9 non-checksum).
- Anything else → incomplete, deleted + tag cleaned up.
Log line now records which shape was matched, plus the counts that
drove the decision, so investigations don't need to re-pull the
release.
This bug only surfaces once the ts/node publish path actually
generates drafts. Today's audited workflow never sets `--draft`,
so the in-flight failure mode is the same as before (no false
deletes today). But the sweep is the safety net for the day
something *does* leave a draft behind, and the safety net itself
should not silently destroy valid releases.1 parent 1550a3e commit ef4f98f
1 file changed
Lines changed: 49 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
766 | 766 | | |
767 | 767 | | |
768 | 768 | | |
769 | | - | |
770 | | - | |
771 | | - | |
772 | | - | |
773 | | - | |
774 | | - | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
775 | 795 | | |
776 | 796 | | |
777 | 797 | | |
| |||
798 | 818 | | |
799 | 819 | | |
800 | 820 | | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
805 | 843 | | |
806 | 844 | | |
807 | | - | |
| 845 | + | |
808 | 846 | | |
809 | 847 | | |
810 | 848 | | |
| |||
0 commit comments