Skip to content

maint(linux): improve getting PR# in upload-to-debian.sh 🍒 🏠#14785

Merged
ermshiperete merged 2 commits intostable-18.0from
maint/linux/cherry-pick/debianupload
Sep 22, 2025
Merged

maint(linux): improve getting PR# in upload-to-debian.sh 🍒 🏠#14785
ermshiperete merged 2 commits intostable-18.0from
maint/linux/cherry-pick/debianupload

Conversation

@ermshiperete
Copy link
Copy Markdown
Contributor

With this change we wait two seconds after creating the PR before trying to get the number of the PR so that GitHub can catch up. Previously recently it wasn't able to get the PR#.

Also adjust the commit message and use the new header for skipping tests.

Cherry-pick-of: #13890
Build-bot: skip
Test-bot: skip

With this change we wait two seconds after creating the PR before trying
to get the number of the PR so that GitHub can catch up. Previously
recently it wasn't able to get the PR#.

Also adjust the commit message and use the new header for skipping tests.

Cherry-pick-of: #13890
Build-bot: skip
Test-bot: skip
@keymanapp-test-bot
Copy link
Copy Markdown

User Test Results

Test specification and instructions

User tests are not required

@github-actions github-actions bot added linux/ cherry-pick Change already merged into another (stable) branch labels Sep 18, 2025
@keymanapp-test-bot keymanapp-test-bot bot changed the title maint(linux): improve getting PR# in upload-to-debian.sh 🍒 maint(linux): improve getting PR# in upload-to-debian.sh 🍒 🏠 Sep 18, 2025
@keymanapp-test-bot keymanapp-test-bot bot added this to the A19S12 milestone Sep 18, 2025
Comment on lines 111 to 113
${NOOP} gh pr create --draft --base "${BASE}" --title "${PR_TITLE}" --body "${PR_BODY}"
sleep 2s
PR_NUMBER=$(gh pr list --draft --search "${PR_TITLE}" --base "${BASE}" --json number --jq '.[].number')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From https://cli.github.com/manual/gh_pr_create:

Upon success, the URL of the created pull request will be printed.

Could we just parse that out? It should be easy enough because the URL is pretty stable, e.g.:

https://github.com/keymanapp/keyman/pull/14785

Suggested change
${NOOP} gh pr create --draft --base "${BASE}" --title "${PR_TITLE}" --body "${PR_BODY}"
sleep 2s
PR_NUMBER=$(gh pr list --draft --search "${PR_TITLE}" --base "${BASE}" --json number --jq '.[].number')
PR_URL=$(gh pr create --draft --base "${BASE}" --title "${PR_TITLE}" --body "${PR_BODY}")
PR_NUMBER="${PR_URL##*/}"

I am not sure about the NOOP interactions, but then on a no-op, isn't getting PR_NUMBER going to fall over anyway?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent idea to do it this way. I didn't know/notice that it only spits out the URL if you assign it to a variable.

Comment on lines +200 to +201
"Cherry-pick-of: #${PR_NUMBER}
Test-bot: skip"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to add Build-bot commands too? Is a build needed?

COMMIT_MESSAGE="chore(linux): Update debian changelog"
git commit -m "${COMMIT_MESSAGE}"
push_to_github_and_create_pr chore/linux/changelog "${DEPLOY_BRANCH#origin/}" "${COMMIT_MESSAGE}" "@keymanapp-test-bot skip"
push_to_github_and_create_pr chore/linux/changelog "${DEPLOY_BRANCH#origin/}" "${COMMIT_MESSAGE} 🏠" "Test-bot: skip"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build bot commands?

- directly get PR# from `gh pr create`
- add `Build-bot: skip` trailers

Build-bot: skip
Test-bot: skip
ermshiperete added a commit that referenced this pull request Sep 19, 2025
- directly get PR# from `gh pr create`
- add `Build-bot: skip` trailers
- 🍒-pick of the improved 🍒-pick #14785

Cherry-pick-of: #14785
Build-bot: skip
Test-bot: skip
Copy link
Copy Markdown
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ermshiperete ermshiperete merged commit d5ddf5b into stable-18.0 Sep 22, 2025
9 checks passed
@ermshiperete ermshiperete deleted the maint/linux/cherry-pick/debianupload branch September 22, 2025 10:12
@github-project-automation github-project-automation bot moved this from Todo to Done in Keyman Sep 22, 2025
@keyman-server
Copy link
Copy Markdown
Collaborator

Changes in this pull request will be available for download in Keyman version 18.0.242

cvosoft pushed a commit to cvosoft/keyman that referenced this pull request Oct 23, 2025
- directly get PR# from `gh pr create`
- add `Build-bot: skip` trailers
- 🍒-pick of the improved 🍒-pick keymanapp#14785

Cherry-pick-of: keymanapp#14785
Build-bot: skip
Test-bot: skip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick Change already merged into another (stable) branch linux/ stable

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants