You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@grails.apache.org by "chloeb-smith (via GitHub)" <gi...@apache.org> on 2026/04/18 13:01:49 UTC
[PR] fix: prompt before removing old SVN release folder during promotion [grails-core]
chloeb-smith opened a new pull request, #15584:
URL: https://github.com/apache/grails-core/pull/15584
**Description**
This PR addresses issue #15551. During parallel releases (e.g. 7.0.10 and 7.1.0-RC1), the promotion script was automatically deleting the old release folder, which could remove a still-current release. This change adds an interactive prompt before deleting, so the operator can choose whether to remove the old folder.
**Changes**
A [y/N] interactive prompt was added so the operator must explicitly confirm before the deletion occurs. If they answer anything other than y/Y, the deletion is skipped and the promotion continues as normal.
**Verification**
Verified using a local mock of the `svn` command, testing three scenarios:
- Answering `y` — old folder was deleted and promotion completed
- Answering `n` — deletion was skipped and promotion completed
- Pressing Enter (default `N`) — deletion was skipped and promotion completed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: prompt before removing old SVN release folder during promotion [grails-core]
Posted by "sanjana2505006 (via GitHub)" <gi...@apache.org>.
sanjana2505006 commented on PR #15584:
URL: https://github.com/apache/grails-core/pull/15584#issuecomment-4275210082
@chloeb-smith LGTM :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: prompt before removing old SVN release folder during promotion [grails-core]
Posted by "sanjana2505006 (via GitHub)" <gi...@apache.org>.
sanjana2505006 commented on code in PR #15584:
URL: https://github.com/apache/grails-core/pull/15584#discussion_r3105773627
##########
.github/scripts/releaseDistributions.sh:
##########
@@ -61,9 +61,14 @@ svn_exists() {
old_release_folder="$(svn ls "${svn_flags[@]}" "${RELEASE_ROOT}" | awk -F/ 'NF{print $1; exit}')"
Review Comment:
Using `awk ... exit` only identifies the first folder in the SVN directory. In a multi-branch environment (e.g., having both 6.x and 7.x releases in the same folder), this might prompt to delete a folder from a different branch while missing the actual previous version of the current branch.
I guess it would be safer to loop through all folders found by `svn ls` and prompt for each?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: prompt before removing old SVN release folder during promotion [grails-core]
Posted by "sanjana2505006 (via GitHub)" <gi...@apache.org>.
sanjana2505006 commented on code in PR #15584:
URL: https://github.com/apache/grails-core/pull/15584#discussion_r3105774967
##########
.github/scripts/releaseDistributions.sh:
##########
@@ -61,9 +61,14 @@ svn_exists() {
old_release_folder="$(svn ls "${svn_flags[@]}" "${RELEASE_ROOT}" | awk -F/ 'NF{print $1; exit}')"
if [[ -n "${old_release_folder}" ]]; then
PRIOR_RELEASE_URL="${RELEASE_ROOT}/${old_release_folder}"
- echo "🗑️ Deleting old release folder: ${PRIOR_RELEASE_URL}"
- svn rm "${svn_flags[@]}" -m "Remove previous release ${old_release_folder}" "${PRIOR_RELEASE_URL}"
- echo "✅ Deleted old release folder"
+ read -r -p "Remove old release folder '${old_release_folder}' at ${PRIOR_RELEASE_URL}? [y/N] " confirm
+ if [[ "${confirm}" =~ ^[Yy]$ ]]; then
Review Comment:
Minor suggestion: The regex `^[Yy]$` is quite strict. It might be more user-friendly to support `yes` as well by using something like `[[ "${confirm}" =~ ^[Yy](es)?$ ]]`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: prompt before removing old SVN release folder during promotion [grails-core]
Posted by "jamesfredley (via GitHub)" <gi...@apache.org>.
jamesfredley merged PR #15584:
URL: https://github.com/apache/grails-core/pull/15584
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: prompt before removing old SVN release folder during promotion [grails-core]
Posted by "chloeb-smith (via GitHub)" <gi...@apache.org>.
chloeb-smith commented on code in PR #15584:
URL: https://github.com/apache/grails-core/pull/15584#discussion_r3106223098
##########
.github/scripts/releaseDistributions.sh:
##########
@@ -61,9 +61,14 @@ svn_exists() {
old_release_folder="$(svn ls "${svn_flags[@]}" "${RELEASE_ROOT}" | awk -F/ 'NF{print $1; exit}')"
Review Comment:
Thanks! This makes sense
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: prompt before removing old SVN release folder during promotion [grails-core]
Posted by "sanjana2505006 (via GitHub)" <gi...@apache.org>.
sanjana2505006 commented on code in PR #15584:
URL: https://github.com/apache/grails-core/pull/15584#discussion_r3105774305
##########
.github/scripts/releaseDistributions.sh:
##########
@@ -61,9 +61,14 @@ svn_exists() {
old_release_folder="$(svn ls "${svn_flags[@]}" "${RELEASE_ROOT}" | awk -F/ 'NF{print $1; exit}')"
if [[ -n "${old_release_folder}" ]]; then
PRIOR_RELEASE_URL="${RELEASE_ROOT}/${old_release_folder}"
- echo "🗑️ Deleting old release folder: ${PRIOR_RELEASE_URL}"
- svn rm "${svn_flags[@]}" -m "Remove previous release ${old_release_folder}" "${PRIOR_RELEASE_URL}"
- echo "✅ Deleted old release folder"
+ read -r -p "Remove old release folder '${old_release_folder}' at ${PRIOR_RELEASE_URL}? [y/N] " confirm
Review Comment:
Since the script already reads a password from stdin, there's a risk that this second read call will consume unintended data if the script is run in a way that redirects stdin.
To be safe, we should probably use `read ... < /dev/tty` for this confirmation prompt to ensure it always interacts with the terminal.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix: prompt before removing old SVN release folder during promotion [grails-core]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #15584:
URL: https://github.com/apache/grails-core/pull/15584#issuecomment-4274487380
<!-- Bito Reply -->
Yes, looping through all folders from `svn ls` and prompting for each would be safer in a multi-branch environment, as it avoids assuming the first folder is the correct one to delete. This prevents accidental removal of folders from other branches.
**.github/scripts/releaseDistributions.sh**
```
for folder in $(svn ls "${svn_flags[@]}" "${RELEASE_ROOT}"); do
folder=$(echo "$folder" | sed 's|/$||')
PRIOR_RELEASE_URL="${RELEASE_ROOT}/${folder}"
read -r -p "Remove old release folder '${folder}' at ${PRIOR_RELEASE_URL}? [y/N] " confirm
if [[ "${confirm}" =~ ^[Yy]$ ]]; then
echo "🗑️ Deleting old release folder: ${PRIOR_RELEASE_URL}"
svn rm "${svn_flags[@]}" -m "Remove previous release ${folder}" "${PRIOR_RELEASE_URL}"
echo "✅ Deleted old release folder"
else
echo "⏭️ Skipping removal of old release folder: ${PRIOR_RELEASE_URL}"
fi
done
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@grails.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org