From bbf8acbda9c0d5105888756fdfef1002d99f280f Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Tue, 10 Dec 2024 17:23:43 +0100 Subject: [PATCH 1/4] fix(linux): pushing of updated changelog branch This fixes the `upload-to-debian.sh` script if the `chore/linux/changelog` branch was created a while back while the base branch moved in the meantime. In this case we have to use `--force` instead of `--force-with-lease` otherwise `git` gets confused. This is save to do since the intention is that we replace the previous commit and we know that there is (should be) only one commit on the `chore/linux/changelog` branch. --- linux/scripts/upload-to-debian.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/scripts/upload-to-debian.sh b/linux/scripts/upload-to-debian.sh index 85472a4ed19..7fd844dd845 100755 --- a/linux/scripts/upload-to-debian.sh +++ b/linux/scripts/upload-to-debian.sh @@ -99,7 +99,7 @@ function push_to_github_and_create_pr() { local PR_BODY=$4 if [[ -n "${PUSH}" ]]; then - ${NOOP} git push --force-with-lease origin "${BRANCH}" + ${NOOP} git push --force origin "${BRANCH}" PR_NUMBER=$(gh pr list --draft --search "${PR_TITLE}" --base "${BASE}" --json number --jq '.[].number') if [[ -n ${PR_NUMBER} ]]; then builder_echo "PR #${PR_NUMBER} already exists" From 7f71b128c2b411ee3d11f5ed70698519dce30f05 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 11 Dec 2024 09:00:06 +0100 Subject: [PATCH 2/4] chore(linux): remove unnecessary line from changelog According to a comment on the latest upload to mentors.debian.org we don't have to add the line "Re-release to Debian", so this change removes this. --- linux/scripts/debian.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/scripts/debian.sh b/linux/scripts/debian.sh index 66cc7ba1575..3a896c10b25 100755 --- a/linux/scripts/debian.sh +++ b/linux/scripts/debian.sh @@ -36,7 +36,7 @@ for proj in ${projects}; do EXTRA_ARGS="--distribution ${DIST} --force-distribution" fi # shellcheck disable=SC2086 - dch --newversion "${version}-${DEBREVISION-1}" ${EXTRA_ARGS} "Re-release to Debian" + dch --newversion "${version}-${DEBREVISION-1}" ${EXTRA_ARGS} "" debuild -d -S -sa -Zxz cd "${BASEDIR}" done From 96a071afb425a6edba5f3a973692797737d19815 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 11 Dec 2024 09:04:05 +0100 Subject: [PATCH 3/4] chore(linux): fix problem from a previous merge This change removes lines that sneaked in through a previous merge that caused conflicts. The `changelog` on `master` should be idential to the one in the stable branch. --- linux/debian/changelog | 6 ------ 1 file changed, 6 deletions(-) diff --git a/linux/debian/changelog b/linux/debian/changelog index 2f89e332c04..ddd4d3611d9 100644 --- a/linux/debian/changelog +++ b/linux/debian/changelog @@ -22,12 +22,6 @@ keyman (17.0.279-1) unstable; urgency=medium -- Eberhard Beilharz Thu, 29 Feb 2024 19:17:08 +0100 -keyman (17.0.274-2) UNRELEASED; urgency=medium - - * Add libicu-dev dependency to libkeymancore-dev (closes: #1064915) - - -- Eberhard Beilharz Wed, 28 Feb 2024 17:54:58 +0100 - keyman (17.0.274-1) unstable; urgency=medium * Fix autopkg tests From 7010e41b48969e07dbed2515be3ee9c45984a313 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 11 Dec 2024 09:15:52 +0100 Subject: [PATCH 4/4] docs(linux): add documentation comments --- linux/scripts/upload-to-debian.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/linux/scripts/upload-to-debian.sh b/linux/scripts/upload-to-debian.sh index 7fd844dd845..ead29439839 100755 --- a/linux/scripts/upload-to-debian.sh +++ b/linux/scripts/upload-to-debian.sh @@ -92,13 +92,18 @@ function get_latest_stable_branch_name() { echo "${stable_branch##* }" } +# Push the changelog changes to GitHub and create a PR. Returns the PR# +# in the environment variable PR_NUMBER. function push_to_github_and_create_pr() { - local BRANCH=$1 - local BASE=$2 - local PR_TITLE=$3 - local PR_BODY=$4 + local BRANCH=$1 # `chore/linux/changelog` or `chore/linux/cherry-pick/changelog` + local BASE=$2 # stable branch, `beta` or `master` + local PR_TITLE=$3 # `Update debian changelog` + local PR_BODY=$4 # `@keymanapp-test-bot skip` if [[ -n "${PUSH}" ]]; then + # Push to origin. We force push to reset the branch the commit we just made. + # There shouldn't be any other commits on ${BRANCH} except the one we want to replace + # (if any). ${NOOP} git push --force origin "${BRANCH}" PR_NUMBER=$(gh pr list --draft --search "${PR_TITLE}" --base "${BASE}" --json number --jq '.[].number') if [[ -n ${PR_NUMBER} ]]; then