>> And I'm John Papa.
>> I'm Phil Haack.
>> Hey, thanks for coming Phil.
>> Yeah.
>> Thanks for coming Phil. I left you hanging.
>> You were like that, I thought you were
ready for handshake, I was like I owe it to you. Okay.
[MUSIC]
>> Today, we're going to talk about five things
about GitHub and I'm John Papa.
>> I'm Phil Haack.
>> Hey thanks for coming Phil.
>> Thank you.
>> Appreciate it. Hey, high-five, all right.
So, about GitHub, I've been using GitHub for years I know,
you've been there almost since the beginning, is that right?
>> Yeah. Well, not from the beginning,
but I've been there six and a half years and quite a long time.
>> Yeah, so you know
just about everything there is to know about GitHub, right?
>> Yeah, I wish.
>> All right. So, a couple of things about this episode,
is you're going to teach us some things that,
maybe most people don't know about using GitHub,
such as white space.
>> Yeah. So, if you've ever used
GitHub pull request feature or Diffs,
you know that like white space changes,
sometimes you want to ignore them and you should be this half that
people do where you added question mark W equals one,
and what that meant was,
to ignore white space.
The problem is, you couldn't comment on PRs when you did that,
but recently we fixed that by adding an actual UI elements.
So now when you're looking at a portal review,
there'll be Diff options,
you click that button and it brings
the Dropdown and it gives you an options to either
use Unified or Split Diff and
also gives you an option to ignore white space,
and the best part is if you ignore the white space,
you can still comment on pull requests,
it retains that information.
>> That makes people who are reviewing open source
pull requests lives much easier, right?
>> Absolutely. You can focus on what the content of the changes
and I recommend applying
linters to deal with the white space differences.
>> Great. Thing number two, Project Board Automation.
So in GitHub, is this to help
with issues and PRs that can mount up in your projects?
>> Yes. If you're a project team,
whether you're working on open source or on
internal project managing sort
of when things happen and all that can be challenging,
so what not a lot of people know is that,
GitHub has project boards which are kind of like
Trello boards or Kanban boards is what some people call them,
and you can put items in swim lanes,
but what's really cool is,
when you create a board there's now project automation as well,
so you can say like,
oh when this issues close,
automatically move it from this column to this column.
What's really needed also is that,
a lot of real projects actually consists of a lot of
different repositories and so you can have one project board,
have a card that represents the status of another project board by
simply creating a note and cut and
paste the URL of the other project board,
and then that card will stay up to date
with the other project boards, so for example,
if you had like a Note Project then you are
also working on some dependencies,
you might have cards for each of
the dependencies that point to their project boards.
>> Oh, very cool and we can learn about that here from the link?
>> Right here.
>> Awesome.
>> We're going to get a Snapchat filter if I misbehave.
>> Probably, yes. Thing number three, GitHub Desktop.
I haven't used this recently,
so tell me what's changed and what's there?
>> So, the last time you used it,
we were two apps one for the Mac,
one for the Windows,
written in native technologies like WPF
and C Sharp on the Windows side, Objective C,
Swift and Cocoa on the Mac side,
and a couple of years ago,
we rewrote it in Electron.
So, for those who don't know Electron,
it's a cross-platform desktop technology based on
chromium and nodes so that you can use
your Web technologies to build a client application.
>> Apps like Atom, VS Code,
and Slack are built in Electron, right?
>> Exactly, yeah and so we've rebuilt desktop
on it and now it runs on Mac and Windows,
and there is a community effort to run it on Linux,
and what's really cool about it is,
it gives you a nice visualization for creating commits,
especially even if you're someone
who is really proficient in the command line,
you might use the Desktop App to create partial commits,
you might use it to check out a pull request for example,
because now our our branch dialogue list pull requests,
so you can say, oh I just want to change
that pull requests and take it out.
One of the other nice things about it,
if you're a command line user is,
if a lot of times you're running commands in the command line,
like you're running npm-run,
you can write GitHub space dot,
and dot represents the path,
so it could be any path,
but dot would be the current directory
and that'll launch GitHub Desktop
to the current directory and add that repo as an already tracks.
So, that's a quick way like I'm working on NPM model,
I'm ready to commit my changes, run GitHub dot,
select all the things you want to commit, create a commit,
and then there is a menu to
publish a pull request, all from Desktop.
>> Great. We can get it from here?
>> Yeah. Right there.
>> Right there?
>> Oh, there.
>> Right there.
>> Somewhere.
>> Somewhere right there. Right there.
>> Just doing this, I wanted to clap, I felt left out.
Thing number four, you recently
extended GitHub to accomplish something, can you talk about that?
>> Yeah, I wanted to add sentiment analysis
for issue comments on GitHub,
and I wanted it as a proof of concept,
the ideas you might want to know for example,
what is the overall sentiment of comments on
your repo and is there things you can do to keep it more positive?
And so what I did is I use a combination of
GitHub extension points along with
some Azure and Microsoft extension points.
>> Cool. Thing number five,
What's step one in creating this?
>> Well, the first thing I did is, create a webhook,
so GitHub repositories have
an extensibility point where you can set
up a webhook to send
a payload based on events that happened within GitHub,
like a new issues created-
>> PRs.
>> -all that stuff. You need something that
receives that webhook like a service
and setting up a whole service
for a webhook can be kind of a pain,
and I thought, oh, I want to check out
this new serverless thing and so I tried to add an Azure function.
And part of the reason is that,
I had heard that Azure Functions
specifically support GitHub webhook.
So when you create a function, you can say,
this is for a webhook and it actually stubs out
the method where the argument to the method is the GitHub payload-
>> Right.
>> -and it gives you
the URL that you need to post in your repository settings,
and then you're all set, you're up and running.
>> So, functions aren't just for HTTP backends,
you can also use GitHub webhooks.
>> Yeah.
>> That's great. Thing number six,
somebody posts an issue and you
have to analyze the text, how do you do that?
>> Well, I thought about hiring 1,000 people
to review every issue as it came in,
but what I realized was,
there were some really interesting AI out there
or Machine Learning algorithms that can do that,
but I don't know how to do that stuff,
so I looked at Microsoft Cognitive Services,
and they have really cool distinct services that are
very specific and focused on accomplishing a task,
and so I called the Textual Analysis Service,
and what's nice is, I could use NuGet
within Azure Functions to get the API,
use that to call that service,
do the text analysis and then
that would tell me where the sentiment of
the comment was positive or negative.
>> So, basically there's an API
with Cognitive Services where you just
pass in "Here's the text" and
it tells you kind of what that sentiment looks like.
>> Exactly. It even tells you what language that text is in,
if you needed that information, so it's really cool.
>> Very cool. Thing number seven,
once you've figured out the sentiment is, what do you do with it?
>> Well. So, what I wanted to do
is update the comment with the sentiment score,
but I did this as a proof of concept,
I highly recommend not having
a robot admonish people for being negative or positive.
>> Right.
>> But as a proof of concept,
I wanted to update the comment and so what I did was,
I used the Octokit which is our client API,
we have one for C Sharp and other languages
and use that to call our GitHub Web API.
So, we have an API that
gets you access to just about any data in GitHub.
We also want to put a plug-in,
we also have new GraphQL API,
so that's starting to get fleshed out and
gives you a lot more information.
But with the Octokit,
I was able to just find the comment,
find the issue that it was on,
and then update that comment with a sentiment score,
and if you go to this URL,
you can see it in action.
>> Is that your blogpost?
>> No. This one, is still the blogpost.
>> That's the blogpost.
>> Yeah.
>> This one is the Octokit?
>> That's the repository,
where I set up this webhook and if you post a comment to it,
it will show you the sentiment score.
>> Honest thing, not everybody has
your personal email address which is right here by the way,
so how do people keep up with changes in GitHub?
>> So, the great news is we have a new Changelog,
which is a log of changes.
>> Really?
>> Yeah, and if you go to this URL right there,
you'll see all the new features that are coming
or that have recently been released from GitHub.
So, it's a great way to keep track of all these new things,
because I know it can be hard to keep track of.
>> Excellent. Hey Phil, thanks for coming in, this has been great.
>> It's been my pleasure.
>> We've spend five things about GitHub.
[MUSIC]