Skip to content

Commit

Permalink
Update the generate script to *not* delete repositories if there are …
Browse files Browse the repository at this point in the history
…no active issues. Also did some minor renaming
  • Loading branch information
seanmarcia committed Sep 16, 2023
1 parent 53a0cb0 commit 5b13425
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 140 deletions.
124 changes: 0 additions & 124 deletions firstissue.json

This file was deleted.

21 changes: 6 additions & 15 deletions generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import fs from "fs";
import millify from "millify";
import slugify from "slugify";

import firstissue from "./firstissue.json";
import happycommits from "./happycommits.json";
import {
CountableTag as CountableTagModel,
Issue as IssueModel,
Expand Down Expand Up @@ -94,7 +94,6 @@ const getRepositories = async (
...repositories.map((repo) => `repo:${repo}`),
"archived:false",
"is:public",
"stars:>=1",
`pushed:>=${dayjs().add(-1, "month").format("YYYY-MM-DD")}`
].join(" ");

Expand Down Expand Up @@ -149,7 +148,7 @@ const getRepositories = async (
}
description
url
repositoryTopics(first: 10) {
repositoryTopics(first: 20) {
edges {
node {
topic {
Expand Down Expand Up @@ -242,11 +241,11 @@ const getRepositories = async (

// unfortunately, there's no way to filter repositories by number of issues in the search query
// filter out repos with less than 3 open issues
return repoData.filter((repo) => repo.issues.length >= 3);
return repoData;
};

[...new Set(firstissue.repositories)]
.slice(0, process.env.NODE_ENV === "development" ? 200 : firstissue.repositories.length)
[...new Set(happycommits.repositories)]
.slice(0, process.env.NODE_ENV === "development" ? 200 : happycommits.repositories.length)
.reduce((repoChunks: string[][], repo: string, index) => {
// Split repositories into smaller chunks, this helps prevent request timeouts
const chunkIndex = Math.floor(index / REPOS_PER_REQUEST);
Expand All @@ -261,7 +260,7 @@ const getRepositories = async (
console.log(
`Getting repositories - chunk ${index + 1} of ${arr.length} (size: ${chunk.length})`
);
const repositories = await getRepositories(chunk, firstissue.labels);
const repositories = await getRepositories(chunk, happycommits.labels);

// wait 1s between requests
await new Promise((resolve) => setTimeout(resolve, 1000));
Expand Down Expand Up @@ -315,14 +314,6 @@ const getRepositories = async (
fs.writeFileSync("./generated.json", JSON.stringify(data));
console.log("Generated generated.json");

// Update firstissue.json with new list of repositories
firstissue.repositories = data.repositories
.map((repo) => `${repo.owner}/${repo.name}`)
// Sort alphabetically
.sort((a, b) => a.localeCompare(b));
fs.writeFileSync("./firstissue.json", JSON.stringify(firstissue, null, 2));
console.log("Generated firstissue.json");

// Build sitemap
const sitemap = `<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
Expand Down
2 changes: 1 addition & 1 deletion generated.json

Large diffs are not rendered by default.

129 changes: 129 additions & 0 deletions happycommits.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
{
"repositories": [
"qlt2020/doskaz",
"Altinn/altinn-studio",
"apache/fineract",
"decentralised-dataexchange/acapy-mydata-did-protocol",
"Bahmni/bahmni-core",
"medic/cht-core",
"coronasafe/care",
"Sunbird-cQube/cQube_Base",
"egovernments/DIGIT-OSS",
"egovernments/DIVOC",
"healthsites/healthsites",
"intrahealth/gofr",
"Zenysis/Harmony",
"undp/iVerify-Apps",
"unicef/kindly",
"kimetrica/MERON_api",
"openMF/community-app ",
"mosip/commons",
"mojaloop/central-ledger",
"opencrvs/opencrvs-core",
"I-TECH-UW/OpenELIS-Global-2",
"OpenLMIS/openlmis-ref-distro",
"openmrs/openmrs-contrib-android-client",
"opensrp/opensrp-server-core",
"WFP-VAM/prism-app",
"Bioverse-Labs/forest-map-app",
"rapidpro/rapidpro",
"akrosinc/reveal-client",
"santedb/santedb-server",
"simpledotorg/simple-server",
"statisticsnorway/statbus",
"Sunbird-RC/sunbird-rc-core",
"project-sunbird/sunbird-learning-platform",
"hzi-braunschweig/SORMAS-Project",
"vrapeutic/Rodja-webXR",
"drivendataorg/zamba",
"frappe/erpnext",
"glific/glific",
"Cirrolytix/aedes_dpg",
"kvklrao/Avyantra2023",
"getodk/central",
"dhis2/dhis2-core",
"openimis",
"RentadroneCL/Precision_Agriculture",
"Aam-Digital/ndb-core",
"Global-Policy-Lab/cider",
"dimagi/commcare-hq",
"OpenFn/core",
"globaleaks/GlobaLeaks",
"commitglobal/website-factory",
"commitglobal/housing-platform",
"commitglobal/hiv-support",
"nordic-institute/X-Road",
"Amref-Health-Africa-in-Uganda/sanidigslive03",
"cdsframework/ice",
"google/android-fhir",
"IntelliSOFT-Consulting/pvers",
"Scribble-Works/screenshot",
"CodeYourFuture/syllabus",
"MSH/Pharmadex2",
"BLSQ/openhexa-pipelines",
"openspp-project/openspp-docker",
"OpenTeleRehab/patient-service",
"datakind/Data-Observation-Toolkit",
"decentralised-dataexchange/dexa-smartcontracts",
"TIP-Global-Health/eheza-app",
"cboard-org/cboard",
"johnsonandjohnson/vxnaid",
"terraframe/geoprism-registry",
"consul/consul",
"BLSQ/iaso",
"kobotoolbox/kobo-install",
"OTTAA-Project/ottaa_project_flutter",
"global-asp/global-asp",
"primeroIMS/primero",
"Oky-period-tracker/period-tracker-app-whitelabelled-code",
"reconverse/trendeval/",
"IntelliSOFT-Consulting/Newborn-Nutrition-Reference-App",
"drivendataorg/deon",
"AppertaFoundation/openeyes",
"truenas",
"openfisca",
"openg2p",
"MochCare-Gh/service-provider-portal",
"iHRIS/iHRIS",
"decidim/decidim",
"google/fhir-gateway",
"intelligent-environments-lab/CityLearn",
"devgateway/amp",
"undp/carbon-registry",
"johnsonandjohnson/openmrs-distro-cfl",
"ifmeorg/ifme-languagetools",
"JanssenProject/jans",
"policyengine/policyengine-app",
"learningequality/ricecooker",
"somleng",
"synthetichealth/synthea-international",
"safeyou-space/safeyou",
"a2i-dpg/ekShop",
"epiverse-trace/finalsize",
"ckan/ckan",
"esatya/rahat-aid-connect ",
"moodle/moodle",
"farmOS",
"openforis/collect",
"Sunbird-Obsrv",
"undpindia/data4policy",
"Intelehealth/intelehealth-openmrs-ui",
"Ozim-Platform",
"NMF-earth/nmf-app/",
"Sunbird-Serve/serve-beta",
"eco-index/ecoindex-stack",
"unige-geohealth/accessmod",
"ushahidi/platform-client-mzima",
"Open-Attestation/open-attestation",
"govdirectory/website",
"openkfw/TruBudget",
"rubyforgood/casa",
"rubyforgood/human-essentials",
"rubyforgood/pet-rescue"
],
"labels": [
"good first issue",
"Help Wanted",
"help wanted"
]
}

0 comments on commit 5b13425

Please sign in to comment.