Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
c56362f6
Commit
c56362f6
authored
6 years ago
by
Rhys Arkins
Browse files
Options
Downloads
Patches
Plain Diff
refactor(github): better log query during error
parent
1ab9b09d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/platform/github/index.js
+6
-4
6 additions, 4 deletions
lib/platform/github/index.js
with
6 additions
and
4 deletions
lib/platform/github/index.js
+
6
−
4
View file @
c56362f6
...
@@ -840,6 +840,7 @@ async function createPr(
...
@@ -840,6 +840,7 @@ async function createPr(
async
function
getOpenPrs
()
{
async
function
getOpenPrs
()
{
if
(
!
config
.
openPrList
)
{
if
(
!
config
.
openPrList
)
{
config
.
openPrList
=
{};
config
.
openPrList
=
{};
let
query
;
try
{
try
{
const
url
=
'
graphql
'
;
const
url
=
'
graphql
'
;
// https://developer.github.com/v4/previews/#mergeinfopreview---more-detailed-information-about-a-pull-requests-merge-state
// https://developer.github.com/v4/previews/#mergeinfopreview---more-detailed-information-about-a-pull-requests-merge-state
...
@@ -847,7 +848,7 @@ async function getOpenPrs() {
...
@@ -847,7 +848,7 @@ async function getOpenPrs() {
accept
:
'
application/vnd.github.merge-info-preview+json
'
,
accept
:
'
application/vnd.github.merge-info-preview+json
'
,
};
};
// prettier-ignore
// prettier-ignore
const
query
=
`
query
=
`
query {
query {
repository(owner: "
${
config
.
repositoryOwner
}
", name: "
${
config
.
repositoryName
}
") {
repository(owner: "
${
config
.
repositoryOwner
}
", name: "
${
config
.
repositoryName
}
") {
pullRequests(states: [OPEN], first: 100, orderBy: {field: UPDATED_AT, direction: DESC}) {
pullRequests(states: [OPEN], first: 100, orderBy: {field: UPDATED_AT, direction: DESC}) {
...
@@ -953,7 +954,7 @@ async function getOpenPrs() {
...
@@ -953,7 +954,7 @@ async function getOpenPrs() {
prNumbers
.
sort
();
prNumbers
.
sort
();
logger
.
debug
({
prNumbers
},
'
Retrieved open PR list with graphql
'
);
logger
.
debug
({
prNumbers
},
'
Retrieved open PR list with graphql
'
);
}
catch
(
err
)
/* istanbul ignore next */
{
}
catch
(
err
)
/* istanbul ignore next */
{
logger
.
warn
({
err
},
'
getOpenPrs error
'
);
logger
.
warn
({
query
,
err
},
'
getOpenPrs error
'
);
}
}
}
}
return
config
.
openPrList
;
return
config
.
openPrList
;
...
@@ -962,10 +963,11 @@ async function getOpenPrs() {
...
@@ -962,10 +963,11 @@ async function getOpenPrs() {
async
function
getClosedPrs
()
{
async
function
getClosedPrs
()
{
if
(
!
config
.
closedPrList
)
{
if
(
!
config
.
closedPrList
)
{
config
.
closedPrList
=
{};
config
.
closedPrList
=
{};
let
query
;
try
{
try
{
const
url
=
'
graphql
'
;
const
url
=
'
graphql
'
;
// prettier-ignore
// prettier-ignore
const
query
=
`
query
=
`
query {
query {
repository(owner: "
${
config
.
repositoryOwner
}
", name: "
${
config
.
repositoryName
}
") {
repository(owner: "
${
config
.
repositoryOwner
}
", name: "
${
config
.
repositoryName
}
") {
pullRequests(states: [CLOSED, MERGED], first: 100, orderBy: {field: UPDATED_AT, direction: DESC}) {
pullRequests(states: [CLOSED, MERGED], first: 100, orderBy: {field: UPDATED_AT, direction: DESC}) {
...
@@ -1013,7 +1015,7 @@ async function getClosedPrs() {
...
@@ -1013,7 +1015,7 @@ async function getClosedPrs() {
prNumbers
.
sort
();
prNumbers
.
sort
();
logger
.
debug
({
prNumbers
},
'
Retrieved closed PR list with graphql
'
);
logger
.
debug
({
prNumbers
},
'
Retrieved closed PR list with graphql
'
);
}
catch
(
err
)
/* istanbul ignore next */
{
}
catch
(
err
)
/* istanbul ignore next */
{
logger
.
warn
({
err
},
'
getOpenPrs error
'
);
logger
.
warn
({
query
,
err
},
'
getOpenPrs error
'
);
}
}
}
}
return
config
.
closedPrList
;
return
config
.
closedPrList
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment