GithubHelp home page GithubHelp logo

hacklanta / hubot-yardmaster Goto Github PK

View Code? Open in Web Editor NEW
13.0 13.0 6.0 90 KB

Hubot plugin to control jobs on Jenkins CI

Home Page: http://hacklanta.com/

License: MIT License

CoffeeScript 100.00%

hubot-yardmaster's People

Contributors

farmdawgnation avatar riveramj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hubot-yardmaster's Issues

List all jobs

Need to be able to list all jobs that are on jenkins currently

How does this bot suppose to work?

I have a hubot running fine in Slack. I now want to add the Jenkins functionality provided by this module.

I run it like this:

HUBOT_SLACK_TOKEN=*** HUBOT_JENKINS_URL=https://**** HUBOT_JENKINS_USER=**@***.*** HUBOT_JENKINS_USER_API_KEY=**** ./bin/hubot --adapter slack

I check that the bot still works. Then I call any of the commands provided by this module but nothing works...

Branch locking

It would be nice if yardmaster allow for branch locking when certain jobs are deployed. Essentially, this is intended to address the problem of two people on the same team not realizing that the other needs to use the job in question.

Opting-in to locking

Locking would be turned off by default. I would envision turning it on looking something like

Hubot, enable locking for

At this point, the Hubot knows what the default branch for the job in question is. You could likewise disable locking for a particular job.

Hubot, disable locking for

Switching when locking is active

When locking is active for a job, yardmaster will require some extra information in order to switch a build over to the non-default branch. To switch a job to a feature branch you'd need to provide something like the following:

Hubot, switch to for

At this point, the reason for the branch switch has been logged. When the developer who is doing the testing is finished, they can say

Hubot, switch to

And the build is now considered unlocked and free for anyone to switch. However, if another developer tries to come in and deploy a second feature branch on top of the first one, let's say Mike tried to deploy a feature branch while Antonio was testing something, something like the following exchange would occur:

Mike: Hubot, switch alan-shepherd to awesome-sauce
Hubot: Sorry, Mike. Antonio is using alan-shepherd to test super-cool-branch-name for "super secret testing reason" since 7/23/2014 at 10:00 AM EST.

At this point Mike has two options.

  1. Tell Antonio to hurry the heck up and have Antonio unlock the build.
  2. Force the switch.

Hubot, force switch to for

A force switch overrides the lock functionality, but ideally shouldn't be used unless the developer who was using the job is unreachable for some reason.

Ability to check whether a branch exists against Github repo for a job

When we ask hubot to switch a job to a branch, it would be handy to double-check whether that branch is valid before firing off a build that will fail.

Some thoughts:

  • This can be read from Jenkins config and cached in the brain.
  • Users who want it re-read would clear the brain (if it becomes a common use
    case, possibly providing an interface for it would make sense, but not for now).
  • Github credentials would be needed.
  • This would be optional, so if no github credentials are present, we could skip
    the validation altogether. Or, if the remote repo isn't in github, same deal.

RangeError on watch command

Running "hubot watch job " gives me the following error:

Aug 08 15:44:08 server hubot[3080]: [Mon Aug 08 2016 15:44:08 GMT+0200 (CEST)] INFO [Incoming] pontius: hubot watch job https://<server>/job/<jobname>
Aug 08 15:44:08 server hubot[3080]: [Mon Aug 08 2016 15:44:08 GMT+0200 (CEST)] INFO Message sent to hubot brain.
Aug 08 15:44:09 server hubot[3080]: [Mon Aug 08 2016 15:44:09 GMT+0200 (CEST)] ERROR RangeError: Maximum call stack size exceeded
Aug 08 15:44:09 server hubot[3080]:   at RegExp.test (native)
Aug 08 15:44:09 server hubot[3080]:   at trimUrl (/opt/hubot/node_modules/hubot-yardmaster/src/yardmaster.coffee:503:3, <js>:589:26)
Aug 08 15:44:09 server hubot[3080]:   at trimUrl (/opt/hubot/node_modules/hubot-yardmaster/src/yardmaster.coffee:507:5, <js>:593:14)
Aug 08 15:44:09 server hubot[3080]:   at trimUrl (/opt/hubot/node_modules/hubot-yardmaster/src/yardmaster.coffee:507:5, <js>:593:14)
Aug 08 15:44:09 server hubot[3080]:   at trimUrl (/opt/hubot/node_modules/hubot-yardmaster/src/yardmaster.coffee:507:5, <js>:593:14)
[...]

Modularize

I think it's probably time to modularize this thing a bit.

There are a few dividing lines I can see immediately... things like

  1. Core Jenkins interactions (auth/http methods/etc)
  2. "Job" things (e.g. changing the branch)
  3. "Build" things (reading output, watching)
  4. Helper methods.
  5. The message regexes etc

WDYT? Does this seem like a reasonable division? I could whip up a sample PR at some point soon if so.

ERROR TypeError: Cannot read property 'replace' of undefined

Hubot is reporting an error when running some commands but not all.

hubot show last build for

[Thu Sep 03 2015 17:19:10 GMT-0700 (PDT)] ERROR TypeError: Cannot read property 'replace' of undefined
at /home/jenkins-slave/jarvis/node_modules/hubot-yardmaster/src/yardmaster.coffee:214:17, :227:38
at /home/jenkins-slave/jarvis/node_modules/hubot-yardmaster/src/yardmaster.coffee:67:9, :37:16
at IncomingMessage. (/home/jenkins-slave/jarvis/node_modules/hubot/node_modules/scoped-http-client/src/index.js:95:22)
at IncomingMessage.emit (events.js:129:20)
at _stream_readable.js:908:16
at process._tickCallback (node.js:355:11)

output of job

i want to see the output of a job - either last or by id

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.