Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrape.js: Use GraphQL API #148

Merged
merged 1 commit into from
Oct 30, 2018
Merged

scrape.js: Use GraphQL API #148

merged 1 commit into from
Oct 30, 2018

Conversation

li-boxuan
Copy link
Member

Use GitHub GraphQL API instead of REST API

closes #111

@li-boxuan
Copy link
Member Author

I add L29 and L114 to make CI pass. (CI was failing on HEAD). Not sure if I should keep them in this PR (by adding commits?) or file a new issue to solve that first.

@jayvdb jayvdb requested review from blazeu and andrewda April 17, 2018 04:48
@jayvdb
Copy link
Member

jayvdb commented Apr 17, 2018

I notice that JBoss has two linked on https://gci-leaders.netlify.com/ , but none on https://deploy-preview-148--gci-leaders.netlify.com/ .

blazeu
blazeu previously requested changes Apr 17, 2018
lib/scrape.js Outdated
@@ -9,17 +9,16 @@ const wdk = require('wikidata-sdk')
const cheerio = require('cheerio')

const { GITHUB_REPO_INFO_QUERY } = require('./queries')
const { GITHUB_SEARCH_ORG_QUERY } = require('./queries')
const { GITHUB_USER_INFO_QUERY } = require('./queries')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just do multiple variable on a single destructuring line { a, b, c }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx, done.

@li-boxuan
Copy link
Member Author

li-boxuan commented Apr 17, 2018

@jayvdb I just investigated that problem (JBoss has no link).

This is not due to this PR; I use the previous HEAD to build and also found no link on JBoss part.

This is because of the name of their gitter room: this link https://gitter.im/jboss-outreach/gci (See #258, which makes use of that link to extract their org name).

However, their org name should be JBossOutreach instead of jboss-outreach. That's why two links are missing. Btw, https://gitter.im/jboss-outreach/gci would automatically jump into https://gitter.im/JBossOutreach/gci, which is indeed what we want.

I added the following code around line #272 and ran it on my machine: JBoss would now again have two links.

if (orgFromWebsites === 'jboss-outreach') {
    return 'JBossOutreach'
}

Do you have some advice what I should do to fix this problem? Visit every link and see if it would jump to some other link? Or add ad-hoc support for JBossOutreach?

@jayvdb
Copy link
Member

jayvdb commented Apr 20, 2018

fwiw, a part of the problem was that 92a68a2 cleared out all of the data in the deploy.

We dont need a special case for JBoss. The link in GCI is old, but a head request will give us the new URL.

That is needed for any github/gitter URL which changes.
That should be a new PR which just fixes master.

lib/rss.js Outdated Show resolved Hide resolved
@jayvdb
Copy link
Member

jayvdb commented Oct 28, 2018

It would be good to finish this up, as I suspect we will need this in order to do #165 , and possible also #164

@jayvdb
Copy link
Member

jayvdb commented Oct 29, 2018

Lots of "Cannot fetch org x from GitHub, error message: unknown error" in the log https://travis-ci.org/coala/gci-leaders/builds/447609704

@@ -0,0 +1,6 @@
query ($user: String!) {
user(login: $user) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our other graphql file uses two space indent.

if you think four is better, also create an issue to re-indent the existing file, and we'll make it a newcomer task

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have used two space indent. Blame my editor :P

lib/scrape.js Outdated
@@ -53,12 +54,6 @@ const CHAT_IMAGES = {
OTHER: 'images/chat.png',
}

const GH_API_OPTIONS = {
headers: process.env.GITHUB_TOKEN
? { Authorization: `token ${process.env.GITHUB_TOKEN}` }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep this, and keep GH_API_BASE, as I am sure we will want to access some features are not available via Graphql, and we dont want people to need to re-invent this, and possibly pick a new token variable name, etc.

Add a note that GH_API_OPTIONS is unused.

@@ -0,0 +1,6 @@
query ($user: String!) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove space before (
(or add a space on the other ones, I'm not 100% sure which is preferred in GraphQL, but I think I've seen no space used more frequently)

Suggested change
query ($user: String!) {
query($user: String!) {

@@ -0,0 +1,9 @@
query($query: String!) {
search(type:USER, query:$query, first:1) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add space after colons:

Suggested change
search(type:USER, query:$query, first:1) {
search(type: USER, query: $query, first: 1) {

@li-boxuan
Copy link
Member Author

li-boxuan commented Oct 29, 2018

Lots of "Cannot fetch org x from GitHub, error message: unknown error" in the log

Weird, it works fine on my local machine. The log should be sth as follows:
Cannot fetch user xxx from GitHub, error message: Could not resolve to a User with the login of 'xxx'.

@andrewda
Copy link
Member

andrewda commented Oct 29, 2018

IIRC the number of unauthenticated GraphQL requests you get is lower than normal API hits. Since this is a PR, I think Travis removes the GH_TOKEN env variable for security reasons, so all the GraphQL requests are made unauthenticated. Might be why it is unable to fetch users after a certain point?

@TravisBuddy
Copy link

Travis tests have failed

Hey @li-boxuan,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

1st Build

View build log

coala --non-interactive -V
[WARNING][07:17:25] StyleLintBear: Using unnecessary capturing groups affects the performance of coala. You should use '(?:<pattern>)' instead of '(<pattern>)' for your regex.
[DEBUG][07:17:25] Platform Linux -- Python 3.6.3, coalib 0.11.0
Executing section all...
[DEBUG][07:17:28] Files that will be checked:
/home/travis/build/coala/gci-leaders/webpack.config.js
/home/travis/build/coala/gci-leaders/tests/lib/pre2017.test.js
/home/travis/build/coala/gci-leaders/tests/lib/generate.test.js
/home/travis/build/coala/gci-leaders/tests/lib/gather.test.js
/home/travis/build/coala/gci-leaders/tests/lib/scrape.test.js
/home/travis/build/coala/gci-leaders/tests/lib/rss.test.js
/home/travis/build/coala/gci-leaders/tests/lib/planet.test.js
/home/travis/build/coala/gci-leaders/lib/generate.js
/home/travis/build/coala/gci-leaders/lib/planet.js
/home/travis/build/coala/gci-leaders/lib/utils.js
/home/travis/build/coala/gci-leaders/lib/queries/index.js
/home/travis/build/coala/gci-leaders/lib/scrape.js
/home/travis/build/coala/gci-leaders/lib/rss.js
/home/travis/build/coala/gci-leaders/lib/pre2017.js
/home/travis/build/coala/gci-leaders/lib/main.js
/home/travis/build/coala/gci-leaders/lib/gather.js
/home/travis/build/coala/gci-leaders/src/js/utils.js
/home/travis/build/coala/gci-leaders/src/js/locale.js
/home/travis/build/coala/gci-leaders/src/js/app.js
/home/travis/build/coala/gci-leaders/src/js/twitter.js
/home/travis/build/coala/gci-leaders/src/js/bootstrap.js
/home/travis/build/coala/gci-leaders/package.json
/home/travis/build/coala/gci-leaders/static/i18n/es.json
/home/travis/build/coala/gci-leaders/static/i18n/pl.json
/home/travis/build/coala/gci-leaders/static/i18n/nb_NO.json
/home/travis/build/coala/gci-leaders/static/i18n/en.json
/home/travis/build/coala/gci-leaders/src/styles/main.css
/home/travis/build/coala/gci-leaders/.travis.yml
/home/travis/build/coala/gci-leaders/templates/planet.html
/home/travis/build/coala/gci-leaders/templates/main.html
/home/travis/build/coala/gci-leaders/templates/pre2017.html
/home/travis/build/coala/gci-leaders/.eslintrc
[DEBUG][07:17:28] coala is run only on changed files, bears' log messages from previous runs may not appear. You may use the `--flush-cache` flag to see them.
Executing section all.whitespace...
[DEBUG][07:17:28] Files that will be checked:
/home/travis/build/coala/gci-leaders/webpack.config.js
/home/travis/build/coala/gci-leaders/tests/lib/pre2017.test.js
/home/travis/build/coala/gci-leaders/tests/lib/generate.test.js
/home/travis/build/coala/gci-leaders/tests/lib/gather.test.js
/home/travis/build/coala/gci-leaders/tests/lib/scrape.test.js
/home/travis/build/coala/gci-leaders/tests/lib/rss.test.js
/home/travis/build/coala/gci-leaders/tests/lib/planet.test.js
/home/travis/build/coala/gci-leaders/lib/generate.js
/home/travis/build/coala/gci-leaders/lib/planet.js
/home/travis/build/coala/gci-leaders/lib/utils.js
/home/travis/build/coala/gci-leaders/lib/queries/index.js
/home/travis/build/coala/gci-leaders/lib/scrape.js
/home/travis/build/coala/gci-leaders/lib/rss.js
/home/travis/build/coala/gci-leaders/lib/pre2017.js
/home/travis/build/coala/gci-leaders/lib/main.js
/home/travis/build/coala/gci-leaders/lib/gather.js
/home/travis/build/coala/gci-leaders/src/js/utils.js
/home/travis/build/coala/gci-leaders/src/js/locale.js
/home/travis/build/coala/gci-leaders/src/js/app.js
/home/travis/build/coala/gci-leaders/src/js/twitter.js
/home/travis/build/coala/gci-leaders/src/js/bootstrap.js
/home/travis/build/coala/gci-leaders/package.json
/home/travis/build/coala/gci-leaders/static/i18n/es.json
/home/travis/build/coala/gci-leaders/static/i18n/pl.json
/home/travis/build/coala/gci-leaders/static/i18n/nb_NO.json
/home/travis/build/coala/gci-leaders/static/i18n/en.json
/home/travis/build/coala/gci-leaders/src/styles/main.css
/home/travis/build/coala/gci-leaders/.travis.yml
/home/travis/build/coala/gci-leaders/templates/planet.html
/home/travis/build/coala/gci-leaders/templates/main.html
/home/travis/build/coala/gci-leaders/templates/pre2017.html
/home/travis/build/coala/gci-leaders/.eslintrc
[DEBUG][07:17:28] coala is run only on changed files, bears' log messages from previous runs may not appear. You may use the `--flush-cache` flag to see them.
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
[DEBUG][07:17:29] Running bear SpaceConsistencyBear...
Executing section all.linelength...
[WARNING][07:17:29] No files matching '/home/travis/build/coala/gci-leaders/**.json' were found.
[WARNING][07:17:29] No files matching '/home/travis/build/coala/gci-leaders/**.html' were found.
[DEBUG][07:17:29] Files that will be checked:
/home/travis/build/coala/gci-leaders/webpack.config.js
/home/travis/build/coala/gci-leaders/tests/lib/pre2017.test.js
/home/travis/build/coala/gci-leaders/tests/lib/generate.test.js
/home/travis/build/coala/gci-leaders/tests/lib/gather.test.js
/home/travis/build/coala/gci-leaders/tests/lib/scrape.test.js
/home/travis/build/coala/gci-leaders/tests/lib/rss.test.js
/home/travis/build/coala/gci-leaders/tests/lib/planet.test.js
/home/travis/build/coala/gci-leaders/lib/generate.js
/home/travis/build/coala/gci-leaders/lib/planet.js
/home/travis/build/coala/gci-leaders/lib/utils.js
/home/travis/build/coala/gci-leaders/lib/queries/index.js
/home/travis/build/coala/gci-leaders/lib/scrape.js
/home/travis/build/coala/gci-leaders/lib/rss.js
/home/travis/build/coala/gci-leaders/lib/pre2017.js
/home/travis/build/coala/gci-leaders/lib/main.js
/home/travis/build/coala/gci-leaders/lib/gather.js
/home/travis/build/coala/gci-leaders/src/js/utils.js
/home/travis/build/coala/gci-leaders/src/js/locale.js
/home/travis/build/coala/gci-leaders/src/js/app.js
/home/travis/build/coala/gci-leaders/src/js/twitter.js
/home/travis/build/coala/gci-leaders/src/js/bootstrap.js
/home/travis/build/coala/gci-leaders/src/styles/main.css
/home/travis/build/coala/gci-leaders/.travis.yml
/home/travis/build/coala/gci-leaders/.eslintrc
[DEBUG][07:17:29] coala is run only on changed files, bears' log messages from previous runs may not appear. You may use the `--flush-cache` flag to see them.
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
[DEBUG][07:17:29] Running bear LineLengthBear...
Executing section all.links...
[DEBUG][07:17:29] Files that will be checked:
/home/travis/build/coala/gci-leaders/webpack.config.js
/home/travis/build/coala/gci-leaders/tests/lib/pre2017.test.js
/home/travis/build/coala/gci-leaders/tests/lib/generate.test.js
/home/travis/build/coala/gci-leaders/tests/lib/gather.test.js
/home/travis/build/coala/gci-leaders/tests/lib/scrape.test.js
/home/travis/build/coala/gci-leaders/tests/lib/rss.test.js
/home/travis/build/coala/gci-leaders/tests/lib/planet.test.js
/home/travis/build/coala/gci-leaders/lib/generate.js
/home/travis/build/coala/gci-leaders/lib/planet.js
/home/travis/build/coala/gci-leaders/lib/utils.js
/home/travis/build/coala/gci-leaders/lib/queries/index.js
/home/travis/build/coala/gci-leaders/lib/scrape.js
/home/travis/build/coala/gci-leaders/lib/rss.js
/home/travis/build/coala/gci-leaders/lib/pre2017.js
/home/travis/build/coala/gci-leaders/lib/main.js
/home/travis/build/coala/gci-leaders/lib/gather.js
/home/travis/build/coala/gci-leaders/src/js/utils.js
/home/travis/build/coala/gci-leaders/src/js/locale.js
/home/travis/build/coala/gci-leaders/src/js/app.js
/home/travis/build/coala/gci-leaders/src/js/twitter.js
/home/travis/build/coala/gci-leaders/src/js/bootstrap.js
/home/travis/build/coala/gci-leaders/package.json
/home/travis/build/coala/gci-leaders/static/i18n/es.json
/home/travis/build/coala/gci-leaders/static/i18n/pl.json
/home/travis/build/coala/gci-leaders/static/i18n/nb_NO.json
/home/travis/build/coala/gci-leaders/static/i18n/en.json
/home/travis/build/coala/gci-leaders/src/styles/main.css
/home/travis/build/coala/gci-leaders/.travis.yml
/home/travis/build/coala/gci-leaders/templates/planet.html
/home/travis/build/coala/gci-leaders/templates/main.html
/home/travis/build/coala/gci-leaders/templates/pre2017.html
/home/travis/build/coala/gci-leaders/.eslintrc
[DEBUG][07:17:29] Starting new HTTP connection (1): 216.58.218.174:80
[DEBUG][07:17:29] http://216.58.218.174:80 "HEAD / HTTP/1.1" 301 0
[DEBUG][07:17:29] coala is run only on changed files, bears' log messages from previous runs may not appear. You may use the `--flush-cache` flag to see them.
[DEBUG][07:17:29] Running bear InvalidLinkBear...
[DEBUG][07:17:29] Running bear InvalidLinkBear...
[DEBUG][07:17:29] Running bear InvalidLinkBear...
[DEBUG][07:17:29] Running bear InvalidLinkBear...
[DEBUG][07:17:29] Running bear InvalidLinkBear...
[DEBUG][07:17:29] Starting new HTTPS connection (1): raw.githubusercontent.com:443
[DEBUG][07:17:29] Starting new HTTP connection (1): codein.withgoogle.com:80
[DEBUG][07:17:29] http://codein.withgoogle.com:80 "HEAD / HTTP/1.1" 302 0
[DEBUG][07:17:29] Starting new HTTPS connection (1): twitter.com:443
[DEBUG][07:17:29] https://raw.githubusercontent.com:443 "HEAD / HTTP/1.1" 301 0
[DEBUG][07:17:30] Starting new HTTPS connection (1): codein.withgoogle.com:443
[DEBUG][07:17:30] Running bear InvalidLinkBear...
[DEBUG][07:17:30] https://twitter.com:443 "HEAD /hashtag/googlecodein HTTP/1.1" 302 0
[DEBUG][07:17:30] Starting new HTTPS connection (1): gitlab.com:443
[DEBUG][07:17:30] https://codein.withgoogle.com:443 "HEAD /api HTTP/1.1" 301 0
[DEBUG][07:17:30] Starting new HTTPS connection (1): codein.withgoogle.com:443
[DEBUG][07:17:30] https://codein.withgoogle.com:443 "HEAD /api/program/current/ HTTP/1.1" 200 0
[DEBUG][07:17:30] Running bear InvalidLinkBear...
[DEBUG][07:17:30] Running bear InvalidLinkBear...
[DEBUG][07:17:30] Running bear InvalidLinkBear...
[DEBUG][07:17:30] Running bear InvalidLinkBear...
[DEBUG][07:17:30] Starting new HTTPS connection (1): codein.withgoogle.com:443
[DEBUG][07:17:30] https://codein.withgoogle.com:443 "HEAD /archive/2016 HTTP/1.1" 301 0
[DEBUG][07:17:30] Starting new HTTPS connection (1): codein.withgoogle.com:443
[DEBUG][07:17:30] https://codein.withgoogle.com:443 "HEAD /archive/2015 HTTP/1.1" 301 0
[DEBUG][07:17:30] Starting new HTTPS connection (1): en.wikipedia.org:443
[DEBUG][07:17:30] https://en.wikipedia.org:443 "HEAD /wiki/Google_Code-in HTTP/1.1" 200 0
[DEBUG][07:17:30] Starting new HTTPS connection (1): www.travisbuddy.com:443
[DEBUG][07:17:30] Running bear InvalidLinkBear...
[DEBUG][07:17:30] https://gitlab.com:443 "HEAD /gitlab-com/gitlab-artwork/blob/master/LICENSE HTTP/1.1" 200 0
[DEBUG][07:17:30] Starting new HTTPS connection (1): coala.io:443
[DEBUG][07:17:31] https://www.travisbuddy.com:443 "HEAD / HTTP/1.1" 200 0
[DEBUG][07:17:31] Running bear InvalidLinkBear...
[DEBUG][07:17:31] Running bear InvalidLinkBear...
[DEBUG][07:17:31] Running bear InvalidLinkBear...
[DEBUG][07:17:31] Running bear InvalidLinkBear...
[DEBUG][07:17:31] Running bear InvalidLinkBear...
[DEBUG][07:17:31] Running bear InvalidLinkBear...
[DEBUG][07:17:31] Running bear InvalidLinkBear...
[DEBUG][07:17:31] Running bear InvalidLinkBear...
[DEBUG][07:17:31] Running bear InvalidLinkBear...
[DEBUG][07:17:31] Running bear InvalidLinkBear...
[DEBUG][07:17:31] Running bear InvalidLinkBear...
[DEBUG][07:17:31] Running bear InvalidLinkBear...
[DEBUG][07:17:31] Running bear InvalidLinkBear...
[DEBUG][07:17:31] Running bear InvalidLinkBear...
[DEBUG][07:17:31] Running bear InvalidLinkBear...
[DEBUG][07:17:31] Running bear InvalidLinkBear...
[DEBUG][07:17:31] Running bear InvalidLinkBear...
[DEBUG][07:17:31] Running bear InvalidLinkBear...
[DEBUG][07:17:31] Starting new HTTPS connection (1): gci-leaders.netlify.com:443
[DEBUG][07:17:31] https://coala.io:443 "HEAD / HTTP/1.1" 200 0
[DEBUG][07:17:31] Running bear InvalidLinkBear...
[DEBUG][07:17:31] Running bear InvalidLinkBear...
[DEBUG][07:17:31] Running bear InvalidLinkBear...
[DEBUG][07:17:31] https://gci-leaders.netlify.com:443 "HEAD / HTTP/1.1" 200 0
[DEBUG][07:17:31] Starting new HTTPS connection (1): gci-leaders.netlify.com:443
[DEBUG][07:17:31] https://gci-leaders.netlify.com:443 "HEAD / HTTP/1.1" 200 0
[DEBUG][07:17:31] Starting new HTTPS connection (1): g.co:443
[DEBUG][07:17:31] https://g.co:443 "HEAD /gci HTTP/1.1" 301 0
[DEBUG][07:17:31] Starting new HTTPS connection (1): g.co:443
[DEBUG][07:17:31] https://g.co:443 "HEAD /gci HTTP/1.1" 301 0
Executing section js...
[DEBUG][07:17:31] Files that will be checked:
/home/travis/build/coala/gci-leaders/lib/generate.js
/home/travis/build/coala/gci-leaders/lib/planet.js
/home/travis/build/coala/gci-leaders/lib/utils.js
/home/travis/build/coala/gci-leaders/lib/scrape.js
/home/travis/build/coala/gci-leaders/lib/rss.js
/home/travis/build/coala/gci-leaders/lib/pre2017.js
/home/travis/build/coala/gci-leaders/lib/main.js
/home/travis/build/coala/gci-leaders/lib/gather.js
/home/travis/build/coala/gci-leaders/lib/queries/index.js
/home/travis/build/coala/gci-leaders/src/js/utils.js
/home/travis/build/coala/gci-leaders/src/js/locale.js
/home/travis/build/coala/gci-leaders/src/js/app.js
/home/travis/build/coala/gci-leaders/src/js/twitter.js
/home/travis/build/coala/gci-leaders/src/js/bootstrap.js
[DEBUG][07:17:31] coala is run only on changed files, bears' log messages from previous runs may not appear. You may use the `--flush-cache` flag to see them.
[DEBUG][07:17:32] Running bear ESLintBear...
[DEBUG][07:17:32] Running 'eslint --no-ignore --no-color -f=json --stdin --stdin-filename=/home/travis/build/coala/gci-leaders/lib/planet.js --config .eslintrc'
[DEBUG][07:17:32] Running bear ESLintBear...
[DEBUG][07:17:32] Running 'eslint --no-ignore --no-color -f=json --stdin --stdin-filename=/home/travis/build/coala/gci-leaders/lib/pre2017.js --config .eslintrc'
[DEBUG][07:17:33] Running bear ESLintBear...
[DEBUG][07:17:33] Running 'eslint --no-ignore --no-color -f=json --stdin --stdin-filename=/home/travis/build/coala/gci-leaders/src/js/bootstrap.js --config .eslintrc'
[DEBUG][07:17:33] Running bear ESLintBear...
[DEBUG][07:17:33] Running 'eslint --no-ignore --no-color -f=json --stdin --stdin-filename=/home/travis/build/coala/gci-leaders/lib/queries/index.js --config .eslintrc'
[DEBUG][07:17:34] Running bear ESLintBear...
[DEBUG][07:17:34] Running 'eslint --no-ignore --no-color -f=json --stdin --stdin-filename=/home/travis/build/coala/gci-leaders/src/js/locale.js --config .eslintrc'
[DEBUG][07:17:34] Running bear ESLintBear...
[DEBUG][07:17:34] Running 'eslint --no-ignore --no-color -f=json --stdin --stdin-filename=/home/travis/build/coala/gci-leaders/lib/gather.js --config .eslintrc'
[DEBUG][07:17:35] Running bear ESLintBear...
[DEBUG][07:17:35] Running 'eslint --no-ignore --no-color -f=json --stdin --stdin-filename=/home/travis/build/coala/gci-leaders/src/js/twitter.js --config .eslintrc'
[DEBUG][07:17:35] Running bear ESLintBear...
[DEBUG][07:17:35] Running 'eslint --no-ignore --no-color -f=json --stdin --stdin-filename=/home/travis/build/coala/gci-leaders/lib/rss.js --config .eslintrc'
[DEBUG][07:17:36] Running bear ESLintBear...
[DEBUG][07:17:36] Running 'eslint --no-ignore --no-color -f=json --stdin --stdin-filename=/home/travis/build/coala/gci-leaders/lib/generate.js --config .eslintrc'
[DEBUG][07:17:36] Running bear ESLintBear...
[DEBUG][07:17:36] Running 'eslint --no-ignore --no-color -f=json --stdin --stdin-filename=/home/travis/build/coala/gci-leaders/lib/utils.js --config .eslintrc'
[DEBUG][07:17:37] Running bear ESLintBear...
[DEBUG][07:17:37] Running 'eslint --no-ignore --no-color -f=json --stdin --stdin-filename=/home/travis/build/coala/gci-leaders/lib/scrape.js --config .eslintrc'
[DEBUG][07:17:37] Running bear ESLintBear...
[DEBUG][07:17:37] Running 'eslint --no-ignore --no-color -f=json --stdin --stdin-filename=/home/travis/build/coala/gci-leaders/src/js/utils.js --config .eslintrc'
[DEBUG][07:17:38] Running bear ESLintBear...
[DEBUG][07:17:38] Running 'eslint --no-ignore --no-color -f=json --stdin --stdin-filename=/home/travis/build/coala/gci-leaders/lib/main.js --config .eslintrc'
[WARNING][07:17:38] ESLintBear (no-unused-vars): This result has no patch attached.
[WARNING][07:17:38] ESLintBear (no-unused-vars): This result has no patch attached.

lib/scrape.js
[DEBUG][07:17:38] Running bear ESLintBear...
[DEBUG][07:17:38] Running 'eslint --no-ignore --no-color -f=json --stdin --stdin-filename=/home/travis/build/coala/gci-leaders/src/js/app.js --config .eslintrc'
|  21| const·GH_API_BASE·=·'https://api.github.com'
|    | [MAJOR] ESLintBear (no-unused-vars):
|    | 'GH_API_BASE' is assigned a value but never used.

lib/scrape.js
|  61| const·GH_API_OPTIONS·=·{
|    | [MAJOR] ESLintBear (no-unused-vars):
|    | 'GH_API_OPTIONS' is assigned a value but never used.
Executing section css...
[DEBUG][07:17:40] Files that will be checked:
/home/travis/build/coala/gci-leaders/src/styles/main.css
[DEBUG][07:17:40] coala is run only on changed files, bears' log messages from previous runs may not appear. You may use the `--flush-cache` flag to see them.
[DEBUG][07:17:40] Running bear StyleLintBear...
[DEBUG][07:17:40] Running 'stylelint /home/travis/build/coala/gci-leaders/src/styles/main.css --config=/tmp/tmp9v6tmayp.json'
Executing section html...
[DEBUG][07:17:41] Files that will be checked:
/home/travis/build/coala/gci-leaders/templates/planet.html
/home/travis/build/coala/gci-leaders/templates/main.html
/home/travis/build/coala/gci-leaders/templates/pre2017.html
[DEBUG][07:17:41] coala is run only on changed files, bears' log messages from previous runs may not appear. You may use the `--flush-cache` flag to see them.
[DEBUG][07:17:41] Running bear HTMLLintBear...
[DEBUG][07:17:41] Running '/home/travis/virtualenv/python3.6.3/bin/python /home/travis/virtualenv/python3.6.3/bin/html_lint.py --disable=optional /home/travis/build/coala/gci-leaders/templates/planet.html'
[DEBUG][07:17:41] Running bear HTMLLintBear...
[DEBUG][07:17:41] Running '/home/travis/virtualenv/python3.6.3/bin/python /home/travis/virtualenv/python3.6.3/bin/html_lint.py --disable=optional /home/travis/build/coala/gci-leaders/templates/main.html'
[DEBUG][07:17:41] Running bear HTMLLintBear...
[DEBUG][07:17:41] Running '/home/travis/virtualenv/python3.6.3/bin/python /home/travis/virtualenv/python3.6.3/bin/html_lint.py --disable=optional /home/travis/build/coala/gci-leaders/templates/pre2017.html'
Executing section all.json-i18n...
[DEBUG][07:17:41] Files that will be checked:
/home/travis/build/coala/gci-leaders/static/i18n/es.json
/home/travis/build/coala/gci-leaders/static/i18n/pl.json
/home/travis/build/coala/gci-leaders/static/i18n/nb_NO.json
/home/travis/build/coala/gci-leaders/static/i18n/en.json
[DEBUG][07:17:41] coala is run only on changed files, bears' log messages from previous runs may not appear. You may use the `--flush-cache` flag to see them.
[DEBUG][07:17:41] Running bear JSONFormatBear...
[DEBUG][07:17:41] Running bear JSONFormatBear...
[DEBUG][07:17:41] Running bear JSONFormatBear...
[DEBUG][07:17:41] Running bear JSONFormatBear...
Executing section all.json...
[DEBUG][07:17:42] Files that will be checked:
/home/travis/build/coala/gci-leaders/package.json
[DEBUG][07:17:42] coala is run only on changed files, bears' log messages from previous runs may not appear. You may use the `--flush-cache` flag to see them.
[DEBUG][07:17:42] Running bear JSONFormatBear...
Executing section yaml...
[DEBUG][07:17:42] Files that will be checked:
/home/travis/build/coala/gci-leaders/.travis.yml
/home/travis/build/coala/gci-leaders/.eslintrc
[DEBUG][07:17:42] coala is run only on changed files, bears' log messages from previous runs may not appear. You may use the `--flush-cache` flag to see them.
[DEBUG][07:17:42] Running bear YAMLLintBear...
[DEBUG][07:17:42] Running 'yamllint -f parsable /home/travis/build/coala/gci-leaders/.travis.yml --config-file=/tmp/tmpms59tgb_'
[DEBUG][07:17:42] Running bear YAMLLintBear...
[DEBUG][07:17:42] Running 'yamllint -f parsable /home/travis/build/coala/gci-leaders/.eslintrc --config-file=/tmp/tmpn3ivun0f'
Executing section commit...
[DEBUG][07:17:42] Files that will be checked:
[nltk_data] Downloading package punkt to /home/travis/nltk_data...
[nltk_data]   Unzipping tokenizers/punkt.zip.
[nltk_data] Downloading package maxent_treebank_pos_tagger to
[nltk_data]     /home/travis/nltk_data...
[nltk_data]   Unzipping taggers/maxent_treebank_pos_tagger.zip.
[nltk_data] Downloading package averaged_perceptron_tagger to
[nltk_data]     /home/travis/nltk_data...
[nltk_data]   Unzipping taggers/averaged_perceptron_tagger.zip.
[DEBUG][07:17:44] coala is run only on changed files, bears' log messages from previous runs may not appear. You may use the `--flush-cache` flag to see them.
[DEBUG][07:17:44] Running bear GitCommitBear...
[WARNING][07:17:45] Bear GitCommitBear failed to run. Take a look at debug messages (`-V`) for further information.
[DEBUG][07:17:45] The bear GitCommitBear raised an exception. If you are the author of this bear, please make sure to catch all exceptions. If not and this error annoys you, you might want to get in contact with the author of this bear.

Traceback information is provided below:

Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/coalib/bears/Bear.py", line 282, in execute
    return [] if result is None else list(result)
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/bears/vcs/git/GitCommitBear.py", line 135, in run
    **self.get_issue_checks_metadata().filter_parameters(kwargs))
  File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/bears/vcs/git/GitCommitBear.py", line 303, in check_issue_reference
    body = body.splitlines()[-1]
IndexError: list index out of range
Executing section cli...
[DEBUG][07:17:45] Files that will be checked:
[DEBUG][07:17:45] coala is run only on changed files, bears' log messages from previous runs may not appear. You may use the `--flush-cache` flag to see them.
TravisBuddy Request Identifier: cf361110-db4a-11e8-99b4-75805dd182ba

Copy link
Member

@jayvdb jayvdb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also keep the old org/user lookup, and use them as a fallback after the graphsql has done its magic

return items || []
let data, errors
try {
;({ data, errors } = await client.query(GITHUB_SEARCH_ORG_QUERY, { query }))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, what is the semicolon for?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, but eslint will be unhappy with that ;)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it is because you put parentheses in

;({ data, errors } = await client.query(GITHUB_SEARCH_ORG_QUERY, { query }))

Another question, why is the parentheses used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is because I put parentheses.
I have to use parentheses otherwise there would be a parsing error.

Use GitHub GraphQL API instead of REST API

Closes coala#111
@jayvdb
Copy link
Member

jayvdb commented Oct 30, 2018

ack 8da2685

@jayvdb
Copy link
Member

jayvdb commented Oct 30, 2018

@gitmate-bot ff

@jayvdb jayvdb merged commit 8da2685 into coala:master Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Use GraphQL API
7 participants