tebako-release 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5382811aa28e5730bd9a513c18f61cd0619d6586ec0089de1822d8283313399f
4
- data.tar.gz: da87f7c9358a2c1b69e38f0986b42ddbe73c29cd835814657e1f8ade793f402b
3
+ metadata.gz: 70f6056da28a7c62a6025b10993b3e1998ab8b4284a5a6ee86bfe799fd6608f7
4
+ data.tar.gz: 877d474e2f19e6af7c6d3b49f366ea2040c6fef4e06275d0858409069f82a1e3
5
5
  SHA512:
6
- metadata.gz: 451fa6d51c2392f4739c0236dd5d72dfce5788cd07dc9e240d72d61a59a47e265dbc0d009f3e7f1b7175d15c371096490b9ff852999b3aab1116e9eaf7732aa9
7
- data.tar.gz: 5ba106db23aa707ec41abe0629d06e16a6dd7a61156495bff9dc6e3134f6cdcbab9724d19fc5996d746f864519c6cef91c543b6de16ebc14cb6762e64d026ff6
6
+ metadata.gz: 1f63cb53bc85a2fb99df775a471f799b1c70ae139ab1525d87458b5bb052bf7e6e32175c990abcccf1f2bc35a0ef69e1a7709a0cb0075c91a6c401a04be49010
7
+ data.tar.gz: 02a288b0ac6155e10429137d5d7e2d8e4e0fc1afb3f98b6315e15fd763e4cd97de6e8e063c3d0f01f6384b0a83253c2b0e3b2b6a756d8dac7fae296aea6682c7
@@ -47,6 +47,16 @@ module TebakoRelease
47
47
  "\\d+\\.\\d+\\.\\d+"
48
48
  end
49
49
 
50
+ # The language segment of the package-name grammar
51
+ # (`tebako-runtime-<ver>-<lang>-<lv>-<triplet>` — tebako#716):
52
+ # declared by factories publishing the post-#716 spelling. Default
53
+ # nil — the pre-#716 spelling carried no language segment, and this
54
+ # machinery keeps composing/parsing it for the immutable releases
55
+ # that already carry it.
56
+ def lang_name
57
+ nil
58
+ end
59
+
50
60
  # Spec 36's publish shape: when true, each leg publishes ONE bundle
51
61
  # (<stem>.tar.gz — exe + env image + DLLs + in-bundle SHA256SUMS) plus
52
62
  # its sidecar and shard, instead of the per-file asset enumeration.
@@ -76,9 +76,20 @@ module TebakoRelease
76
76
  # elsewhere (openjdk's out/<flavor>-<triplet>/) at this run's dir.
77
77
  LOCAL_PACKAGES_DIR = "runtime-packages"
78
78
 
79
- # upload convergence: a tiny metadata asset either lands or cycles;
80
- # three bounded polls then a named failure.
81
- CONVERGENCE_DELAYS = [5, 15, 30].freeze
79
+ # upload convergence: a tiny metadata asset either lands or cycles.
80
+ # Campaign-scale concurrency — dozens of sign legs replacing .asc
81
+ # assets on one release object — makes the 422 delete-propagation
82
+ # race routine, so the budget is ten jittered cycles over ~4–5
83
+ # minutes (tebako-release#15); the jitter keeps concurrently failing
84
+ # legs from re-colliding on the same propagation windows in lockstep.
85
+ CONVERGENCE_DELAYS = [5, 10, 15, 20, 30, 30, 30, 30, 40, 40].freeze
86
+ CONVERGENCE_JITTER = 0.4
87
+
88
+ # A convergence pause scaled by 1 ± CONVERGENCE_JITTER. A zero pause
89
+ # stays zero, so spec-stubbed delay lists keep their determinism.
90
+ def self.jittered(pause)
91
+ pause * (1 + (((rand * 2) - 1) * CONVERGENCE_JITTER))
92
+ end
82
93
 
83
94
  # served-bytes convergence: a young release object lists an asset before
84
95
  # the byte store serves it (the runtime-ruby 0.16.28 republish's
@@ -310,8 +321,9 @@ module TebakoRelease
310
321
  converged = asc_converged?(release, asc_file, sha)
311
322
  break if converged
312
323
 
313
- puts "#{asc_file.basename} has not converged on the release yet; cycling in #{pause}s"
314
- sleep pause
324
+ wait = Signer.jittered(pause)
325
+ puts "#{asc_file.basename} has not converged on the release yet; cycling in #{wait.round}s"
326
+ sleep wait
315
327
  end
316
328
  raise SigningGateError, "NAMED FAILURE: #{asc_file.basename} did not converge on #{@tag}" unless converged
317
329
  end
@@ -256,7 +256,7 @@ module TebakoRelease
256
256
  next unless @config.adapter.capable_pair?(env["os"], env["arch"], version)
257
257
 
258
258
  platform = Platform.host_id_for(env["os"], env["arch"])
259
- "tebako-runtime-#{@version}-#{version}-#{platform}"
259
+ "tebako-runtime-#{@version}-#{lang_infix}#{version}-#{platform}"
260
260
  end
261
261
  rescue JSON::ParserError => e
262
262
  puts "::warning::Could not compute expected package list: #{e.message}"
@@ -656,15 +656,42 @@ module TebakoRelease
656
656
  "#{package.basename.to_s.sub(/\.exe\z/, "")}.dll"
657
657
  end
658
658
 
659
+ # The language infix of the package-name grammar: "ruby-" on
660
+ # post-#716 publishes, empty on the pre-#716 spelling.
661
+ def lang_infix
662
+ name = @config.adapter.lang_name
663
+ name.nil? || name.empty? ? "" : "#{name}-"
664
+ end
665
+
666
+ # The dual-era package-name parse (tebako#716): the pre-#716 spelling
667
+ # is `tebako-runtime-<ver>-<lv>-<triplet>`; the post-#716 spelling
668
+ # inserts the factory's language segment. A present segment that
669
+ # disagrees with the adapter's lang_name is a foreign file, never
670
+ # this factory's package.
659
671
  def parse_package_filename(filename)
660
672
  grammar = @config.adapter.version_grammar_source
661
- match = /\Atebako-runtime-#{Regexp.escape(@version)}-(#{grammar})-(.+?)(?:\.exe)?\z/.match(filename)
662
- unless match
663
- puts "::warning::Cannot infer version/platform from package filename: #{filename}"
664
- return [nil, nil]
665
- end
673
+ pattern = /\Atebako-runtime-#{Regexp.escape(@version)}-(?:([a-z0-9]+)-)?(#{grammar})-(.+?)(?:\.exe)?\z/
674
+ match = pattern.match(filename)
675
+ return warn_unparseable_name(filename) unless match
676
+ return [match[2], match[3]] unless foreign_lang_segment?(match[1])
677
+
678
+ warn_foreign_segment(filename, match[1])
679
+ end
680
+
681
+ # The optional language capture vs the adapter's declaration.
682
+ def foreign_lang_segment?(lang)
683
+ lang && @config.adapter.lang_name && lang != @config.adapter.lang_name
684
+ end
685
+
686
+ def warn_unparseable_name(filename)
687
+ puts "::warning::Cannot infer version/platform from package filename: #{filename}"
688
+ [nil, nil]
689
+ end
666
690
 
667
- [match[1], match[2]]
691
+ def warn_foreign_segment(filename, lang)
692
+ puts "::warning::package filename carries a foreign language segment " \
693
+ "(#{lang}, this factory is #{@config.adapter.lang_name}): #{filename}"
694
+ [nil, nil]
668
695
  end
669
696
 
670
697
  # The upload retry budget: escalating delays, ~4.5 minutes of patience.
@@ -5,5 +5,5 @@
5
5
  # This file is a part of tamatebako
6
6
 
7
7
  module TebakoRelease
8
- VERSION = "0.4.1"
8
+ VERSION = "0.5.0"
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tebako-release
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc