Using and Mastering Cookiecutter Transcripts
Chapter: Adding features to Cookiecutter
Lecture: Creating the PR

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


Talk Python's Mastodon Michael Kennedy's Mastodon