From 46ff3c44033e9c610c922a3fa87711e9ae568150 Mon Sep 17 00:00:00 2001 From: Marina B Date: Fri, 13 Jun 2025 05:51:59 -0700 Subject: [PATCH 1/4] Script to check for missing changes to latest after release branch was cut --- pdk/1.4/check-changes-pdk.sh | 53 ++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100755 pdk/1.4/check-changes-pdk.sh diff --git a/pdk/1.4/check-changes-pdk.sh b/pdk/1.4/check-changes-pdk.sh new file mode 100755 index 000000000..d96dc8a0b --- /dev/null +++ b/pdk/1.4/check-changes-pdk.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +# ============================= +# Script to compare changes between two versioned pdk directories +# +# Usage: Run this script to check if all changes made to pdk/1.3 in the 'latest' branch +# after the 1.4 release branch was created have also been applied to pdk/1.4 in the +# 'RELEASE_BRANCH' branch. +# +# When creating a new release (e.g., 1.5): +# 1. Update BASE_COMMIT to the commit hash where the new release branch (RELEASE_BRANCH for the next release) split from 'latest'. +# To find the commit hash, use: +# git merge-base latest RELEASE_BRANCH +# 2. Update the branch names (LATEST_BRANCH and RELEASE_BRANCH) as needed. +# 3. Update the OLD_VERSION and NEW_VERSION variables to match the previous and new version numbers. +# ============================= + +# Commit hash where the release branch split from 'latest'. +# To update for a new release, set this to the commit where the new release branch was created. +# To find the commit hash, run: +# git merge-base latest RELEASE_BRANCH +BASE_COMMIT=ed60617a8219dc89414e71698c77e31d55983a0c + +# Name of the main branch (usually 'latest') +LATEST_BRANCH=latest +# Name of the release branch (e.g., 'pdk-1-4-release') +RELEASE_BRANCH=pdk-1-4-release + +# Previous version directory (e.g., '1.3') +OLD_VERSION=1.3 +# New version directory (e.g., '1.4') +NEW_VERSION=1.4 + +# Get the list of changed files in the previous version directory since the split +# For a new release, update $OLD_VERSION and $NEW_VERSION accordingly + +changed_files=$(git diff --name-only $BASE_COMMIT..$LATEST_BRANCH -- pdk/$OLD_VERSION) +if [ -z "$changed_files" ]; then + echo "No changes found in pdk/$OLD_VERSION since the release branch was created." +else + echo "$changed_files" | while read file; do + file_new=${file/$OLD_VERSION/$NEW_VERSION} + echo "Comparing $file ($LATEST_BRANCH) to $file_new ($RELEASE_BRANCH):" + diff_output=$(git diff $LATEST_BRANCH:"$file" $RELEASE_BRANCH:"$file_new") + if [ -z "$diff_output" ]; then + echo " No missing changes." + else + echo "$diff_output" + fi + echo "----------------------------------------" + done +fi + From 3e2ae43a59830d2fbbfb6e46d7d50db027378b48 Mon Sep 17 00:00:00 2001 From: Marina B Date: Fri, 13 Jun 2025 06:31:15 -0700 Subject: [PATCH 2/4] version 2 updates --- pdk/1.4/check-changes-pdk.sh | 67 +++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 27 deletions(-) diff --git a/pdk/1.4/check-changes-pdk.sh b/pdk/1.4/check-changes-pdk.sh index d96dc8a0b..a490b693e 100755 --- a/pdk/1.4/check-changes-pdk.sh +++ b/pdk/1.4/check-changes-pdk.sh @@ -1,24 +1,42 @@ #!/bin/bash # ============================= -# Script to compare changes between two versioned pdk directories +# Script to compare changes between two versioned gateway directories +# +# NOTE: This script depends on the main script located at: +# docs-team-wiki/handy-scripts/check-changes.sh +# Ensure that script is available and up to date. # # Usage: Run this script to check if all changes made to pdk/1.3 in the 'latest' branch # after the 1.4 release branch was created have also been applied to pdk/1.4 in the # 'RELEASE_BRANCH' branch. # -# When creating a new release (e.g., 1.5): -# 1. Update BASE_COMMIT to the commit hash where the new release branch (RELEASE_BRANCH for the next release) split from 'latest'. -# To find the commit hash, use: -# git merge-base latest RELEASE_BRANCH -# 2. Update the branch names (LATEST_BRANCH and RELEASE_BRANCH) as needed. -# 3. Update the OLD_VERSION and NEW_VERSION variables to match the previous and new version numbers. +# For example, for the PDK 1.4.0 release: +# Checks that changes made under the pdk/1.3 directory in branch 'latest', +# after the 'pdk-1-4-release' release branch is created are also applied in the +# pdk/1.4 release folder in the 'pdk-1-4-release' release branch. +# +# To update the script to work after creating a new release (e.g., 1.5): +# 1. Update branch names (LATEST_BRANCH and RELEASE_BRANCH). +# 2. Update version numbers (OLD_VERSION and NEW_VERSION). +# 3. Update BASE_COMMIT to the commit hash where the new release branch +# (RELEASE_BRANCH for next release) split from 'latest'. To find the commit +# hash, use command 'git merge-base latest RELEASE_BRANCH'. For example: +# git merge-base latest pdk-1-4-release +# # ============================= +# Error check for dependency script +if [ ! -f "docs-team-wiki/handy-scripts/check-changes.sh" ]; then + echo "Error: Required script 'docs-team-wiki/handy-scripts/check-changes.sh' not found. Please ensure it exists and is up to date." >&2 + exit 1 +fi + # Commit hash where the release branch split from 'latest'. # To update for a new release, set this to the commit where the new release branch was created. -# To find the commit hash, run: -# git merge-base latest RELEASE_BRANCH +# To find the commit hash, use command 'git merge-base latest RELEASE_BRANCH'. +# For example: +# git merge-base latest pdk-1-4-release BASE_COMMIT=ed60617a8219dc89414e71698c77e31d55983a0c # Name of the main branch (usually 'latest') @@ -32,22 +50,17 @@ OLD_VERSION=1.3 NEW_VERSION=1.4 # Get the list of changed files in the previous version directory since the split -# For a new release, update $OLD_VERSION and $NEW_VERSION accordingly - -changed_files=$(git diff --name-only $BASE_COMMIT..$LATEST_BRANCH -- pdk/$OLD_VERSION) -if [ -z "$changed_files" ]; then - echo "No changes found in pdk/$OLD_VERSION since the release branch was created." -else - echo "$changed_files" | while read file; do - file_new=${file/$OLD_VERSION/$NEW_VERSION} - echo "Comparing $file ($LATEST_BRANCH) to $file_new ($RELEASE_BRANCH):" - diff_output=$(git diff $LATEST_BRANCH:"$file" $RELEASE_BRANCH:"$file_new") - if [ -z "$diff_output" ]; then - echo " No missing changes." - else - echo "$diff_output" - fi - echo "----------------------------------------" - done -fi +git diff --name-only $BASE_COMMIT..$LATEST_BRANCH -- gateway/$OLD_VERSION | while read file; do + # Map to new version path by replacing OLD_VERSION with NEW_VERSION in the file path + file_new=${file/$OLD_VERSION/$NEW_VERSION} + echo "Comparing $file ($LATEST_BRANCH) to $file_new ($RELEASE_BRANCH):" + # Store the diff output in a variable + diff_output=$(git diff $LATEST_BRANCH:"$file" $RELEASE_BRANCH:"$file_new") + if [ -z "$diff_output" ]; then + echo " No missing changes." + else + echo "$diff_output" + fi + echo "----------------------------------------" +done From 5776770849b4f8a66c963a6fd670dbe09d73671f Mon Sep 17 00:00:00 2001 From: Marina B Date: Fri, 13 Jun 2025 06:49:37 -0700 Subject: [PATCH 3/4] version 3 updates --- pdk/1.4/check-changes-pdk.sh | 41 +++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/pdk/1.4/check-changes-pdk.sh b/pdk/1.4/check-changes-pdk.sh index a490b693e..5093fe517 100755 --- a/pdk/1.4/check-changes-pdk.sh +++ b/pdk/1.4/check-changes-pdk.sh @@ -7,8 +7,8 @@ # docs-team-wiki/handy-scripts/check-changes.sh # Ensure that script is available and up to date. # -# Usage: Run this script to check if all changes made to pdk/1.3 in the 'latest' branch -# after the 1.4 release branch was created have also been applied to pdk/1.4 in the +# Usage: Run this script to check if all changes made to pdk/curr-rel in the 'latest' branch +# after the new PDK release branch is created are also applied to pdk/new-rel in the # 'RELEASE_BRANCH' branch. # # For example, for the PDK 1.4.0 release: @@ -27,15 +27,17 @@ # ============================= # Error check for dependency script -if [ ! -f "docs-team-wiki/handy-scripts/check-changes.sh" ]; then +if [ ! -f "../../../docs-team-wiki/handy-scripts/check-changes.sh" ]; then echo "Error: Required script 'docs-team-wiki/handy-scripts/check-changes.sh' not found. Please ensure it exists and is up to date." >&2 exit 1 fi # Commit hash where the release branch split from 'latest'. # To update for a new release, set this to the commit where the new release branch was created. -# To find the commit hash, use command 'git merge-base latest RELEASE_BRANCH'. +# To find the commit hash, use command 'git merge-base latest RELEASE_BRANCH'. # For example: + + # git merge-base latest pdk-1-4-release BASE_COMMIT=ed60617a8219dc89414e71698c77e31d55983a0c @@ -51,16 +53,21 @@ NEW_VERSION=1.4 # Get the list of changed files in the previous version directory since the split -git diff --name-only $BASE_COMMIT..$LATEST_BRANCH -- gateway/$OLD_VERSION | while read file; do - # Map to new version path by replacing OLD_VERSION with NEW_VERSION in the file path - file_new=${file/$OLD_VERSION/$NEW_VERSION} - echo "Comparing $file ($LATEST_BRANCH) to $file_new ($RELEASE_BRANCH):" - # Store the diff output in a variable - diff_output=$(git diff $LATEST_BRANCH:"$file" $RELEASE_BRANCH:"$file_new") - if [ -z "$diff_output" ]; then - echo " No missing changes." - else - echo "$diff_output" - fi - echo "----------------------------------------" -done +changed_files=$(git diff --name-only $BASE_COMMIT..$LATEST_BRANCH -- pdk/$OLD_VERSION) +if [ -z "$changed_files" ]; then + echo "No changes found in pdk/$OLD_VERSION since the release branch was created." +else + echo "$changed_files" | while read file; do + # Map to new version path by replacing OLD_VERSION with NEW_VERSION in the file path + file_new=${file/$OLD_VERSION/$NEW_VERSION} + echo "Comparing $file ($LATEST_BRANCH) to $file_new ($RELEASE_BRANCH):" + # Store the diff output in a variable + diff_output=$(git diff $LATEST_BRANCH:"$file" $RELEASE_BRANCH:"$file_new") + if [ -z "$diff_output" ]; then + echo " No missing changes." + else + echo "$diff_output" + fi + echo "----------------------------------------" + done +fi From d523986109e509736d12aa018330d5845a936ea8 Mon Sep 17 00:00:00 2001 From: Marina B Date: Fri, 13 Jun 2025 07:07:32 -0700 Subject: [PATCH 4/4] version 4 update - use handy-script --- pdk/1.4/check-changes-pdk.sh | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/pdk/1.4/check-changes-pdk.sh b/pdk/1.4/check-changes-pdk.sh index 5093fe517..0526a8d4b 100755 --- a/pdk/1.4/check-changes-pdk.sh +++ b/pdk/1.4/check-changes-pdk.sh @@ -1,7 +1,7 @@ #!/bin/bash # ============================= -# Script to compare changes between two versioned gateway directories +# Script to compare changes between two versioned pdk directories using docs-team-wiki/handy-scripts/check-changes.sh script # # NOTE: This script depends on the main script located at: # docs-team-wiki/handy-scripts/check-changes.sh @@ -36,9 +36,6 @@ fi # To update for a new release, set this to the commit where the new release branch was created. # To find the commit hash, use command 'git merge-base latest RELEASE_BRANCH'. # For example: - - -# git merge-base latest pdk-1-4-release BASE_COMMIT=ed60617a8219dc89414e71698c77e31d55983a0c # Name of the main branch (usually 'latest') @@ -51,23 +48,11 @@ OLD_VERSION=1.3 # New version directory (e.g., '1.4') NEW_VERSION=1.4 -# Get the list of changed files in the previous version directory since the split - -changed_files=$(git diff --name-only $BASE_COMMIT..$LATEST_BRANCH -- pdk/$OLD_VERSION) -if [ -z "$changed_files" ]; then - echo "No changes found in pdk/$OLD_VERSION since the release branch was created." -else - echo "$changed_files" | while read file; do - # Map to new version path by replacing OLD_VERSION with NEW_VERSION in the file path - file_new=${file/$OLD_VERSION/$NEW_VERSION} - echo "Comparing $file ($LATEST_BRANCH) to $file_new ($RELEASE_BRANCH):" - # Store the diff output in a variable - diff_output=$(git diff $LATEST_BRANCH:"$file" $RELEASE_BRANCH:"$file_new") - if [ -z "$diff_output" ]; then - echo " No missing changes." - else - echo "$diff_output" - fi - echo "----------------------------------------" - done -fi +# Call the generic check-changes.sh script with the appropriate arguments +../../../docs-team-wiki/handy-scripts/check-changes.sh \ + --folder pdk \ + --old-version "$OLD_VERSION" \ + --new-version "$NEW_VERSION" \ + --latest-branch "$LATEST_BRANCH" \ + --release-branch "$RELEASE_BRANCH" \ + --base-commit "$BASE_COMMIT"