fix(zdeploy): deploy edge first for any project list, not just 'all' (#46)

Closes #45.

'zdeploy evo edge' deployed evo first, then edge. The edge-first sort was
nested inside the 'all' branch, so an explicit list walked in whatever order
was typed.

That ordering is a correctness property, not a convenience of 'all': the proxy
has to route before the apps behind it ship, or there is a window where a new
app is live behind stale routing. 'zdeploy evo edge' reads as 'these two, edge
included' and quietly did the risky order.

Hoisted the sort out of the branch so it applies however the list was produced.
Order within each group is preserved, so an intentional sequence still holds -
and when the order does change, it now says so rather than reordering silently.

Verified across six shapes: evo+edge reorders and reports it; edge+evo is left
alone with no note; edge last in a longer list moves to front keeping the rest
in order; single project and no-edge lists are untouched.
This commit is contained in:
Kelly Michels 2026-08-12 15:45:51 -05:00 committed by GitHub
parent 976eb6d95e
commit 6c03138a2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 60 additions and 47 deletions

View File

@ -1,42 +1,42 @@
90e4105107d27a44ee7199e459f86941013d5e29d2a7a53882d48347e05b1530 setup_backup_schedule.ps1 695a3d072577fd507a42105f2cf1f69ae63229c6e8584c349196d8ea69d0b45c setup_backup_schedule.ps1
00ea2054ca36dd84133aaaa381437d39374407b1fcd33caecbdea09b4967247f token-count.ps1 1ba9a46e46f340ca39aec96394e4af892a9185336468f1201549df438e2e3816 token-count.ps1
4903f0194fe749269bb61ffacace6e957ce44503522d625560dcc882b69f91b4 zbackup.cmd 0df9f27995f32f4e071a62de7169e9c352823cd95ffd301f3480b2065dc510b6 zbackup.cmd
7d8446fc5f04ec1d0f695b6390db5bbfb86f410f6d8aac14720fd3aa4bfa3525 zbackup.ps1 d68d494f1756bcff823e9f9f85f4b3892de95e8826550889f4e4e9b2853263c8 zbackup.ps1
8b375c8a759e37b812293ae168dcf19ae1ca0c136c9d3f2d7ae90a84c1e26f3f zbackup_and_sync.ps1 4269347438722487104d97258ca1fef783a90050741ef0cdd10f1ffcf18c883d zbackup_and_sync.ps1
c336a61cb8563736bd6550671d7dc90b14702a43f25a97b1ac15ffd64605fbf6 zbackup_ec2.cmd 4c702b68330d6197286706d60f04e20c2a7672a94b0c8bf75d53bd44d622ab79 zbackup_ec2.cmd
47ccde67ba8502997105c995e509c1ed1016ffac264df60c6ac539a5b99eda08 zbackup_ec2.ps1 5f921544837926d75ee2f8dd440b8f631a8a9df22c3ac982441182be22a23144 zbackup_ec2.ps1
20e6282901a919aa32ea717c739ba2dc9657426dff860f0e5fce201edefd99da zchecksums.cmd 777d6a5f57772836c7032326ccc7c369f3c983e9e465b4fff6f15746e4637ff3 zchecksums.cmd
692b7b0ff9e51e5d9b880358b33c54d2db4f967297a5350e154df1ce6f06ebc6 zchecksums.ps1 07d4c97f246ac0a8b9fd69968b811043c79e5f707f1e6be92f461970a1c9dc48 zchecksums.ps1
b56085112e7c573926a70a58872163b71416d58ce91ea7114b1f5de5fc96c982 zdeploy.cmd c42984e436d4dd9640e58f881dd0e35ed003fc68aa9536645eff0d1681f85ca9 zdeploy.cmd
6005d581c1f86cfcaaf74b8b39205d247c0d9ed44c5f113aaa3282fd17161199 zdeploy.ps1 ca8370ab912aaeb9c2792230dab5f051d162a858e88994d0443c937ebb43c333 zdeploy.ps1
fa817d3bd7bba98b03b411d3c5a82b210d3cca316ac0c9785afa5b4ac5fe0766 zec2.cmd 4a870c529a6309ff4669b0107b50a82a0705fc8ad47588854778dccd14384702 zec2.cmd
5f70432af23df3459a98d9ad6a0da723783f2269dd5f5ab8ecdd6366ebc84942 zec2.ps1 7e92b43010189a8a892675b13fd824a66ffc33df7c85628c732501db883648d6 zec2.ps1
4df94eda29b6f5b2cb6bfa63e0add4d90ea24d936305f36a69988e8dd5d69154 zec2_rotatekeys.cmd 2e1fe6f07fe4e80dd4ab1c510a6d6106d0505a3514d4afaec8830080c50161de zec2_rotatekeys.cmd
cc980bec4a9205a774c05ee1a7e0473e604adf5370b548015a5cb47412dd5853 zec2_rotatekeys.ps1 6820a0c18f355fe48ebf765a8c14879a0fed2d711105f7aa162fa3b9bae3f9d5 zec2_rotatekeys.ps1
fae88c3d77efaef1a60d8d74bd0ca880ca67f85a2ab302fd182dfeb33e9465ce zec2online.cmd 1564b52f4740983ac25e0e986e96179938e8002c946002ef64f3511235fa8db7 zec2online.cmd
daf58f09cf118128c69282d51bbcece71cdeb1ce423737f6583ed00be460d98f zec2online.ps1 1256e04613b6cf3f98abe2a3a7015f888165c4e990e7045419313b5a3117d207 zec2online.ps1
6a48be6f36f7f979c9fbdd996a6526f71978beb37913d3e45c74fecbe94098ee ZHelpers.ps1 a4fd41c8a7e80d537cf25d162b32d66ea0900bd662308b5e10306ee8fddb7e7c ZHelpers.ps1
bace82f5efc0cf63f260ccd5e134032029b70fe633900d3a6345f7eb079c121e zkill.cmd 2c9497191e6e9642460390305adffdfd8d6e8f0d893ff304b7ef44b473220bd6 zkill.cmd
443af456a5ababda04d882abf28f18079473708a90249c7294d03f8120db60f6 zkill.ps1 9b8cc17570fbd194a83c251652c383908ca844204b3bf33ec892c2caf7b7c942 zkill.ps1
0e95bebabe8e56894c19519b38f57544bfb6903a3fe2f093fb7bf592c68b86da ZKiller.ps1 d6d75ae2c672d89eae965e6fcc8dfdfba5d9bb77c159bbae27e7203a04c8f359 ZKiller.ps1
957784b0261010baec0966319fddf887171b7835770cd0d4f55fb0c58ee70db2 ZKillOnly.ps1 45e2125c9a377782aa922e64f17c7d582ed53b027e6fcf4c3f10902ed789b1c4 ZKillOnly.ps1
70330253df23a140ca4c87a10107eb6dde86fa66292de6a56cda300889b8f329 zrelease.cmd 2668ac089377d60e986af7b858c72a35ff821b4ff8745c2290dd2b125447b98f zrelease.cmd
e29782135c4ca25eeff9655751a80fecda6c8fa8031a478a263ececb29a14937 zrelease.ps1 8e6dee66f730c58a08c3b39d5a4d0e936c388d9e796f64b75fff07650dc9e760 zrelease.ps1
8031864bc4ad92e1fc23a6f9ff1886e2b54bde5cda48658f3e4b60b90846937e zrepair.cmd 2ba1f8a45238c72e0c32acff55e7cc970b4d8630d5cd0bc9d17e4310baff2528 zrepair.cmd
51ca23196efefa8482a8be88f66239830dbce9e1dcabb98e7c5edf493dc30a2e zrepair.ps1 6ebee7ca33951d8766b088efdb309858b182f2f8a63cbadc85ec614ac65f886c zrepair.ps1
b45c4ce12cb0d907cb2bb53a6fb1b4a0e0cfd61d8cc54f14a1badc73a953befb zrestart.cmd 02e39c445c2b899c3e5500cc4173ed0f8fc940c32a7786aa00c594d619df220b zrestart.cmd
2cb349166a8cc93353fec4b59bbe4b3d9acb10597a06ae6f7317ebd5287a17b1 zrestart.ps1 9397beea1429431e56bc0acdb8782bea77e37c32a1d5621c3ba36b4c2ce869b5 zrestart.ps1
7e760b07cbcc0599afc7cbf2a45a05818300e6c1a96c1df7ce835f6d502e080e zrestartd.cmd 93e3bce6a275cc964d896ee17c0a21ff77872b6e4b5c7e5d89934d931bb43bb5 zrestartd.cmd
f4808922ba1529a50d0f6b69fa1b73c02edbeeba48bd4bb2ada7790d220413d6 zsetup.cmd dc90f5f7a5a04c43ffdffdfda2fa18f51e80c4f5a200f269cb52b45dded667ca zsetup.cmd
f669146bd46a3bebeb66b1cde8ed451557e7528282e4d7f5a04563a23572179f zsetup.ps1 55e3727224705a095773036949bce4789b966db9d67593efb6cb13b28b9d9bad zsetup.ps1
634a9376513846ba2ee3635afdf515d68626e0144e731d045cbfd7ea60018923 zsetup_mail.ps1 52fa5cf6b77e2159059bbbe687814c9a6c2a276d9117f6ce6de47e016f04d9d6 zsetup_mail.ps1
85f3301616f7409720e4eeb3f3f4e367f0bb1d336fe13123b9ce6674361a6251 zstart.cmd 26d08fc0d24a31aeb8b6f0e4d34d4948918b818f0e33934382cb67194bcb3acc zstart.cmd
2e353bee9e7bf78d39c32b98b3375eebff89d5b9c2313fa05b3ff3161e836b91 zstart.ps1 ed498dbb1db39523fbbe8c7f13906561f22e6803824b6d8f6ae35b0fad918a9f zstart.ps1
f6107ca1d887ef1b3f94f51a40772a59d01fa1a582420a74766a2acc68bbe01f zstart_docker.cmd 42e16d544353136c53517b60250412c2626ebd59ec41cd061d912dc5994cbc38 zstart_docker.cmd
5f15a05f5972dd8a3d33efa224db2d2640f3562436ec1bc2efb7354fc9b4653f zstart_docker.ps1 d7590d9b69c5ccf0b138bae228e317bbe23c7d1e7461be7284a2a78ab2d7b0da zstart_docker.ps1
92bd61afa382b1c38bbd33cf19661084ba64cdb8b2ca6690d44c9ea1ee85a6af zstartd.cmd 12e1093305b07c0e2084b54ac309476115dd7029f074d4d797770468945c87e6 zstartd.cmd
ecd3bad1348fcd31c15b7365a9bb48742066cf98f0b1dd0aace4c4ce7a384242 zstop.ps1 e18105fe616b8a9a4d71b845036287ef984ac01434c7ddf5e8fa4b983aff8fda zstop.ps1
8f75cd61112cec34a504073cd6086c18ad5c1c368cd62f9603c04bcd50156189 zsync.cmd f568a27a0eb51c84827f7397619ae5783a607c6c61d209346b57789edc31f548 zsync.cmd
10e22effc5425d29ef3dc6eec9d69709dd02754a3baa5276ffdb1bbfe03a4dde zsync.ps1 32ae4d3652ecd531885dcd23fd426f2feb0dc1f195b3934d8bf057dda0f683fe zsync.ps1
2746c4e003c744f860cec2356844409304c2e9d577bbe6f895f39bc3140ca7d7 zversion.cmd 4448cafc840e5873b6bd05ac8a41661dd046e90047654f6be804a17d60edea8b zversion.cmd
529d4b2ae72603d2591475d65969bccd3f629522234315051ac95a88f6290a51 zversion.ps1 2bbacb1e311583df34118da4bffded3eecdf4fe0eaefe8ad87866ef98f361a88 zversion.ps1

View File

@ -72,11 +72,24 @@ if ($Projects.Count -eq 0) {
$Projects = @($Projects | ForEach-Object { $_.TrimStart('-') }) $Projects = @($Projects | ForEach-Object { $_.TrimStart('-') })
if ($Projects -contains 'all') { if ($Projects -contains 'all') {
$allKeys = Get-ZProjectKeys $Projects = @(Get-ZProjectKeys)
$edgeKeys = @($allKeys | Where-Object { $cfg.projects.$_.kind -eq 'edge' }) }
$restKeys = @($allKeys | Where-Object { $cfg.projects.$_.kind -ne 'edge' })
$Projects = @($edgeKeys + $restKeys) # Edge kinds first, however the list was produced. This is a correctness
Write-Host "Deploying all projects: $($Projects -join ', ')" -ForegroundColor Cyan # property, not a convenience of 'all': the proxy has to route before the apps
# behind it ship, or there is a window where a new app is live behind stale
# routing. `zdeploy evo edge` reads as "these two, edge included" and used to
# do the risky order, because this sort only ran for 'all'.
# Order within each group is preserved, so an intentional sequence still holds.
$requested = @($Projects)
$edgeKeys = @($Projects | Where-Object { $cfg.projects.$_.kind -eq 'edge' })
$restKeys = @($Projects | Where-Object { $cfg.projects.$_.kind -ne 'edge' })
$Projects = @($edgeKeys + $restKeys)
if ($Projects.Count -gt 1) {
# Say so when the order changed, so the reordering is never silent.
$note = if (($requested -join ',') -ne ($Projects -join ',')) { " (edge first)" } else { "" }
Write-Host "Deploying: $($Projects -join ', ')$note" -ForegroundColor Cyan
} }
function Get-DeployZipName { function Get-DeployZipName {