Using and Mastering Cookiecutter Transcripts
Chapter: Adding features to Cookiecutter
Lecture: Creating the PR
0:01 We've run our tests, we've added our feature,
0:03 we're pretty confident with the work we've done,
0:05 let's submit this back to Cookiecutter.
0:08 We'll come over to our source control here, this is our Cookiecutter repo,
0:12 not theirs and we're in our feature branch which means
0:16 that we can possibly make other pull request, and other changes to Cookiecutter
0:19 without this code being part of that, right,
0:22 we probably want to do this, isolate on their website reasonably
0:26 so it says please submit only one feature at a time with any given pull request,
0:31 one change, and the easiest way to do that is have one branch per change.
0:34 So, we're going to check into this, and this is super easy
0:38 but what we want to do is give it a nice description
0:41 so I'm going to write a little description here
0:44 and zoom ahead, and then tell you about it.
0:46 So, notice I'm even using Markdown here
0:48 because people are going to read this and decide whether or not
0:51 it should be added to that project, so you want to format this as best as you can,
0:54 so it will show up on GitHub.
0:57 So what I am going to say is if the YAML file config does not end with a single blank line
1:00 a cookiecutter exception invalid configuration exception is thrown
1:04 within indecipherable error, this pull request pretty much took this code from my docstring,
1:08 fixes that air by adding a trivial line to the config YAML file if it is missing, okay.
1:13 So let's go ahead and check that in,
1:17 now if we go back to GitHub, notice right now we already have this
1:22 I didn't even refresh the page I just found this says okay,
1:26 mikeyckennedy in forgiving YAML fix less than a minute ago,
1:30 and here's the compare and pull request
1:33 so we want to submit this, notice I am up in mikeyckennedy
1:36 I want to submit this to audreyr and everybody that works on this project
1:40 to say here's my fix, I want you to take.
1:42 So I'll click this, it's going to come down here,
1:45 and we should be able to take this change, let me go and copy that,
1:51 and I am going to use that basically that same text here,
1:54 if the YAML file does not contain a Cookiecutter and do this little shortening thing
2:01 but I'm going to put it back, exception this pull request fixes that okay.
2:12 So okay I'm going to give it a nice little subject up here,
2:14 fix this trivial error of config file when it does not end in a newline
2:17 has a description, let's preview it here, it has a little code bit for that thing,
2:21 alright I think it's good, let's go down here,
2:24 make sure the changes we've had don't change something else
2:27 we've got our .gitignore, and we've got our change to cookiecutter
2:30 so we've added the fix missing end line in YAML,
2:34 got our little bits there, and then in our git config,
2:37 notice I had just this straight read here before
2:40 and now we're doing it across a few lines
2:43 where we get the actual lines we apply our fix,
2:45 we turn it back into straight text and then we do what they did before
2:48 with the straight text, this time though it automatically fixes it.
2:51 Alright, so it looks like everything is good,
2:54 make sure that you have read the guidelines for contributing to this repository
2:58 verify that we can merge with master we're not out of sync or something
3:03 so that's really important, people don't want to do them merge conflict stuff
3:06 if at all possibly, you should do sort of rebase,
3:10 get the new version, apply your change again, to the latest if that happens.
3:13 Alright, let's go. Now we're over in audreyr,
3:17 you can see we have the 49th pull request,
3:21 actually 49 active, 917th pull request and here it is,
3:25 my changes, my description, files that have changed, the two commits,
3:30 and notice, I talked about the test being run, about the flake 8 and Python 3.3, 3.4,
3:37 notice here this is updates live, there is a continuous integration for app veyor,
3:43 I think is for Windows builds and Travis CI for Linux and Mac
3:46 I'm pretty sure that's how that works, but these are running
3:49 and these will automatically give the maintainers of Cookiecutter some feedback
3:54 to say this change that we just made, it either broke something
3:58 or it didn't break something with regard to code coverage
4:00 with regard to tests and whatnot, right.
4:03 So now we just wait and you'll be able to come here
4:06 and check out a pull request 917 after you watch this class
4:09 and see if this change was accepted or not accepted.