Add bottle file size to GHP manifest annotations
This will reduce the number of requests necessary to ascertain the size of formulas' bottle archives for analysis purposes. Currently, getting the size of each bottle requires 1 request for the formula.json and followed by N requests per formula-version, which for most formulae is 7— more than 47k requests! After this change, size retrieval can ascertain all bottle sizes for a formula-version in a single request, at the cost of one additional request per formula-version if that formula-version has not been rebuilt since this change was introduced. To start, size retrieval will incur an additional P requests where P is the number of packages. Over the next few weeks and months, the retrieval will go a lot faster as all new and updated packages will require only one request.
This commit is contained in:
parent
ac0663ae5d
commit
2787eead89
@ -356,11 +356,14 @@ class GitHubPackages
|
||||
|
||||
documentation = "https://formulae.brew.sh/formula/#{formula_name}" if formula_core_tap
|
||||
|
||||
local_file_size = File.size(local_file)
|
||||
|
||||
descriptor_annotations_hash = {
|
||||
"org.opencontainers.image.ref.name" => tag,
|
||||
"sh.brew.bottle.cpu.variant" => cpu_variant,
|
||||
"sh.brew.bottle.digest" => tar_gz_sha256,
|
||||
"sh.brew.bottle.glibc.version" => glibc_version,
|
||||
"sh.brew.bottle.size" => local_file_size,
|
||||
"sh.brew.tab" => tab.to_json,
|
||||
}.reject { |_, v| v.blank? }
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user