From c15fb5f6b212ed2a2f3a77863db0c7cc99eb8975 Mon Sep 17 00:00:00 2001 From: lawrencegripper Date: Tue, 14 Jan 2025 12:13:15 +0000 Subject: [PATCH] Add example detection script --- helpers/pinned-details-chech.sh | 30 +++++++++++++++++++++++ images/windows/toolsets/toolset-2019.json | 14 +++++++++-- schemas/toolset-schema.json | 2 +- 3 files changed, 43 insertions(+), 3 deletions(-) create mode 100755 helpers/pinned-details-chech.sh diff --git a/helpers/pinned-details-chech.sh b/helpers/pinned-details-chech.sh new file mode 100755 index 000000000..1874e3b81 --- /dev/null +++ b/helpers/pinned-details-chech.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +toolset_files=$(find . -name 'toolset-*.json') + +for toolset_file in $toolset_files; do + if [[ "$toolset_file" == *"toolset-schema.json" ]]; then + continue + fi + + readarray -t pinned_details < <(jq --compact-output '.. | objects | select(has("review-at"))' "$toolset_file") + + for pinned_detail in "${pinned_details[@]}"; do + review_date=$(jq -r '.["review-at"]' <<< "$pinned_detail") + reason=$(jq -r '.["reason"]' <<< "$pinned_detail") + + if [ -n "$review_date" ]; then + if [ "$(date -d "$review_date" +%s)" -gt "$(date +%s)" ]; then + echo "ERROR: Overdue review date: $review_date for tool in $toolset_file" + echo " Pinned for '$reason'" + echo "" + fi + + if [ "$(date -d "$review_date" +%s)" -le $(( $(date +%s) - 7*24*60*60 )) ]; then + echo "WARNING: Review date is coming up within the next 7 days: $review_date for tool in $toolset_file" + echo " Pinned for '$reason'" + echo "" + fi + fi + done +done diff --git a/images/windows/toolsets/toolset-2019.json b/images/windows/toolsets/toolset-2019.json index d53afe00a..23f80a2dc 100644 --- a/images/windows/toolsets/toolset-2019.json +++ b/images/windows/toolsets/toolset-2019.json @@ -470,13 +470,23 @@ }, "postgresql": { "version": "14.12.1", - "signature": "698BA51AA27CC31282AACA5055E4B9190BC6C0E9" + "signature": "698BA51AA27CC31282AACA5055E4B9190BC6C0E9", + "pinnedDetails": { + "link": "https://github.com/EnterpriseDB/edb-installers/issues/196#issuecomment-2489021239", + "reason": "this was pinned due to a downstream issue with the installer", + "review-at": "2023-12-31" + } }, "kotlin": { "version": "latest" }, "openssl": { - "version": "1.1.1" + "version": "1.1.1", + "pinnedDetails": { + "link": "https://github.com/somelink", + "reason": "this was pinned due to a downstream issue with the installer", + "review-at": "2025-01-30" + } }, "pwsh": { "version": "7.4" diff --git a/schemas/toolset-schema.json b/schemas/toolset-schema.json index 79b1bd988..f9bf71b96 100644 --- a/schemas/toolset-schema.json +++ b/schemas/toolset-schema.json @@ -17,7 +17,7 @@ }, "then": { "required": [ - "pinnedReason" + "pinnedDetails" ], "properties": { "pinnedDetails": {