Add discover-orgs script: pre-record prominent orgs for backfill#117
Closed
peetzweg wants to merge 1 commit into
Closed
Add discover-orgs script: pre-record prominent orgs for backfill#117peetzweg wants to merge 1 commit into
peetzweg wants to merge 1 commit into
Conversation
Prefills the DB with more organizations to look up. GitHub has no endpoint that ranks orgs by public-member count, so this searches type:org by followers (the best prominence proxy — repos-sort returns education/spam orgs), enriches each candidate with fetchOrgProfile to get its real public member count, sorts/filters by that, and records the survivors as entities rows (kind='org', builtAt null). backfill-orgs.ts then fills them. Separate from backfill-orgs.ts by design. --limit / --min-members / --query / --dry-run flags; skips already-tracked orgs; idempotent upsert; paced under the search (30/min) and GraphQL (5k/hr, 500 floor) limits.
Owner
Author
|
Folded into #104 so both org scripts live in one PR, side by side, to test and merge together. Branch feature-discover-orgs merged into feature-backfill-orgs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A companion to
backfill-orgs.tsfor prefilling the DB with more organizations to look up.The catch (answering "can we fetch orgs by member count?"): GitHub has no endpoint that ranks orgs by public-member count — the Search API returns only login/id, caps at 1,000 results, and can't sort or filter by members. So we can't ask for "biggest orgs" directly.
How: search
type:orgsorted by followers (the best prominence proxy — sorting by repos returns education/spam orgs), then enrich each candidate withfetchOrgProfileto get its actual public member count, sort/filter by that, and record the survivors asentitiesrows (kind='org',builtAtnull).backfill-orgs.tsthen fills them.Kept as its own script on purpose. Flags:
--limit(max 1000),--min-members,--query,--dry-run. Skips already-tracked orgs; idempotent upsert; paced under the search (30/min) and GraphQL (5k/hr, 500 floor) limits. Needs theread:orgtoken, so run withenv -u GITHUB_TOKEN.Verified with a read-only
--dry-run: returns real member counts, most-first, and skips known orgs.