Skip to content

Commit

Permalink
More debugging tools for Peril
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed May 20, 2018
1 parent c5755a2 commit 4d1906b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

## Master

# 3.7.2-3
# 3.7.2-3-4

* Debugging when using the GitHub OctoKit - orta
* Improved debugging when using the GitHub OctoKit - orta

# 3.7.1

Expand Down
7 changes: 5 additions & 2 deletions source/platforms/github/comms/checksCommenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,11 @@ export const GitHubChecksCommenter = (api: GitHubAPI): PlatformCommunicator | un
}

const checkData = await resultsToCheck(results, options, pr, octokit)
await octokit.checks.create(checkData)
// const existingReport = octokit.issues
const response = await octokit.checks.create(checkData)
if (process.env.LOG_FETCH_REQUESTS) {
console.log("Got response on the check API")
console.log(JSON.stringify(response))
}
},

// These are all NOOPs, because they aren't actually going to be called
Expand Down
6 changes: 4 additions & 2 deletions source/runner/jsonToDSL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ const apiForDSL = (dsl: DangerDSLJSONType): GitHubNodeAPI | BitBucketServerAPI =
return new BitBucketServerAPI(dsl.bitbucket_server!.metadata, bitbucketServerRepoCredentialsFromEnv(process.env))
}

const api = new GitHubNodeAPI({
const options: GitHubNodeAPI.Options & { debug: boolean } = {
debug: !!process.env.LOG_FETCH_REQUESTS,
baseUrl: dsl.settings.github.baseURL,
headers: {
...dsl.settings.github.additionalHeaders,
},
})
}

const api = new GitHubNodeAPI(options)
if (dsl.settings.github && dsl.settings.github.accessToken) {
api.authenticate({ type: "token", token: dsl.settings.github.accessToken })
}
Expand Down

0 comments on commit 4d1906b

Please sign in to comment.