Skip to content

Commit

Permalink
Use issue tracker data from update center (#722)
Browse files Browse the repository at this point in the history
* Use issue tracker data from update center

* Use update center data more, rename maintainers to developers

Co-authored-by: Gavin Mogan <github@gavinmogan.com>
  • Loading branch information
zbynek and halkeye authored Jul 2, 2021
1 parent 90e7d04 commit 2b7b2e3
Show file tree
Hide file tree
Showing 14 changed files with 157 additions and 164 deletions.
6 changes: 5 additions & 1 deletion gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
/* eslint-disable sort-keys, no-console */

try {
require('dotenv').config();
} catch(e) {
console.warn('problem loading .env', e);//expected in production
}
// This is the content of your gatsby-config.js
// and what you need to provide as schema:
module.exports = {
Expand Down
42 changes: 23 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"babel-eslint": "^10.1.0",
"babel-jest": "^27.0.6",
"babel-preset-gatsby": "^1.6.0",
"dotenv": "^8.6.0",
"eslint": "^7.29.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

exports[`Utils Get plugin data for a wiki based plugin 1`] = `
Object {
"buildDate": "2012-10-10",
"buildDate": "Oct 10, 2012",
"categories": Array [
"languagesPlatforms",
"buildManagement",
],
"children": Array [],
"defaultBranch": "master",
"dependencies": Array [
Object {
"implied": true,
Expand Down Expand Up @@ -108,8 +109,9 @@ Object {
"version": "1.0.4",
},
],
"developers": Array [],
"excerpt": "Talks to iOS devices connected to slaves and do stuff.",
"firstRelease": "2012-10-07T18:59:35.16Z",
"firstRelease": "1970-01-01T00:00:00.000Z",
"gav": "org.jenkins-ci.plugins:ios-device-connector:1.2",
"hasBomEntry": false,
"hasPipelineSteps": false,
Expand All @@ -118,32 +120,29 @@ Object {
"contentDigest": "7da41342fb756c851d4b5a9b6b6f9f3e",
"type": "JenkinsPlugin",
},
"issueTrackers": Array [
Object {
"reportUrl": "https://www.jenkins.io/participate/report-issue/redirect/#17020",
"type": "jira",
"viewUrl": "https://issues.jenkins.io/issues/?jql=component=17020",
},
],
"labels": Array [
"builder",
"ios",
],
"maintainers": Array [
Object {
"email": null,
"id": "kohsuke",
"name": null,
},
],
"name": "ios-device-connector",
"parent": null,
"previousTimestamp": "2012-10-08T20:04:52.00Z",
"popularity": 275,
"previousTimestamp": "2012-10-08T20:04:36.00Z",
"previousVersion": "1.1",
"releaseTimestamp": "2012-10-10T17:27:58.00Z",
"releaseTimestamp": "2012-10-10T17:27:42.00Z",
"requiredCore": "1.466",
"scm": Object {
"inLatestRelease": null,
"issues": null,
"link": "https://github.com/jenkinsci/ios-device-connector-plugin",
"pullRequests": null,
"sinceLatestRelease": null,
},
"securityWarnings": null,
"scm": "https://github.com/jenkinsci/ios-device-connector-plugin",
"securityWarnings": Array [],
"sha1": "B2z2wTyA8l5uwz9HqD+xhG9Hjns=",
"sha256": "Tray3+tyfE6xoTu1Rge9+INkcj5y7Bgw7nPm//saiYw=",
"size": 1548862,
"stats": Object {
"currentInstalls": 365,
"installations": Array [
Expand Down Expand Up @@ -869,7 +868,7 @@ Object {
"trend": -15,
},
"title": "iOS Device connector",
"url": "http://updates.jenkins-ci.org/download/plugins/ios-device-connector/1.2/ios-device-connector.hpi",
"url": "https://updates.jenkins.io/download/plugins/ios-device-connector/1.2/ios-device-connector.hpi",
"version": "1.2",
"wiki": Object {
"content": "
Expand Down
55 changes: 3 additions & 52 deletions plugins/gatsby-source-jenkinsplugins/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,3 @@
/*
plugins: `
firstRelease: Date
buildDate: Date
categories: {
id: String!
}
dependencies: {
name: String
title: String
optional: Boolean
version: String
implied: Boolean
}
maintainers: {
id: String
name: String
}
excerpt: String
gav: String
labels: {
id: String!
}
name: String
previousTimestamp: Date
previousVersion: String
releaseTimestamp: Date
requiredCore: String
scm: {
issues: String
link: String
inLatestRelease: String
sinceLatestRelease: String
pullRequest: String
}
sha1: String
// stats:
title: String
url: String
version: String
// securityWarnings:
wiki: {
content: String
url: String
}
`
*/

const {
fetchSiteInfo,
fetchPluginData,
Expand All @@ -54,21 +6,20 @@ const {
fetchLabelData,
} = require('./utils');


exports.sourceNodes = async (
{actions, reporter},
{ /* options */ } // eslint-disable-line no-empty-pattern
) => {
const {createNode} = actions;

try {
const firstReleases = {};
await Promise.all([
fetchSiteInfo({createNode, reporter}),
fetchPluginData({createNode, reporter}),
fetchCategoryData({createNode, reporter}),
fetchLabelData({createNode, reporter}),
fetchPluginVersions({createNode, reporter}),
]);
fetchPluginVersions({createNode, reporter, firstReleases}),
]).then(() => fetchPluginData({createNode, reporter, firstReleases}));
} catch (err) {
reporter.panic(
`gatsby-source-jenkinsplugin: Failed to parse API call - ${err.stack || err}`
Expand Down
Loading

0 comments on commit 2b7b2e3

Please sign in to comment.