cliffano / nestor

Jenkins CLI and node.js client
http://blog.cliffano.com/tag/nestor/
MIT License
182 stars 27 forks source link

Wait for build to start before streaming the console #39

Closed joelittlejohn closed 8 years ago

joelittlejohn commented 8 years ago

Ensure that when you trigger a job like:

nestor build --console myjob

the console output is associated with the newly created build (and not the previous build) even if the newly created build takes longer than 5 seconds to start.

This change involves using the 'Location' returned when a job is triggered to monitor the new build and proceed to stream the console only when the API indicates that the build has started. nestor will poll the monitoring URL every 2 seconds, up to a maximum of 30 seconds (when it will give up).

@cliffano let me know if you want me to change anything. I'm not primarily a js developer so I might have missed some better ways to do things 🙂

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-1.5%) to 97.05% when pulling eb3fde95228640637961e6c47efeab37e7411466 on joelittlejohn:fix-console into dd1419563df8afb1ec59aa01c7be1a4ffb6940ff on cliffano:master.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-1.5%) to 97.05% when pulling 28775812adf621ff7547eafa35dd791668bcde2c on joelittlejohn:fix-console into dd1419563df8afb1ec59aa01c7be1a4ffb6940ff on cliffano:master.

joelittlejohn commented 8 years ago

@cliffano let me take a look at adding some more tests today.

cliffano commented 8 years ago

The code change looks good. Looking forward to the tests.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-0.1%) to 98.457% when pulling 93099b5e491b63cdcfdb53a9f91dcb375165f3a7 on joelittlejohn:fix-console into dd1419563df8afb1ec59aa01c7be1a4ffb6940ff on cliffano:master.

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.06%) to 98.613% when pulling af36951b8942852b85619d6648a8739c513a4510 on joelittlejohn:fix-console into dd1419563df8afb1ec59aa01c7be1a4ffb6940ff on cliffano:master.

coveralls commented 8 years ago

Coverage Status

Coverage increased (+0.06%) to 98.613% when pulling 6e91dce4b6549bfebcb8391704e66fd4cd89b346 on joelittlejohn:fix-console into dd1419563df8afb1ec59aa01c7be1a4ffb6940ff on cliffano:master.

joelittlejohn commented 8 years ago

@cliffano I think I'm all done here, please feel free to take another look and let me know if you want me to adjust anything.

Cheers

cliffano commented 8 years ago

@joelittlejohn Thanks very much for the contribution, Joe. Much appreciated. I will release a new version of Nestor tonight.

joelittlejohn commented 8 years ago

Great. No problem. Nestor has been really useful for my team and me so I'm happy to contribute.

Looking forward to 0.3.6 😃

cliffano commented 8 years ago

v0.3.6 has been released. https://www.npmjs.com/package/nestor Thanks again!