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

Timeout error github graphql #14

Open
tereshhhchenko opened this issue Jun 25, 2021 · 1 comment
Open

Timeout error github graphql #14

tereshhhchenko opened this issue Jun 25, 2021 · 1 comment

Comments

@tereshhhchenko
Copy link

Logs

Begin oat-sa/tao-core : 46.14.4 -> 48.11.1
➡ Fetching pull requests
➡ Extracting release notes
❎ request to https://api.github.com/graphql failed, reason: connect ETIMEDOUT 140.82.121.6:443
{ FetchError: request to https://api.github.com/graphql failed, reason: connect ETIMEDOUT 140.82.121.6:443
    at ClientRequest.<anonymous> (/home/sv/.nvm/versions/node/v10.24.1/lib/node_modules/@oat-sa/tao-release-notes/node_modules/cross-fetch/node_modules/node-fetch/lib/index.js:1393:11)
    at ClientRequest.emit (events.js:198:13)
    at TLSSocket.socketErrorListener (_http_client.js:401:9)
    at TLSSocket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
  message:
   'request to https://api.github.com/graphql failed, reason: connect ETIMEDOUT 140.82.121.6:443',
  type: 'system',
  errno: 'ETIMEDOUT',
  code: 'ETIMEDOUT' }

My guess it might be happen due to github api limitations

@tereshhhchenko
Copy link
Author

Temp solution on my local that helped me to get release notes for the Prod PR that included a lot of updates. This solution is ad-hoc, it might be improved a lot, the delay probably could be smaller.
In src/notes/requests.js.

...
const delay = require('delay');
...
        async getReleaseNotesFromPullRequests(pullRequests = []) {
            const processed = [];
            for (let prData of pullRequests) {
                const version = semver.valid(semver.coerce(prData.title));
                const releaseNotes = await githubClient.extractReleaseNotesFromReleasePR(prData.number);
                processed.push({ version, releaseNotes });
                await delay(300);
            }
            return processed.filter(pr => pr.version && pr.releaseNotes);
            
            // return (await Promise.all(
            //     pullRequests
            //         .map(async (prData) => {
            //             const version = semver.valid(semver.coerce(prData.title));
            //             const releaseNotes = await githubClient.extractReleaseNotesFromReleasePR(prData.number);
            //             await delay(3000);
            //             // console.log(releaseNotes);
            //             return { version, releaseNotes };
            //         })
            // )).filter(pr => pr.version && pr.releaseNotes);
        }
    };
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant