Have you used the new "suggested changes" in GitHub pull requests?

ใƒป1 min read

These are pretty cool! "Suggested Changes" are in public beta and allow you to pitch code alterations which can be one-click merged.

You can apply a suggested change directly in a pull request if you have write access to the repository and are the author of or assigned to the pull request.

Guide

I have not actually made use of this yet. Have you? What is your opinion either way.

DISCUSSION (13)
 

Tried it the other day, but it didn't seem to work for multi-line suggestions. If you type multiple lines all of them will replace the one line you originally clicked on, which is not super useful for me.

 

An attempt to rewrite the whole PR from the scratch should not be encouraged by the toolset :)

 

I'm not attempting to rewrite a whole PR, but sometimes you just want to split a method into two, or completely rewrite it.

 

We've used here for simple changes, like changing the i18n strings. It worked very well, but it'd be great to have more changes per commit. It creates a commit for every change.

 

What is considered a single change? How do they limit it at the moment?

 

Not that they're limiting. Like, if you have 5 fixes that you can pack into a single commit, this new suggestion feature will do it, but won't pack into a single commit. Instead, it will create 5 commits. That can be an issue if you have CI, that will cause to trigger it 5 times.

 

Is it just me or is the way to suggest changes completely non-obvious? In which case I'm really surprised and confused why it is not mentioned here in the post or in the comments, or even linked to. I had to google for several minutes to figure out the syntax to put in a review comment:


```suggestion
        <div class="col-sm-10 col-md-8 col-lg-6 p-2">```

except maybe with a newline before the last triple backticks.

 

Tried it, already. It's useful for very small spiffs. Can be useful for reducing some of the time lost to "request changes" โ†’ "add requested changes" โ†’ "re-review" ...but really if there's only like one or two spiffs and each spiff is a couple characters.

 

This is super helpful for grading. I normally do code snippets within PR comments, this will make that look even better!

 
 
 

I haven't used it yet.

While I like the idea of quickly suggesting changes, I prefer pull request as you can run tests using services like Travis Ci before merging

 

Suggested changes only work in common with pull requests. Say, user A creates a new PR. User B reviews it, finds a typo and suggests a change to fix the typo. User A can then accept that change, which results in another commit to the PR that includes the suggested change.

You still have the advantage of Travis CI and so on, but the review process is accelerated when there are only small changes requested.

Classic DEV Post from May 25 '18

Stop saying you dont have time!

This week I want to talk about something that I have used for a excuse quite a few times. Before I finally started getting a schedule going. And that is saying the excuse I donโ€™t have time to learn blank.

A Canadian software developer who thinks heโ€™s funny.
Join dev.to