Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gha: fix /backport command #23602

Merged
merged 1 commit into from
Oct 2, 2024
Merged

gha: fix /backport command #23602

merged 1 commit into from
Oct 2, 2024

Conversation

andrewhsu
Copy link
Member

@andrewhsu andrewhsu commented Oct 2, 2024

jira: PESDLC-2118

The /backport command is broken if there is more than 1 commit in a PR because the list of git commits have newlines:

bash$ backport_commits=$(gh api "repos/redpanda-data/redpanda/pulls/23492/commits" --paginate --jq '.[].sha[0:10]')
bash$ echo "backport_commits=$backport_commits"
backport_commits=c254729c5a
9a5f7d7d58
2bc21e9516
c9223a24ae

This patch fixes by having the commits separated by spaces:

bash$ backport_commits=$(gh api "repos/redpanda-data/redpanda/pulls/23492/commits" --paginate --jq '[.[].sha[0:10]]|join(" ")')
bash$ echo "backport_commits=$backport_commits"
backport_commits=c254729c5a 9a5f7d7d58 2bc21e9516 c9223a24ae

see #23492 (comment)

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v24.2.x
  • v24.1.x
  • v23.3.x

Release Notes

  • none

Broken if there is more than 1 commit in a PR because the git
commits have newlines.

This patch fixes by having the commits seprated by spaces.
@andrewhsu andrewhsu requested a review from a team as a code owner October 2, 2024 19:53
@andrewhsu andrewhsu requested review from jackietung-redpanda and removed request for a team October 2, 2024 19:53
@andrewhsu andrewhsu requested a review from oleiman October 2, 2024 19:54
Copy link
Member

@oleiman oleiman left a comment

Choose a reason for hiding this comment

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

lgtm.

am i correct to assume this also fixes the missing commit sha's in #23573?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants