-
-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Add support to skip users #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/server/lib/contributors.js
Outdated
| const query = gql` | ||
| query GithubContributors($collectiveSlug: String) { | ||
| Collective(slug: $collectiveSlug) { | ||
| collective(slug: $collectiveSlug) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is relevant here but due to opencollective/opencollective#6899 I couldn't test this towards the dev API. Instead I ran it against both https://api.opencollective.com/graphql and https://api.opencollective.com/graphql/v2 and both of them defines this method as lowercase collective.
Similarly there's no field named githubContributors but a contributors witch contains contributor nodes.
I can revert these changes that's not related to banner.js if you can help me confirm it's not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though I never really got the dev API working I was browsing around the code. Seems like the local V1 is using Collective but neither ones posted above or V2 in the dev API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://api.opencollective.com/graphql is defaulting to https://api.opencollective.com/graphql/v2, they're indeed the same thing. The legacy API is available as https://api.opencollective.com/graphql/v1 and the field is indeed exposed as Collective there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The contributors field is different: it's meant to surface your financial contributors on Open Collective, while githubContributors is the list of contributors to your repository. I suggest rolling back that part. I can then test and merge your changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reverted these changes! If it's not too much effort, do you mind a quick explanation on how you test this? As mentioned I had to create a real key and use the public API to test this but obviously I tested v2 two times by mistake 🙈
I opted to setup the test API with PostgreSQL 13 which is latest version I got working but it didn't work out of the box even though I was ensuring I was setting the right key that was set in the .env. Also is there another way other than querying the db for collectives to see what data is in the dump to test things like this? Something like a GraphQL Playground/Grapiql?
Betree
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for opening this PR! I’ve added some comments above, but the feature proposal is welcome. Out of curiosity, where did this need arise from? We’re actively working on combating spam and handling questionable contributors on the platform, so your feedback is valuable.
|
Thanks for the review!
We were simplifying the contributions list in golangci/golangci-lint#5148 and wanted to use this feature to make the process simpler. The process we had already supported filter out contributors but mainly to remove bots and non-human contributors. In golangci/golangci-lint#2974 we were asked to also remove a specific individual from our contributors list which was merged. Since we now have this image in our readme I was looking for a simple way to support this. Mainly with respect to the ask we got, but also to remove bots since we have a few of them with many automated contributions. |
Add a new query parameter `skip` that can be specified multiple times to skip specific users. Can be used to filter out bots or other users that don't want to be a part of the contributors list.
Followup from #5148. It's now supported to filter out users since opencollective/contributors-svg#68 got merged so this will restore the previously ignored users + add `dependabot[bot]`.
Add a new query parameter
skipthat can be specified multiple times to skip specific users. Can be used to filter out bots or other users that don't want to be a part of the contributors list.