Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Solves issue #75 (i.e. squawk when ETA > .5) #76

Merged
merged 4 commits into from
Feb 20, 2018

Conversation

carlosmcgregor
Copy link

Add slave request in homu.js
Add appropriate interval w/ JSON iteration in server.js

Copy link
Member

@jdm jdm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start!

server.js Outdated

setInterval(function() {
homu.retrieveSlaves(function(slaves) {
for(var slaveName in slaves){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we avoid using tabs here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry! Must have left vim on paste mode. I'll fix that.

server.js Outdated
setInterval(function() {
homu.retrieveSlaves(function(slaves) {
for(var slaveName in slaves){
if(slaves[slaveName].hasOwnProperty("runningBuilds")){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do this instead, and unindent the next lines:

if (!("runningBuilds" in slaves[slaveName])) {
    continue;
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I'll make these changes, too.

server.js Outdated
if(slaves[slaveName].hasOwnProperty("runningBuilds")){
slaves[slaveName]["runningBuilds"].forEach(function(runningBuild){
if(runningBuild.eta > .5){
bot.say(config.channels[0], slaveName + " is past overdue! (ETA=" + runningBuild.eta + ")");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can make this output more useful by doing moment.unix(slaves[slaveName]["runningBuilds"]["times"][0]).fromNow() instead of the raw ETA value, which will provide us with a more readable string: https://momentjs.com/docs/#/displaying/fromnow/

This will require adding moment.js to the package.json and installing it locally, too.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I'll look into adding moment and implementing it here.

Add moment for more comprehensive notification
Change how slave iteration finds runningBuilds
Remove tabs
@carlosmcgregor
Copy link
Author

@jdm Finished with requested changes

@jdm jdm merged commit f893ed1 into servo:master Feb 20, 2018
@jdm
Copy link
Member

jdm commented Feb 20, 2018

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants