Skip to content

Commit

Permalink
feat(logs): add logs for pr creation fails
Browse files Browse the repository at this point in the history
  • Loading branch information
hulkoba authored and janl committed Aug 14, 2018
1 parent 914617a commit 022d0a2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions jobs/create-group-version-branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,9 @@ async function createPr ({ ghqueue, title, body, base, head, owner, repo, log })
repo
}))
} catch (err) {
log.warn('Could not create PR', { err })
if (err.code !== 422) throw err

const allPrs = await ghqueue.read(github => github.pullRequests.getAll({
base,
head: owner + ':' + head,
Expand Down
2 changes: 1 addition & 1 deletion jobs/create-initial-pr.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ module.exports = async function (
}
} catch (err) {
if (err.code !== 422) {
log.error('Could not create initial pr')
log.error('Could not create initial pr', {err})
throw err
}

Expand Down
9 changes: 6 additions & 3 deletions jobs/create-initial-subgroup-pr.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ module.exports = async function (
}
} catch (err) {
if (err.code !== 422) {
log.error('Could not create initial subgroup pr')
log.error('Could not create initial subgroup pr', {err})
throw err
}

Expand All @@ -125,8 +125,11 @@ module.exports = async function (
head: `${owner}:${head}`
})))[0]
log.warn('pr was already created', {pullRequestInfo: pr})
id = pr.id
number = pr.number

if (pr) {
id = pr.id
number = pr.number
}
}

await upsert(
Expand Down
2 changes: 2 additions & 0 deletions jobs/create-version-branch.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,9 @@ async function createPr ({ ghqueue, title, body, base, head, owner, repo, log })
repo
}))
} catch (err) {
log.warn('Could not create PR', { err })
if (err.code !== 422) throw err

const allPrs = await ghqueue.read(github => github.pullRequests.getAll({
base,
head: owner + ':' + head,
Expand Down

0 comments on commit 022d0a2

Please sign in to comment.