Skip to content

Commit

Permalink
fix: add ignore to archived and forked repositories on search (#56)
Browse files Browse the repository at this point in the history
Many orgs have multiple repos that are forks and archived. adding
`isArchived: false` and `isFork: false` to the `repositories` query
reduces the overhead of getting metrics on non-maintained repositories
and increases performance by reducing the amount of subsequent calls and
iterations. This may be feature flagged via config in the future.
  • Loading branch information
adrielp authored Jul 27, 2023
1 parent e16041e commit 52d2552
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func (ghs *githubScraper) scrape(ctx context.Context) (pmetric.Metrics, error) {
HasNextPage bool
}
Edges []RepositoryEdge
} `graphql:"repositories(first: 100, affiliations:OWNER, after: $repoCursor)"`
} `graphql:"repositories(first: 100, affiliations: OWNER, after: $repoCursor, isArchived: false, isFork: false)"`
} `graphql:"user(login: $login)"`
}

Expand All @@ -319,7 +319,7 @@ func (ghs *githubScraper) scrape(ctx context.Context) (pmetric.Metrics, error) {
HasNextPage bool
}
Edges []RepositoryEdge
} `graphql:"repositories(first: 100, after: $repoCursor)"`
} `graphql:"repositories(first: 100, after: $repoCursor, affiliations: OWNER, isArchived: false, isFork: false)"`
} `graphql:"organization(login: $login)"`
}

Expand Down

0 comments on commit 52d2552

Please sign in to comment.