Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

show the branch a commit is going to

  • Loading branch information...
commit 686ca4e016ebf013a2058d8530fa049fb532db6b 1 parent 6459077
@wfleming wfleming authored
Showing with 4 additions and 1 deletion.
  1. +3 −0  github.coffee
  2. +1 −1  views/_commit.html
View
3  github.coffee
@@ -20,13 +20,16 @@ class Github extends events.EventEmitter
@build()
build: () ->
+ console.log('your payload is now', @payload)
project = helpers.discretify(@payload.repository.name, settings.discretionList)
+ branch = @payload.ref.replace('refs/heads/', '')
for commit in @payload.commits
data =
message: commit.message
timestamp: commit.timestamp
author: commit.author.name
project: project
+ branch: branch
image: gravatar.url(commit.author.email, {s:120})
relTime: moment(commit.timestamp).fromNow()
@commits.push(data)
View
2  views/_commit.html
@@ -4,7 +4,7 @@
<p>${message}</p>
<footer>
<p>
- ${project} - ${author}
+ ${project}/${branch} - ${author}
<span class="time"> - ${relTime}</span>
</p>
</footer>

7 comments on commit 686ca4e

@rodreegez
Owner

This is cool and has been bothering me, thanks!

I was wondering though, are we only really interested in commits on development as these are the commits that CI builds? If so, it'd be cool to be able to specify which branches you are interested in, either by storing something in Redis or by setting an env var. What do other folks think? I'd be happy to take a crack at it if it's something we want...

Either way this is cool!

@wfleming
Owner

I was thinking about that issue a bit while writing this. I think redis configurable inclusions or exclusions would be useful for sure. I feel like we definitely care about dev, & probably feature branches, but not staging or master as much.

I was actually thinking about adding a deploy ingester and adding a hook to our cap scripts so we could get deploy notifications, as well.

@appleton

I'm in the middle of a generic notification endpoint so maybe I'll push the branch and the deploys can just post to that?

@wfleming
Owner
@bob-p
Owner

Sounds good - push a branch and we can take a look!

@appleton

Sweet - tomorrow morning (my laptop is at work)

@appleton

Ok, pushed - I'm thinking we rename the Commits key in redis to something more generic - messages maybe, and run everything (commits and generic messages) through the same template. This will be much easier than pulling data from two places and then merging &sorting it each time we want to render the page.

I've built the endpoint module (although it may need more work) and was planning to update the templates accordingly. I've also renamed _commit.html and _commits.html to _message.html and _messages.html

Please sign in to comment.
Something went wrong with that request. Please try again.