sapling icon indicating copy to clipboard operation
sapling copied to clipboard

`sl pr submit` overwrites PR title and description

Open aliceliu opened this issue 3 years ago • 8 comments

It seems like running sl pr submit always updates the PR title and description. Is there a way to disable this behavior so it doesn't overwrite the title and description updates I make on Github? It would also be nice if sl pr submit uses the existing pull request template when creating the PR for the first time.

For context my repo has a pull request template and I usually fill out the details on github.com after creating the PR, so having sl pr submit overwrite this anytime I make changes is not ideal. I could use sl push to get around this but that doesn't handle updating the whole stack.

aliceliu avatar Nov 23 '22 19:11 aliceliu

Currently there isn't a way of disabling this behavior or to integrate templates into this, as far as I know. Let me see what we can do about this.

sggutier avatar Nov 23 '22 19:11 sggutier

Perhaps #191 could be a thing to look at at the same time, in case the changes required for this issue could also be made to support that?

elegios avatar Nov 25 '22 11:11 elegios

I agree we should improve this, but FYI, sl pr submit rewrites your pull request body using the current contents of your commit message. If you ended up writing the changes back to your commit message, things would work out, but I realize that's annoying.

I'll see what we can do here.

bolinfest avatar Dec 17 '22 08:12 bolinfest

This makes sapling pretty unusable. I need to edit the PR description separately from the commit message.

  • Pushing a commit for every description edit is overkill, starts a new CI build, spams PR history
  • I need to add stuff like screenshots and tables, this is hard to do in the terminal.

From my time at meta the way it worked was that after you updated a diff title/description in the UI, it would be "out of sync" and stop updating it when a new version was submitted. There was a hg sync command that would update your commit message with the latest UI's version as well to bring them back in sync.

@bolinfest Right now I'm running my own build with the code that updates PRs commented out. Something like I described above would be awesome. Would you be open to a stopgap solution that simply disables updating PRs after the initial creation with a config flag?

ui.update_gh_pr = false

I would be happy to contribute this

lazopm avatar Apr 13 '23 09:04 lazopm

Could we get any update or action item on this? If @lazopm can contribute on this, that will be great

wonjae-2352 avatar Jun 13 '23 17:06 wonjae-2352

A --no-rewrite-body argument for submit could be also be a step towards adjusting this behavior. If that's easier as a first step. It'd make sapling much more usable. Users can alias pr submit with this argument as needed.

chrisirhc avatar Jun 29 '23 10:06 chrisirhc

I've submitted #780 to propose one possible way of addressing this issue - by only updating the stack list section of the PR description while leaving the title and rest of the body intact.

vuduchild avatar Nov 22 '23 15:11 vuduchild

Currently there isn't a way of disabling this behavior or to integrate templates into this, as far as I know. Let me see what we can do about this.

I did land https://github.com/facebook/sapling/pull/633 to allow for templates, but it requires the latest build of sapling. I also was able to use it for templates in my local extension build, but it doesnt seem to work with the real extension still yet (perhaps I could get some help debugging this by someone with more knowledge, is there a special version of sapling used by the extension?)

alex-statsig avatar Nov 24 '23 14:11 alex-statsig