Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
e319a6b
fix: drop projects classic support
mikey- May 5, 2025
d2497e1
self rely this ish
mikey- May 5, 2025
3ec14e1
fix: notable not showing users for user-owned repositories
felipecrs May 23, 2025
f1a8dc6
Fix CI pipeline failure in forked repository (#1719)
felipecrs May 23, 2025
d8c7de3
fix: docker image not building
felipecrs May 23, 2025
953e81b
fix: chrome not found in docker image
felipecrs May 23, 2025
fe27bd4
Add deno and licensed back
felipecrs May 23, 2025
5572a16
Fix workflow tests with docker image
felipecrs May 24, 2025
cbce014
Avoid reinstalling all dependencies in docker test
felipecrs May 24, 2025
3caf891
Merge remote-tracking branch 'felipecrs/master'
mikey- Jun 5, 2025
606933e
update actions/github-script to v7
mikey- Jun 5, 2025
2437fc6
update actions/checkout to v4
mikey- Jun 5, 2025
8db9e30
update actions/setup-node to v4
mikey- Jun 5, 2025
7395222
updated actions/labeler to v5 & added ci labels
mikey- Jun 5, 2025
8319975
updated check-spelling/check-spelling to v0.0.25
mikey- Jun 5, 2025
9568a19
updated actions/stale to v9
mikey- Jun 5, 2025
22d8aef
updated dessant/lock-threads to v5
mikey- Jun 5, 2025
a0530a8
missed 2 instances of actions/checkout@v3
mikey- Jun 5, 2025
9ef835c
missed 1 instances of actions/setup-node@v3
mikey- Jun 5, 2025
9117cf1
undo changes to .github/scripts/files/examples.yml
mikey- Jun 5, 2025
b54f55e
add myself to "Repository level file" changers list
mikey- Jun 5, 2025
22e3a9e
undo changes to .github/workflows/examples.yml
mikey- Jun 5, 2025
197c19d
see https://github.com/lowlighter/metrics/pull/1715#pullrequestreview…
mikey- Jun 5, 2025
8ec0dd1
inclusivity: default branch is 'main'
mikey- Jun 5, 2025
2a37f34
Merge branch 'fix-ci-outdated-actions'
mikey- Jun 5, 2025
5bff23f
updated cpell dictionaries
mikey- Jun 5, 2025
433fb57
added many extra dictionaries
mikey- Jun 5, 2025
c947505
the allow list grows
mikey- Jun 5, 2025
7ff48e7
[check-spelling] Update metadata
mikey- Jun 5, 2025
888fc92
removed excessive extra dictionaries
mikey- Jun 5, 2025
e3ee44d
sync-labels is boolean
mikey- Jun 5, 2025
181eef8
Merge branch 'fix-ci-outdated-actions'
mikey- Jun 5, 2025
29d6ce0
Update check-spelling metadata
mikey- Jun 5, 2025
6c84aef
chore(deps): bump the npm_and_yarn group with 31 updates
dependabot[bot] May 5, 2025
9c5f4ff
Merge pull request #1 from mikey-/dependabot-npm_and_yarn-npm_and_yar…
mikey- Jun 5, 2025
8fe26f1
trying a different profile on 16personalities test
mikey- Jun 5, 2025
44da470
fix typo - replace / for : in cpp extra dictionary
mikey- Jun 5, 2025
c88a73a
Update check-spelling metadata
mikey- Jun 5, 2025
c710b69
check_extra_dictionaries doesn't work like I thought it did
mikey- Jun 5, 2025
0bea348
update github/codeql-action/init and github/codeql-action/analyze to v3
mikey- Jun 5, 2025
b6df0e4
Update check-spelling metadata
mikey- Jun 5, 2025
0f00fbe
Update check-spelling metadata
mikey- Jun 5, 2025
0b9d153
fix: drop projects classic support
mikey- May 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN chmod +x /metrics/source/app/action/index.mjs \
# Install latest chrome dev package, fonts to support major charsets and skip chromium download on puppeteer install
# Based on https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md#running-puppeteer-in-docker
&& apt-get update \
&& apt-get install -y wget gnupg ca-certificates libgconf-2-4 \
&& apt-get install -y xz-utils wget gnupg ca-certificates libgconf-2-4 \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/achievements/queries/achievements.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ query AchievementsDefault {
totalCount
}
}
projects(first: 1, orderBy: {field: CREATED_AT, direction: ASC}) {
projects: projectsV2(first: 1, orderBy: {field: CREATED_AT, direction: ASC}) {
totalCount
#nodes { This requires additional scopes :/
# name
Expand Down
2 changes: 1 addition & 1 deletion source/plugins/achievements/queries/organizations.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ query AchievementsOrganizations {
}
}
}
projects(first: 1, orderBy: {field: CREATED_AT, direction: ASC}) {
projects: projectsV2(first: 1, orderBy: {field: CREATED_AT, direction: ASC}) {
totalCount
}
packages(first: 1, orderBy: {direction: ASC, field: CREATED_AT}) {
Expand Down
25 changes: 6 additions & 19 deletions source/plugins/projects/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ export default async function({login, data, imports, graphql, q, queries, accoun

//Retrieve user owned projects from graphql api
console.debug(`metrics/compute/${login}/plugins > projects > querying api`)
const {[account]: {projects}} = await graphql(queries.projects["user.legacy"]({login, limit, account}))
const {[account]: {projectsV2}} = await graphql(queries.projects.user({login, limit, account}))
projects.nodes.unshift(...projectsV2.nodes)
projects.totalCount += projectsV2.totalCount

//Retrieve repositories projects from graphql api
for (const identifier of repositories) {
Expand All @@ -27,7 +24,7 @@ export default async function({login, data, imports, graphql, q, queries, accoun
const {user, repository, id} = identifier.match(/(?<user>[-\w]+)[/](?<repository>[-\w]+)[/]projects[/](?<id>\d+)/)?.groups ?? {}
let project = null
for (const account of ["user", "organization"]) {
//Try projects beta
//Projects classic has been sunset, so ProjectsV2 is the only option
try {
project = (await graphql(queries.projects.repository({user, repository, id, account})))[account].repository.projectV2
if (project)
Expand All @@ -36,30 +33,20 @@ export default async function({login, data, imports, graphql, q, queries, accoun
catch (error) {
console.debug(error)
}
//Try projects classic
try {
console.debug(`metrics/compute/${login}/plugins > projects > falling back to projects classic for ${identifier}`)
;({project} = (await graphql(queries.projects["repository.legacy"]({user, repository, id, account})))[account].repository)
if (project)
break
}
catch (error) {
console.debug(error)
}
}
if (!project)
throw new Error(`Could not load project ${user}/${repository}`)
//Adding it to projects list
console.debug(`metrics/compute/${login}/plugins > projects > registering ${identifier}`)
project.name = `${project.name} (${user}/${repository})`
projects.nodes.unshift(project)
projects.totalCount++
projectsV2.nodes.unshift(project)
projectsV2.totalCount++
}

//Iterate through projects and format them
console.debug(`metrics/compute/${login}/plugins > projects > processing ${projects.nodes.length} projects`)
console.debug(`metrics/compute/${login}/plugins > projects > processing ${projectsV2.nodes.length} projects`)
const list = []
for (const project of projects.nodes) {
for (const project of projectsV2.nodes) {
//Format date
const time = (Date.now() - new Date(project.updatedAt).getTime()) / (24 * 60 * 60 * 1000)
let updated = new Date(project.updatedAt).toDateString().substring(4)
Expand All @@ -85,7 +72,7 @@ export default async function({login, data, imports, graphql, q, queries, accoun
list.splice(limit)

//Results
return {list, totalCount: projects.totalCount, descriptions}
return {list, totalCount: projectsV2.totalCount, descriptions}
}
//Handle errors
catch (error) {
Expand Down
17 changes: 0 additions & 17 deletions source/plugins/projects/queries/repository.legacy.graphql

This file was deleted.

18 changes: 0 additions & 18 deletions source/plugins/projects/queries/user.legacy.graphql

This file was deleted.

21 changes: 0 additions & 21 deletions tests/mocks/api/github/graphql/projects.repository.legacy.mjs

This file was deleted.

24 changes: 0 additions & 24 deletions tests/mocks/api/github/graphql/projects.user.legacy.mjs

This file was deleted.

Loading