Skip to content
This repository was archived by the owner on Apr 7, 2025. It is now read-only.

Commit 16e7162

Browse files
authored
fix: sync-data update to use latest version (#460)
1 parent 4f4a683 commit 16e7162

File tree

9 files changed

+88
-77
lines changed

9 files changed

+88
-77
lines changed

.github/actions/sync-data/dist/index.js

+32-21
Original file line numberDiff line numberDiff line change
@@ -1975,17 +1975,29 @@ const ORG_REPOS = [
19751975
// }
19761976
];
19771977

1978+
// These entries should match the `fullName` in the corresponding project's json file
19781979
const EXCLUDED_PROJECTS = [
19791980
'adopt-open-jdk',
1980-
'open-telemetry/opentelemetry-go',
1981-
'open-telemetry/opentelemetry-java',
1982-
'open-telemetry',
1983-
'w3c-distributed-tracing-wg',
19841981
'newrelic/developer-toolkit',
19851982
'newrelic/extends_newrelic_rpm',
19861983
'newrelic/open-source-office',
19871984
'newrelic/open-source-tools',
1988-
'newrelic/sidecar'
1985+
'newrelic/sidecar',
1986+
'open-telemetry',
1987+
'open-telemetry-opentelemetry-auto-instr-java',
1988+
'open-telemetry-opentelemetry-collector',
1989+
'open-telemetry-opentelemetry-cpp',
1990+
'open-telemetry-opentelemetry-dotnet',
1991+
'open-telemetry-opentelemetry-erlang',
1992+
'open-telemetry/opentelemetry-go',
1993+
'open-telemetry/opentelemetry-java',
1994+
'open-telemetry-opentelemetry-ruby',
1995+
'open-telemetry/opentelemetry-specification',
1996+
'w3c-correlation-context',
1997+
'w3c-distributed-tracing-wg',
1998+
'w3c-trace-context',
1999+
'w3c-trace-context-binary',
2000+
'w3c-trace-response'
19892001
];
19902002

19912003
// TO DO - Ascertain Github's GraphQL query limits
@@ -23091,7 +23103,8 @@ function formatStats(project, stats) {
2309123103
}
2309223104

2309323105
function writeProjectStatsToGatsby(project, projectStats) {
23094-
const workingDir = process.env.GITHUB_WORKSPACE || path.join(__dirname, '../../../../../');
23106+
const workingDir =
23107+
process.env.GITHUB_WORKSPACE || path.join(__dirname, '../../../../../');
2309523108
const statsDir = core.getInput('stats-dir') || DEFAULT_DIR;
2309623109
const outputDir = path.resolve(workingDir, statsDir);
2309723110

@@ -26449,7 +26462,7 @@ const reposForOrgQuery = ({
2644926462
tags: refs(refPrefix: "refs/tags/") {
2645026463
totalCount
2645126464
}
26452-
latestTag: refs(refPrefix: "refs/tags/", last: 1) {
26465+
latestTag: refs(refPrefix: "refs/tags/", last: 1, , orderBy: {field: TAG_COMMIT_DATE, direction: ASC}) {
2645326466
nodes {
2645426467
id
2645526468
name
@@ -29922,7 +29935,8 @@ async function getProjectFullName(file, outputDir) {
2992229935
* explicitly not generating stats for.
2992329936
*/
2992429937
async function getProjectsAndExclusions() {
29925-
const workingDir = process.env.GITHUB_WORKSPACE || path.join(__dirname, '../../../../../');
29938+
const workingDir =
29939+
process.env.GITHUB_WORKSPACE || path.join(__dirname, '../../../../../');
2992629940
const projectsDir = core.getInput('stats-dir') || 'src/data/projects';
2992729941
const outputDir = path.resolve(workingDir, projectsDir);
2992829942

@@ -32095,7 +32109,6 @@ module.exports = isWeekend
3209532109
/* 767 */
3209632110
/***/ (function(module, __unusedexports, __webpack_require__) {
3209732111

32098-
// const github = require("@actions/github")
3209932112
const core = __webpack_require__(470);
3210032113
const { Octokit } = __webpack_require__(889);
3210132114
const parseLinkHeader = __webpack_require__(386);
@@ -32108,8 +32121,8 @@ const REPOS_PER_PAGE = 100;
3210832121
const octokit = new Octokit({
3210932122
auth: GH_TOKEN,
3211032123
log: {
32111-
debug: () => { },
32112-
info: () => { },
32124+
debug: () => {},
32125+
info: () => {},
3211332126
// eslint-disable-next-line no-console
3211432127
warn: console.warn,
3211532128
// eslint-disable-next-line no-console
@@ -32233,15 +32246,15 @@ const octokit = new Octokit({
3223332246
* start_page - Beginning page
3223432247
* exclude_archived - Whether or not to filter out archived repositories (repos.listForOrg does not offer a way to exclude these from the response)
3223532248
*/
32236-
const organizationRepositoryIterator = function ({
32249+
const organizationRepositoryIterator = function({
3223732250
pages = 1,
3223832251
org = DEFAULT_ORG,
3223932252
type = 'public',
3224032253
per_page = REPOS_PER_PAGE,
3224132254
start_page = 1
3224232255
// excludeArchived = true
3224332256
}) {
32244-
return function () {
32257+
return function() {
3224532258
const MAX_PAGES_ALLOWED = 100;
3224632259

3224732260
let isFirstPage = true;
@@ -32253,15 +32266,15 @@ const organizationRepositoryIterator = function ({
3225332266
// How best do we initialize this for the first page?
3225432267
let pagesToGet = pages === 0 ? MAX_PAGES_ALLOWED : pages;
3225532268

32256-
const hasMore = function () {
32269+
const hasMore = function() {
3225732270
return pagesToGet > 0;
3225832271
};
3225932272

32260-
const getCurrentPage = function () {
32273+
const getCurrentPage = function() {
3226132274
return currentPage;
3226232275
};
3226332276

32264-
const firstPage = async function () {
32277+
const firstPage = async function() {
3226532278
const firstPage = await fetchOrganizationRepositoryPage({
3226632279
org,
3226732280
type,
@@ -32286,7 +32299,7 @@ const organizationRepositoryIterator = function ({
3228632299
return firstPage;
3228732300
};
3228832301

32289-
const next = function () {
32302+
const next = function() {
3229032303
let nextPage = false;
3229132304

3229232305
if (hasMore()) {
@@ -32324,7 +32337,7 @@ const organizationRepositoryIterator = function ({
3232432337
};
3232532338
};
3232632339

32327-
const fetchOrganizationRepositoryPage = async function ({
32340+
const fetchOrganizationRepositoryPage = async function({
3232832341
org,
3232932342
type,
3233032343
per_page,
@@ -32351,7 +32364,7 @@ const fetchOrganizationRepositoryPage = async function ({
3235132364
}
3235232365
};
3235332366

32354-
const fetchRepo = async function ({ options }) {
32367+
const fetchRepo = async function({ options }) {
3235532368
const { org: owner, repo } = options;
3235632369

3235732370
return octokit.repos.get({
@@ -32752,12 +32765,10 @@ const stringToColor = str => {
3275232765

3275332766
let hash = 0;
3275432767
for (let i = 0; i < str.length; i += 1) {
32755-
// eslint-disable-next-line no-bitwise
3275632768
hash = str.charCodeAt(i) + ((hash << 5) - hash);
3275732769
}
3275832770
let colour = '#';
3275932771
for (let i = 0; i < 3; i += 1) {
32760-
// eslint-disable-next-line no-bitwise
3276132772
const value = (hash >> (i * 8)) & 0xff;
3276232773
colour += `00${value.toString(16)}`.substr(-2);
3276332774
}

.github/actions/sync-data/package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/actions/sync-data/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@
4949
"@zeit/ncc": "^0.20.5",
5050
"eslint": "^6.8.0",
5151
"jest": "^25.2.4",
52-
"prettier": "^2.0.5"
52+
"prettier": "^1.19.1"
5353
}
5454
}

.github/actions/sync-data/src/data-generator/fetch.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const REPOS_PER_PAGE = 100;
1010
const octokit = new Octokit({
1111
auth: GH_TOKEN,
1212
log: {
13-
debug: () => { },
14-
info: () => { },
13+
debug: () => {},
14+
info: () => {},
1515
// eslint-disable-next-line no-console
1616
warn: console.warn,
1717
// eslint-disable-next-line no-console
@@ -135,15 +135,15 @@ const octokit = new Octokit({
135135
* start_page - Beginning page
136136
* exclude_archived - Whether or not to filter out archived repositories (repos.listForOrg does not offer a way to exclude these from the response)
137137
*/
138-
const organizationRepositoryIterator = function ({
138+
const organizationRepositoryIterator = function({
139139
pages = 1,
140140
org = DEFAULT_ORG,
141141
type = 'public',
142142
per_page = REPOS_PER_PAGE,
143143
start_page = 1
144144
// excludeArchived = true
145145
}) {
146-
return function () {
146+
return function() {
147147
const MAX_PAGES_ALLOWED = 100;
148148

149149
let isFirstPage = true;
@@ -155,15 +155,15 @@ const organizationRepositoryIterator = function ({
155155
// How best do we initialize this for the first page?
156156
let pagesToGet = pages === 0 ? MAX_PAGES_ALLOWED : pages;
157157

158-
const hasMore = function () {
158+
const hasMore = function() {
159159
return pagesToGet > 0;
160160
};
161161

162-
const getCurrentPage = function () {
162+
const getCurrentPage = function() {
163163
return currentPage;
164164
};
165165

166-
const firstPage = async function () {
166+
const firstPage = async function() {
167167
const firstPage = await fetchOrganizationRepositoryPage({
168168
org,
169169
type,
@@ -188,7 +188,7 @@ const organizationRepositoryIterator = function ({
188188
return firstPage;
189189
};
190190

191-
const next = function () {
191+
const next = function() {
192192
let nextPage = false;
193193

194194
if (hasMore()) {
@@ -226,7 +226,7 @@ const organizationRepositoryIterator = function ({
226226
};
227227
};
228228

229-
const fetchOrganizationRepositoryPage = async function ({
229+
const fetchOrganizationRepositoryPage = async function({
230230
org,
231231
type,
232232
per_page,
@@ -253,7 +253,7 @@ const fetchOrganizationRepositoryPage = async function ({
253253
}
254254
};
255255

256-
const fetchRepo = async function ({ options }) {
256+
const fetchRepo = async function({ options }) {
257257
const { org: owner, repo } = options;
258258

259259
return octokit.repos.get({

.github/actions/sync-data/src/shared/constants.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@ const EXCLUDED_PROJECTS = [
2626
'newrelic/open-source-tools',
2727
'newrelic/sidecar',
2828
'open-telemetry',
29-
"open-telemetry-opentelemetry-auto-instr-java",
30-
"open-telemetry-opentelemetry-collector",
31-
"open-telemetry-opentelemetry-cpp",
32-
"open-telemetry-opentelemetry-dotnet",
33-
"open-telemetry-opentelemetry-erlang",
29+
'open-telemetry-opentelemetry-auto-instr-java',
30+
'open-telemetry-opentelemetry-collector',
31+
'open-telemetry-opentelemetry-cpp',
32+
'open-telemetry-opentelemetry-dotnet',
33+
'open-telemetry-opentelemetry-erlang',
3434
'open-telemetry/opentelemetry-go',
3535
'open-telemetry/opentelemetry-java',
36-
"open-telemetry-opentelemetry-ruby",
37-
"open-telemetry/opentelemetry-specification",
38-
"w3c-correlation-context",
39-
"w3c-distributed-tracing-wg",
40-
"w3c-trace-context",
41-
"w3c-trace-context-binary",
42-
"w3c-trace-response"
36+
'open-telemetry-opentelemetry-ruby',
37+
'open-telemetry/opentelemetry-specification',
38+
'w3c-correlation-context',
39+
'w3c-distributed-tracing-wg',
40+
'w3c-trace-context',
41+
'w3c-trace-context-binary',
42+
'w3c-trace-response'
4343
];
4444

4545
// TO DO - Ascertain Github's GraphQL query limits

.github/actions/sync-data/src/stats-generator/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ async function getProjectFullName(file, outputDir) {
6565
* explicitly not generating stats for.
6666
*/
6767
async function getProjectsAndExclusions() {
68-
const workingDir = process.env.GITHUB_WORKSPACE || path.join(__dirname, '../../../../../');
68+
const workingDir =
69+
process.env.GITHUB_WORKSPACE || path.join(__dirname, '../../../../../');
6970
const projectsDir = core.getInput('stats-dir') || 'src/data/projects';
7071
const outputDir = path.resolve(workingDir, projectsDir);
7172

.github/actions/sync-data/src/stats-generator/lib/utils.js

-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ const stringToColor = str => {
1111

1212
let hash = 0;
1313
for (let i = 0; i < str.length; i += 1) {
14-
// eslint-disable-next-line no-bitwise
1514
hash = str.charCodeAt(i) + ((hash << 5) - hash);
1615
}
1716
let colour = '#';
1817
for (let i = 0; i < 3; i += 1) {
19-
// eslint-disable-next-line no-bitwise
2018
const value = (hash >> (i * 8)) & 0xff;
2119
colour += `00${value.toString(16)}`.substr(-2);
2220
}

.github/actions/sync-data/src/stats-generator/processor.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ function formatStats(project, stats) {
103103
}
104104

105105
function writeProjectStatsToGatsby(project, projectStats) {
106-
const workingDir = process.env.GITHUB_WORKSPACE || path.join(__dirname, '../../../../../');
106+
const workingDir =
107+
process.env.GITHUB_WORKSPACE || path.join(__dirname, '../../../../../');
107108
const statsDir = core.getInput('stats-dir') || DEFAULT_DIR;
108109
const outputDir = path.resolve(workingDir, statsDir);
109110

.github/workflows/project-stats.yml

+26-26
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout repo
18-
uses: actions/checkout@v2
18+
uses: actions/checkout@v2.3.0
1919
with:
2020
ref: develop
2121
fetch-depth: 0
@@ -60,7 +60,7 @@ jobs:
6060
needs: job-sync-project-data
6161
steps:
6262
- name: Checkout repo
63-
uses: actions/checkout@v2
63+
uses: actions/checkout@v2.3.0
6464

6565
- name: Setup Node.js
6666
uses: actions/setup-node@v1
@@ -95,27 +95,27 @@ jobs:
9595
#############################################################################################################
9696
## Note: Removing the webhook-driven deployment (for now) in favor of utilizing auto-builds on Amplify
9797
#############################################################################################################
98-
# job-deploy-staging:
99-
# runs-on: ubuntu-latest
100-
# needs: [job-sync-project-data, job-checkout-and-build]
101-
# env:
102-
# STAGING_WEBHOOK: ${{ secrets.AMPLIFY_STAGING_WEBHOOK }}
103-
# steps:
104-
# - name: Call Amplify Staging Deploy
105-
# run: |
106-
# echo "Calling Amplify staging webhook"
107-
# curl --silent --show-error --output /dev/null -X POST $STAGING_WEBHOOK -H "Content-Type:application/json"
108-
# echo "**OUTPUT SUPPRESSED**"
109-
# echo "Webhook call complete"
110-
# job-deploy-prod:
111-
# runs-on: ubuntu-latest
112-
# needs: [job-sync-project-data, job-checkout-and-build]
113-
# env:
114-
# PROD_WEBHOOK: ${{ secrets.AMPLIFY_PROD_WEBHOOK }}
115-
# steps:
116-
# - name: Call Amplify Prod Deploy
117-
# run: |
118-
# echo "Calling Amplify prod webhook"
119-
# curl --silent --show-error --output /dev/null -X POST $PROD_WEBHOOK -H "Content-Type:application/json"
120-
# echo "**OUTPUT SUPPRESSED**"
121-
# echo "Webhook call complete"
98+
# job-deploy-staging:
99+
# runs-on: ubuntu-latest
100+
# needs: [job-sync-project-data, job-checkout-and-build]
101+
# env:
102+
# STAGING_WEBHOOK: ${{ secrets.AMPLIFY_STAGING_WEBHOOK }}
103+
# steps:
104+
# - name: Call Amplify Staging Deploy
105+
# run: |
106+
# echo "Calling Amplify staging webhook"
107+
# curl --silent --show-error --output /dev/null -X POST $STAGING_WEBHOOK -H "Content-Type:application/json"
108+
# echo "**OUTPUT SUPPRESSED**"
109+
# echo "Webhook call complete"
110+
# job-deploy-prod:
111+
# runs-on: ubuntu-latest
112+
# needs: [job-sync-project-data, job-checkout-and-build]
113+
# env:
114+
# PROD_WEBHOOK: ${{ secrets.AMPLIFY_PROD_WEBHOOK }}
115+
# steps:
116+
# - name: Call Amplify Prod Deploy
117+
# run: |
118+
# echo "Calling Amplify prod webhook"
119+
# curl --silent --show-error --output /dev/null -X POST $PROD_WEBHOOK -H "Content-Type:application/json"
120+
# echo "**OUTPUT SUPPRESSED**"
121+
# echo "Webhook call complete"

0 commit comments

Comments
 (0)