Skip to content

Conversation

BlakeLReeves
Copy link

@BlakeLReeves BlakeLReeves commented Jul 23, 2025

Describe what this PR does / why we need it

This refactors and combines the two merge_pr implementations into one function that uses gh.run. It supports both explicit PR numbers and merging from the current buffer. Flag handling (like merge method, delete, queue) is now cleaner and more predictable.

Does this pull request fix one issue?

Fixes #875
Fixes #761

Describe how you did it

Consolidated merge logic into one function

Replaced Job:new() with gh.run

Cleaned up flag parsing and PR number detection

Describe how to verify it

Run any existing merge commands from a PR buffer (squash, rebase queue, etc.) and confirm they behave as expected.

Special notes for reviews

PR number must either be passed or come from the buffer.

Checklist

  • Passing tests and linting standards
  • Documentation updates in README.md and doc/octo.txt

@BlakeLReeves BlakeLReeves marked this pull request as ready for review July 23, 2025 03:18
@BlakeLReeves BlakeLReeves changed the title Blakereeves/875 and 761 consolidate gp pr merge logic and use gh run Blakereeves/875 and 761 consolidate gh pr merge logic and use gh run Jul 23, 2025
Comment on lines +1849 to +1852
if utils.is_number_like(params[1]) then
pr_number = tostring(params[1])
table.remove(params, 1)
end
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be handled with the run wrapper now

local gh = require "octo.gh"
gh.pr.merge { number } 

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

Successfully merging this pull request may close these issues.

Consolidate gh pr merge logic Use gh.run for utils.merge_pr
3 participants