Skip to content

Add "Manual non-cherry-picks" section to PR description#19

Open
DilumAluthge wants to merge 2 commits intoKristofferC:masterfrom
DilumAluthge-forks:dpa/pr-description-manual-commits
Open

Add "Manual non-cherry-picks" section to PR description#19
DilumAluthge wants to merge 2 commits intoKristofferC:masterfrom
DilumAluthge-forks:dpa/pr-description-manual-commits

Conversation

@DilumAluthge
Copy link
Copy Markdown
Contributor

Fixes #18

Example of what it might look like for the 1.12.5 backports PR:

Screenshot:

Screenshot 2026-01-19 at 13 46 45

@DilumAluthge DilumAluthge force-pushed the dpa/pr-description-manual-commits branch from e3182b5 to 835f7ab Compare January 20, 2026 20:22
@DilumAluthge DilumAluthge force-pushed the dpa/pr-description-manual-commits branch 2 times, most recently from 8ba7b55 to df67100 Compare January 28, 2026 03:43
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 28, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 62.90323% with 23 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@8e85a3d). Learn more about missing BASE report.

Files with missing lines Patch % Lines
backporter.jl 45.23% 23 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff            @@
##             master      #19   +/-   ##
=========================================
  Coverage          ?   25.61%           
=========================================
  Files             ?        6           
  Lines             ?      859           
  Branches          ?        0           
=========================================
  Hits              ?      220           
  Misses            ?      639           
  Partials          ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DilumAluthge DilumAluthge force-pushed the dpa/pr-description-manual-commits branch from df67100 to 86e858d Compare January 28, 2026 03:50
@DilumAluthge DilumAluthge marked this pull request as ready for review February 24, 2026 20:49
@DilumAluthge
Copy link
Copy Markdown
Contributor Author

@IanButterworth @KristofferC - what do you think - does this seem like something worth having?

@IanButterworth
Copy link
Copy Markdown
Collaborator

I don't quite follow this. Backporter cherry picks commits onto a branch, then makes a PR description for it... How are manually added commits getting in there? Sorry if I'm being slow.

Also, Claude found issues:


Review of PR #19: Add "Manual non-cherry-picks" section to PR description

The feature idea is sound, but there are several bugs in the get_cherry_picked_commits
implementation that would cause runtime errors.


Bug 1 — commit_message_lines is undefined (backporter.jl, non-cherry-pick branch)

title = strip(commit_message_lines[2])

This variable is never defined. The intent (based on the surrounding comment) is to split
msg by newline. It should be:

commit_message_lines = split(msg, '\n')
title = strip(commit_message_lines[2])

Bug 2 — commit is undefined (same block)

commit_info = NonCherryPickedCommit(; sha = commit, title)
# ...
commit_info = NonCherryPickedCommit(; sha = commit, title, pr_num)

The loop variable is hash, not commit. Both occurrences of commit here should be hash.


Bug 3 — NonCherryPickedCommit.pr_num type is wrong

The struct declares:

Base.@kwdef struct NonCherryPickedCommit
    sha::String
    title::String
    pr_num::String
end

But pr_num is omitted when no PR number is found:

commit_info = NonCherryPickedCommit(; sha = commit, title)

@kwdef requires a default value for fields that may be omitted. This will throw a
MethodError at runtime. Fix:

pr_num::Union{Nothing, String} = nothing

The summarize_commit function already checks commit.pr_num === nothing, so the
downstream logic is correct — only the struct definition needs updating.


Bug 4 — --oneline and --pretty=format:"%H" conflict

log_str = read(`git log --oneline --pretty=format:"%H" $base...$against`, String)

--oneline is shorthand for --pretty=oneline --abbrev-commit. When combined with an
explicit --pretty, the last flag wins and --oneline is a silent no-op. Just use
--pretty=format:"%H" alone.


Missing test coverage for the non-cherry-pick path

All three test cases only assert @test isempty(non_cherry_picks). There is no test that
places a genuine non-cherry-picked commit on the backports branch and verifies that it is
detected with the correct sha, title, and pr_num. The bugs above would not be caught
by the current test suite.


Minor — typo in comment

# we'd prefer to use chrononological order

chrononologicalchronological

@DilumAluthge
Copy link
Copy Markdown
Contributor Author

How are manually added commits getting in there?

When people manually make a PR that targets backports-release-*, and then merge that PR.

@IanButterworth
Copy link
Copy Markdown
Collaborator

So backports-release-* exists before backporter is run? Usually it doesn't exist and is a fresh copy of release-*

Or do you mean when the PR is already open? I didn't think Backporter could be used once open.. but maybe it makes sense there?

@DilumAluthge
Copy link
Copy Markdown
Contributor Author

  1. Person A (e.g. Kristoffer) runs Backporter, pushes the backports-release-* branch, and opens the backports PR.
  2. Person B manually opens a PR that targets backports-release-*, usually with some manual fix that only applies to that Julia version. And then someone merges that PR

Now the backports PR description doesn't have any mention of the manual PR.

You can replace step 2 with "BumpStdlibs.jl makes a PR that targets backports-release-*", to the same effect.

@DilumAluthge
Copy link
Copy Markdown
Contributor Author

I didn't think Backporter could be used once open.

This is unrelated to this PR, but you can definitely re-run Backporter multiple times, right? And then just push the updated branch, and edit the PR with the new description.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Include "manual" (non-cherry-picked) commits somewhere in the auto-generated PR description

3 participants