DEV Community

Cover image for GitHub draft PRs are here!
Nick Taylor (he/him)
Nick Taylor (he/him)

Posted on • Updated on • Originally published at iamdeveloper.com

GitHub draft PRs are here!

Photo by EJ Yao on Unsplash

Gone or soon to be gone are the days of creating a PR and marking it as WIP or DON'T MERGE!

For galentine's, GitHub has given us Draft PRs

Happy Galentine's

I think it's great. What are your thoughts on draft PRs?

SNL Coffee Talk

Discussion (18)

Collapse
ben profile image
Ben Halpern

Cool, love this!

Collapse
rhymes profile image
rhymes

A great thing about this is that you can set them up so that they don't ping the reviewers until the PR is ready:

Also, if you have a CODEOWNERS file in your repository, a draft pull request will suppress notifications to those reviewers until it is marked as ready for review.

from github.blog/2019-02-14-introducing...

Collapse
bennypowers profile image
Benny Powers ๐Ÿ‡ฎ๐Ÿ‡ฑ๐Ÿ‡จ๐Ÿ‡ฆ

Nice to see more gitlab features coming to github ;P

Collapse
annlin profile image
ann lin

Farewell 'NOTE: DO NOT MERGE' ๐Ÿ˜‚

Collapse
forstmeier profile image
John Forstmeier • Edited

Seems interesting; my group tends to do something like mark a PR as incomplete with a WIP in the title so this could be a more "formal" version of that.

Collapse
andy profile image
Andy Zhao (he/him)

That's currently what we do, too. We use that together with the WIP Probot. Maybe we'll switch to drafts though?

Collapse
forstmeier profile image
John Forstmeier

I'd expect that, yeah. Drafts seem to fit with that workflow.

Collapse
prasanna1985samal profile image
prasanna1985samal

app.js
import React, { useState } from 'react';
import './App.css';
import "bootstrap/dist/css/bootstrap.min.css";
import AddNote from './components/addNote';
import NoteCard from './components/noteCard';

function App() {

ย  const [noteCount, setNoteCount] = useState(localStorage.getItem('noteObjCount') || 0);

ย  const addNote = () => {

ย  ย  setNoteCount(parseInt(noteCount)+1);

ย  };

ย  const deleteNote = (count) => {

ย  ย  setNoteCount(count);

ย  };

ย  return (

ย  ย 



ย  ย  ย 

ย  ย  ย 

ย 

ย  );

}
Collapse
park53kr profile image
Junsuk Park

Is there any way to change normal PR to draft PR after creating the PR?

Collapse
nickytonline profile image
Nick Taylor (he/him) Author

Not yet. See this thread.

Collapse
molly profile image
Molly Struve (she/her)

I have been waiting for this!!! I have never been a fan of WIP PRs bc I think they can distract from those PRs that actually need to get merged and pushed out.

Collapse
themulti0 profile image
Multi

I like it, but I do not understand why you should even open a pull request before you are ready to merge changes.

Collapse
mscccc profile image
Mike Coutermarsh

ooh, I have lots of thoughts on this! ๐Ÿ˜ƒ

I like to do it as a way to get feedback on code before it's ready.

I'll open a draft PR, then my teammates can comment on specific lines of code. The entire discussion stays in one thread.

For larger changes, I've also used it as a way to communicate progress. I'll open a draft PR, and then write out a check list showing what's done and what isn't. Then anyone following along is able to see where I'm at with the project. ๐Ÿ˜ƒ

Collapse
themulti0 profile image
Multi

I see - you mean if you have some changes you want to be reviewed but you do not want it to be merged because you aren't done yet.

Collapse
marissab profile image
Marissa B

That's pretty rad! I didn't know they were working on this.

Collapse
darkwiiplayer profile image
DarkWiiPlayer

Hasn't gitlab supported this for a while now? IIRC it actually has a checkbox for WIP pull requests and warns you before trying to merge one, lets you filter by WIP, etc.

Collapse
defman profile image
Sergey Kislyakov ๐Ÿ‡ท๐Ÿ‡บ ๐Ÿ‡บ๐Ÿ‡ธ

It has. There's a checkbox that adds WIP: to the PR title and prevent merging it until you remove it from the title.

Collapse
shenril profile image
Shenril • Edited

Hmm I actually prefer the way Gitlab does it ... (If WIP is in the name, automatically consider it Draft)
You cannot convert normal PR yet... It's rather hard to notice the option itself ...