Implement system for postponing dependency updates.

This commit is contained in:
Taylor Hornby 2020-06-24 12:20:18 -06:00
parent 552482a404
commit 75876f477b
2 changed files with 276 additions and 5 deletions

View File

@ -0,0 +1,223 @@
# List of Postponed Dependency Updates
#
# The format is: name version expiration, e.g.
# bdb 18.1.40 2020-09-01
#
bdb 18.1.40 2020-09-01
boost 1.71.0 2020-09-01
boost 1.72.0 2020-09-01
boost 1.73.0 2020-09-01
googletest 1.8.1 2020-09-01
googletest 1.10.0 2020-09-01
libevent 2.1.10 2020-09-01
libevent 2.1.11 2020-09-01
native_ccache 3.3.2 2020-09-01
native_ccache 3.3.3 2020-09-01
native_ccache 3.3.4 2020-09-01
native_ccache 3.3.5 2020-09-01
native_ccache 3.3.6 2020-09-01
native_ccache 3.4 2020-09-01
native_ccache 3.4.1 2020-09-01
native_ccache 3.4.2 2020-09-01
native_ccache 3.4.3 2020-09-01
native_ccache 3.5 2020-09-01
native_ccache 3.5.1 2020-09-01
native_ccache 3.6 2020-09-01
native_ccache 3.7 2020-09-01
native_ccache 3.7.1 2020-09-01
native_ccache 3.7.2 2020-09-01
native_ccache 3.7.3 2020-09-01
native_ccache 3.7.4 2020-09-01
native_ccache 3.7.5 2020-09-01
native_ccache 3.7.6 2020-09-01
native_ccache 3.7.7 2020-09-01
native_ccache 3.7.8 2020-09-01
native_ccache 3.7.9 2020-09-01
native_ccache 3.7.10 2020-09-01
openssl 1.1.1.b 2020-09-01
openssl 1.1.1.c 2020-09-01
openssl 1.1.1.d 2020-09-01
openssl 1.1.1.e 2020-09-01
openssl 1.1.1.f 2020-09-01
openssl 1.1.1.g 2020-09-01
proton 0.31.0 2020-09-01
rust 1.43.0 2020-09-01
rust 1.43.1 2020-09-01
rust 1.44.0 2020-09-01
rust 1.44.1 2020-09-01
zeromq 4.3.2 2020-09-01
leveldb 1.19 2020-09-01
leveldb 1.20 2020-09-01
utfcpp 3.1.1 2020-09-01
crate_aes 0.4.0 2020-09-01
crate_aesni 0.7.0 2020-09-01
crate_aes_soft 0.4.0 2020-09-01
crate_arrayvec 0.4.12 2020-09-01
crate_arrayvec 0.5.0 2020-09-01
crate_arrayvec 0.5.1 2020-09-01
crate_arrayref 0.3.6 2020-09-01
crate_autocfg 0.1.7 2020-09-01
crate_autocfg 1.0.0 2020-09-01
crate_bigint 4.4.2 2020-09-01
crate_bigint 4.4.3 2020-09-01
crate_blake2b_simd 0.5.9 2020-09-01
crate_blake2b_simd 0.5.10 2020-09-01
crate_blake2s_simd 0.5.9 2020-09-01
crate_blake2s_simd 0.5.10 2020-09-01
crate_bit_vec 0.5.0 2020-09-01
crate_bit_vec 0.5.1 2020-09-01
crate_bit_vec 0.6.0 2020-09-01
crate_bit_vec 0.6.1 2020-09-01
crate_bit_vec 0.6.2 2020-09-01
crate_block_cipher_trait 0.7.0 2020-09-01
crate_byteorder 1.3.3 2020-09-01
crate_byteorder 1.3.4 2020-09-01
crate_block_buffer 0.8.0 2020-09-01
crate_block_buffer 0.9.0 2020-09-01
crate_block_padding 0.1.5 2020-09-01
crate_block_padding 0.2.0 2020-09-01
crate_c2_chacha 0.2.3 2020-09-01
crate_c2_chacha 0.2.4 2020-09-01
crate_cfg_if 0.1.10 2020-09-01
crate_crunchy 0.2.1 2020-09-01
crate_crunchy 0.2.2 2020-09-01
crate_constant_time_eq 0.1.5 2020-09-01
crate_crossbeam 0.7.3 2020-09-01
crate_digest 0.9.0 2020-09-01
crate_crossbeam_channel 0.4.0 2020-09-01
crate_crossbeam_channel 0.4.1 2020-09-01
crate_crossbeam_channel 0.4.2 2020-09-01
crate_crossbeam_deque 0.7.2 2020-09-01
crate_crossbeam_deque 0.7.3 2020-09-01
crate_crossbeam_epoch 0.8.0 2020-09-01
crate_crossbeam_epoch 0.8.1 2020-09-01
crate_crossbeam_epoch 0.8.2 2020-09-01
crate_crossbeam_utils 0.7.0 2020-09-01
crate_crossbeam_utils 0.7.1 2020-09-01
crate_crossbeam_utils 0.7.2 2020-09-01
crate_crossbeam_queue 0.2.0 2020-09-01
crate_crossbeam_queue 0.2.1 2020-09-01
crate_crossbeam_queue 0.2.2 2020-09-01
crate_crossbeam_queue 0.2.3 2020-09-01
crate_crypto_api_chachapoly 0.3.0 2020-09-01
crate_crypto_api_chachapoly 0.4.0 2020-09-01
crate_crypto_api_chachapoly 0.4.1 2020-09-01
crate_crypto_api_chachapoly 0.4.2 2020-09-01
crate_directories 2.0.0 2020-09-01
crate_directories 2.0.1 2020-09-01
crate_directories 2.0.2 2020-09-01
crate_directories 3.0.0 2020-09-01
crate_getrandom 0.1.13 2020-09-01
crate_getrandom 0.1.14 2020-09-01
crate_hex 0.4.0 2020-09-01
crate_hex 0.4.1 2020-09-01
crate_hex 0.4.2 2020-09-01
crate_log 0.4.9 2020-09-01
crate_log 0.4.10 2020-09-01
crate_futures 0.2.0 2020-09-01
crate_futures 0.2.1 2020-09-01
crate_futures 0.3.0 2020-09-01
crate_futures 0.3.1 2020-09-01
crate_futures 0.3.2 2020-09-01
crate_futures 0.3.3 2020-09-01
crate_futures 0.3.4 2020-09-01
crate_futures 0.3.5 2020-09-01
crate_generic_array 0.13.0 2020-09-01
crate_generic_array 0.13.1 2020-09-01
crate_generic_array 0.13.2 2020-09-01
crate_generic_array 0.14.0 2020-09-01
crate_generic_array 0.14.1 2020-09-01
crate_generic_array 0.14.2 2020-09-01
crate_libc 0.2.63 2020-09-01
crate_libc 0.2.64 2020-09-01
crate_libc 0.2.65 2020-09-01
crate_libc 0.2.66 2020-09-01
crate_libc 0.2.67 2020-09-01
crate_libc 0.2.68 2020-09-01
crate_libc 0.2.69 2020-09-01
crate_libc 0.2.70 2020-09-01
crate_libc 0.2.71 2020-09-01
crate_nodrop 0.1.14 2020-09-01
crate_num_bigint 0.2.4 2020-09-01
crate_num_bigint 0.2.5 2020-09-01
crate_num_bigint 0.2.6 2020-09-01
crate_num_bigint 0.3.0 2020-09-01
crate_memoffset 0.5.2 2020-09-01
crate_memoffset 0.5.3 2020-09-01
crate_memoffset 0.5.4 2020-09-01
crate_ppv_lite86 0.2.6 2020-09-01
crate_ppv_lite86 0.2.7 2020-09-01
crate_ppv_lite86 0.2.8 2020-09-01
crate_proc_macro2 1.0.4 2020-09-01
crate_proc_macro2 1.0.5 2020-09-01
crate_proc_macro2 1.0.6 2020-09-01
crate_proc_macro2 1.0.7 2020-09-01
crate_proc_macro2 1.0.8 2020-09-01
crate_proc_macro2 1.0.9 2020-09-01
crate_proc_macro2 1.0.10 2020-09-01
crate_proc_macro2 1.0.11 2020-09-01
crate_proc_macro2 1.0.12 2020-09-01
crate_proc_macro2 1.0.13 2020-09-01
crate_proc_macro2 1.0.14 2020-09-01
crate_proc_macro2 1.0.15 2020-09-01
crate_proc_macro2 1.0.16 2020-09-01
crate_proc_macro2 1.0.17 2020-09-01
crate_proc_macro2 1.0.18 2020-09-01
crate_quote 1.0.3 2020-09-01
crate_quote 1.0.4 2020-09-01
crate_quote 1.0.5 2020-09-01
crate_quote 1.0.6 2020-09-01
crate_quote 1.0.7 2020-09-01
crate_num_cpus 1.11.0 2020-09-01
crate_num_cpus 1.11.1 2020-09-01
crate_num_cpus 1.12.0 2020-09-01
crate_num_cpus 1.13.0 2020-09-01
crate_num_integer 0.1.42 2020-09-01
crate_num_integer 0.1.43 2020-09-01
crate_num_traits 0.2.9 2020-09-01
crate_num_traits 0.2.10 2020-09-01
crate_num_traits 0.2.11 2020-09-01
crate_num_traits 0.2.12 2020-09-01
crate_opaque_debug 0.3.0 2020-09-01
crate_rand 0.7.1 2020-09-01
crate_rand 0.7.2 2020-09-01
crate_rand 0.7.3 2020-09-01
crate_typenum 1.12.0 2020-09-01
crate_rand_chacha 0.2.2 2020-09-01
crate_scopeguard 1.1.0 2020-09-01
crate_semver 0.10.0 2020-09-01
crate_semver_parser 0.9.0 2020-09-01
crate_sha2 0.8.1 2020-09-01
crate_sha2 0.8.2 2020-09-01
crate_sha2 0.9.0 2020-09-01
crate_sha2 0.9.1 2020-09-01
crate_syn 1.0.6 2020-09-01
crate_syn 1.0.7 2020-09-01
crate_syn 1.0.8 2020-09-01
crate_syn 1.0.9 2020-09-01
crate_syn 1.0.10 2020-09-01
crate_syn 1.0.11 2020-09-01
crate_syn 1.0.12 2020-09-01
crate_syn 1.0.13 2020-09-01
crate_syn 1.0.14 2020-09-01
crate_syn 1.0.15 2020-09-01
crate_syn 1.0.16 2020-09-01
crate_syn 1.0.17 2020-09-01
crate_syn 1.0.18 2020-09-01
crate_syn 1.0.19 2020-09-01
crate_syn 1.0.20 2020-09-01
crate_syn 1.0.21 2020-09-01
crate_syn 1.0.22 2020-09-01
crate_syn 1.0.23 2020-09-01
crate_syn 1.0.24 2020-09-01
crate_syn 1.0.25 2020-09-01
crate_syn 1.0.26 2020-09-01
crate_syn 1.0.27 2020-09-01
crate_syn 1.0.28 2020-09-01
crate_syn 1.0.29 2020-09-01
crate_syn 1.0.30 2020-09-01
crate_syn 1.0.31 2020-09-01
crate_syn 1.0.32 2020-09-01
crate_syn 1.0.33 2020-09-01
crate_unicode_xid 0.2.1 2020-09-01

View File

@ -30,6 +30,7 @@ import requests
import os
import re
import sys
import datetime
SOURCE_ROOT = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..")
# The email for this account is taylor@electriccoin.co and the token does not
@ -258,7 +259,7 @@ class BerkeleyDbReleaseLister:
for match in re.findall("Berkeley DB (\d+)\.(\d+)\.(\d+)\.tar.gz", page):
release_versions.add(Version(match))
if Version((6, 2, 38)) not in release_versions:
if len(release_versions) == 0:
raise RuntimeError("Missing expected version from Oracle web page.")
return list(release_versions)
@ -312,6 +313,33 @@ class UnivalueVersionGetter:
else:
raise RuntimeError("Couldn't parse univalue's version from its configure.ac")
class PostponedUpdates():
def __init__(self):
self.postponedlist = dict()
postponedlist_path = os.path.join(
os.path.dirname(__file__),
"postponed-updates.txt"
)
file = open(postponedlist_path, 'r')
for line in file.readlines():
stripped = re.sub('#.*$', '', line).strip()
if stripped != "":
match = re.match('^(\S+)\s+(\S+)\s+(\S+)$', stripped)
if match:
postponed_name = match.groups()[0]
postponed_version = Version(match.groups()[1].split("."))
postpone_expiration = datetime.datetime.strptime(match.groups()[2], '%Y-%m-%d')
if datetime.datetime.utcnow() < postpone_expiration:
self.postponedlist[(postponed_name, str(postponed_version))] = True
else:
raise RuntimeError("Could not parse line in postponed-updates.txt:" + line)
def is_postponed(self, name, version):
return (name, str(version)) in self.postponedlist
def safe(string):
if re.match('^[a-zA-Z0-9_-]*$', string):
return string
@ -356,6 +384,7 @@ def main():
sys.exit(status)
deps = get_dependency_list()
postponed = PostponedUpdates()
for dependency in deps:
if dependency.name in unchecked_dependencies:
unchecked_dependencies.remove(dependency.name)
@ -369,17 +398,36 @@ def main():
str(dependency.current_version()),
"")
else:
# The status can either be POSTPONED or OUT OF DATE depending
# on whether or not all the new versions are whitelisted.
status_text = "POSTPONED"
newver_list = "["
for newver in dependency.released_versions_after_current_version():
if postponed.is_postponed(dependency.name, newver):
newver_list += str(newver) + " (postponed),"
else:
newver_list += str(newver) + ","
status_text = "OUT OF DATE"
status = 1
newver_list = newver_list[:-1] + "]"
print_row(
dependency.name,
"OUT OF DATE",
status_text,
str(dependency.current_version()),
str(list(map(str, dependency.released_versions_after_current_version()))))
status = 1
newver_list
)
if len(unchecked_dependencies) > 0:
unchecked_dependencies.sort()
print("WARNING: The following dependencies are not being checked for updates by this script: " + ', '.join(unchecked_dependencies))
status = 2
sys.exit(2)
if status == 0:
print("Ready to release. All dependencies are up-to-date or postponed.")
elif status == 1:
print("Release is BLOCKED. There are new dependency updates that have not been postponed.")
sys.exit(status)