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

[pr body update] update stack list without overwriting PR title and body #780

Closed
wants to merge 2 commits into from

Conversation

vuduchild
Copy link
Contributor

@vuduchild vuduchild commented Nov 22, 2023

The current behavior of PR updates is flawed - every time one submits a new version of a PR, it is followed by an update of the title and description body of the PR. Often, the PR author would edit the PR title in Github's web UI after submission, to find their marvelous prose offhandedly deleted by Sapling.

In this diff I'm introducing a new config option (github.preserve-pull-request-description) to control this overwrite behavior. With the option turned on, subsequent updates only overwrite the stack listing in the PR description to reflect PR stack changes, while the actual PR description and title are left alone.

Here's the new behavior in detail:

  • A new PR is submitted using sl pr submit
    • The title and description are created out of the commit message.
  • The author updates the title and description in the Github web UI
  • The author makes changes in their local repo, amends and and runs sl pr submit again
    • The PR title is left alone.
    • The PR description is left alone, except for the stack list at the bottom which gets updated

At this point, I've set the option to default to False to avoid surprising current users, preserving current (albeit flawed) behavior. However, I believe over time this should default to True. The reasoning being that technically the local commit and remote PR should be 2 separate entities (a PR may contain more than one commit etc).

Test:

  • Submit a PR
  • Edit the title and description of the PR to make it different than the default commit message content.
  • Create another PR stacked on top of the first one
  • Submit the new PR
  • Observe the old PR now has a stack list
  • Amend either of the PRs locally with a new change
  • Submit an update to the stack
  • Verify the PR titles and descriptions have not changed.

NOTE: This PR is dependant on downstream #779 which fixes a bug affecting the parsing and detection of the stack list in the PR description.


@facebook-github-bot
Copy link
Contributor

Hi @vuduchild!

Thank you for your pull request.

We require contributors to sign our Contributor License Agreement, and yours needs attention.

You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot
Copy link
Contributor

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@vuduchild has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@vuduchild has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@vuduchild has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@amyworrall
Copy link

I really want this behaviour! Looking forward to the PR landing.

@facebook-github-bot
Copy link
Contributor

@quark-zju merged this pull request in 802ae02.

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.

3 participants