How can I detect if a build was triggered by a cron job using the Travis.rb gem?


#1

Hello,

I didn’t find very much in the Travis.rb documentation about cron, and when I did a search of the web UI to see how you’re populating that cron badge in the list of builds, you’re using a property of the build object called an event type: builds-item.js.

When I looked in the travis.rb gem, the only method I could find dealing with an event type is part of the requests endpoint, it wasn’t a property of the build itself. The requests endpoint only lists the past 25 requests, and sometimes my repo has more activity than 25 requests’ worth in a 24-hour period. Is there any way to add this event_type property to the Travis::Client::Build class in the Ruby gem, similar to how you’re accessing it in the web UI? Is there somewhere in the Travis::Client::Build class that this information gets exposed? Would there be any way to expose more than 25 requests as an enumerable, similar to what you do with Repository#builds in the gem?

I’m really just after the build data for the most recent cron-triggered build. Any way that I can get to that will be a big help.

Thank you!