Skip to content

Conversation

@bombsimon
Copy link
Contributor

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.

const query = gql`
query GithubContributors($collectiveSlug: String) {
Collective(slug: $collectiveSlug) {
collective(slug: $collectiveSlug) {
Copy link
Contributor Author

@bombsimon bombsimon Nov 21, 2024

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

@Betree Betree left a 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.

@bombsimon
Copy link
Contributor Author

Thanks for the review!

Out of curiosity, where did this need arise from?

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.

bombsimon and others added 3 commits December 6, 2024 13:27
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.
@Betree Betree merged commit 1de6e9f into opencollective:main Dec 6, 2024
2 checks passed
bombsimon added a commit to golangci/golangci-lint that referenced this pull request Dec 6, 2024
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]`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants