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

twitter logo github logo ・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.

twitter logo DISCUSS (15)
markdown guide
 

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.

now there is 'add to batch' which would actually do, what you want

 

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.

 

Ran into the same issue. Finally found the suggestion icon to the left of the font / bold / italics.

suggestion

 

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

 

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.

 

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 Nov 15 '18

Don't be a mockup developer

Many times as a mobile developer I have to work on apps without the API ready that was crucial for the feature I was implementing. Either the backend was developed by another team that was not entirely in sync with us or our backend team had no chance to implement those endpoints earlier. For this reason, I was not able to satisfy the Definition of Done but it does not mean that I have implemented the UI only.

Ben Halpern profile image
A Canadian software developer who thinks he’s funny.

Sore eyes?

dev.to now has dark mode.

Go to the "misc" section of your settings and select night theme ❤️