<commit_before>require! {
  bluebird: Promise
  '../utils': { format-url }
  '../constants': { BUILD_KEYS }
  'data.maybe': Maybe
}
request = Promise.promisify require 'request'
debug = require '../debug' <| __filename

module.exports = (job-name, number) ->
  debug 'job-name=%s number=%d', job-name, number

  url = format-url "/job/#job-name/#number/api/json", {
    tree: BUILD_KEYS
  }

  request { url, +json }
    .spread (res, body) ->
      switch res.status-code
      | 200       => Maybe.Just body
      | otherwise => Maybe.Nothing!
<commit_msg>get-build: debug status code and body<commit_after>require! {
  bluebird: Promise
  '../utils': { format-url }
  '../constants': { BUILD_KEYS }
  'data.maybe': Maybe
}
request = Promise.promisify require 'request'
debug = require '../debug' <| __filename

module.exports = (job-name, number) ->
  debug 'job-name=%s number=%d', job-name, number

  url = format-url "/job/#job-name/#number/api/json", {
    tree: BUILD_KEYS
  }

  request { url, +json }
    .spread (res, body) ->
      debug res.status-code, body
      switch res.status-code
      | 200       => Maybe.Just body
      | otherwise => Maybe.Nothing!

{'fraction_non_alphanumeric': 0.16609880749574105, 'fraction_numerical': 0.005110732538330494, 'mean_word_length': 2.814935064935065, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2317649', 'n_tokens_mistral': 399, 'n_tokens_neox': 392, 'n_words': 94}