Skip to content
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

BUG: contributor checks does not validate number of companies per contributor #1024

Open
laurentsimon opened this issue Sep 16, 2021 · 15 comments
Labels
good first issue Good for newcomers help wanted Community contributions welcome, maintainers supportive of idea but not a high priority kind/bug Something isn't working needs discussion

Comments

@laurentsimon
Copy link
Contributor

laurentsimon commented Sep 16, 2021

a contributor can forge their company association on GH. (tracked in another issue).
In addition, the number of companies is not verified by our code. That makes it easier for a single user to commit 5 PRs and add 3 companies to their profile, hence getting a top score.

We should only take a single company per user.

@laurentsimon laurentsimon added kind/bug Something isn't working good first issue Good for newcomers help wanted Community contributions welcome, maintainers supportive of idea but not a high priority labels Sep 16, 2021
@github-actions
Copy link

Stale issue message

@justaugustus
Copy link
Member

@laurentsimon
Copy link
Contributor Author

Awesome, thanks @singhsaurabh

@singhsaurabh
Copy link

Thank you @justaugustus @laurentsimon
Regards,

@singhsaurabh
Copy link

Hi @justaugustus I would like to know more about this issue.
Kindly let me know if we can huddle for sometime to understand the background of the issue.
Thank You

@laurentsimon
Copy link
Contributor Author

laurentsimon commented Mar 16, 2022

There are 2 sides:

  1. At the time we created the issue, we fetched the company's name from a field that users can update arbitrarily. So for example, users could set the field to "Google" even though they were not part of the Google org. I'm not 100% sure whether the current codebase has the same problem or not. You nee to check and see if you can forge these result... which is fun!

  2. We don't enforce a number of companies per user. So as a user, I can add 10 companies and it would pass the check with high score. I think we should enforce 1-2 companies per user max. Or maybe even just 1 company.

Please let me know if this help or not.

@singhsaurabh
Copy link

Hi @laurentsimon, I see some settings in checks/contributors.go, is that somewhere I need to make the changes?

const (
minContributionsPerUser = 5
numberCompaniesForTopScore = 3
// CheckContributors is the registered name for Contributors.
CheckContributors = "Contributors"
)

Kindly guide me. Thank You

@singhsaurabh
Copy link

https://github.com/ossf/scorecard/blob/main/docs/checks.md#contributors

do I need to add companies in github profile and test it ?

@laurentsimon
Copy link
Contributor Author

Hi @laurentsimon, I see some settings in checks/contributors.go, is that somewhere I need to make the changes?

const ( minContributionsPerUser = 5 numberCompaniesForTopScore = 3 // CheckContributors is the registered name for Contributors. CheckContributors = "Contributors" )

Kindly guide me. Thank You

I think this requires no changes

@laurentsimon
Copy link
Contributor Author

https://github.com/ossf/scorecard/blob/main/docs/checks.md#contributors

do I need to add companies in github profile and test it ?

yes it would be great to see if this is forgeable or not.

@singhsaurabh
Copy link

Thank You @laurentsimon

@leec94
Copy link
Contributor

leec94 commented Oct 13, 2022

Hi! I'm looking into this issue. Is this issue still a concern/relevant?

Did some test runs and looks like Scorecard looks at both the Company field and Organizations that a user is a part of.
For a repository that was just mine, Scorecard reported 2 companies because I'm part of the IBM org and I added "IBM" to the company field.
Sorry to single @naveensrinivasan out, but his profile was a good example for a test too. Because he's a part of 6 organizations, Scorecard returned 6 companies found on his repo https://github.com/naveensrinivasan/naveensrinivasan.

My question here is what should Scorecard be looking at for company? Company field can be easily forged, but looking at Org may cause many results. We could look at only the first Org that's selected, but it may not be the company the contributor is actually working for.

@LappleApple
Copy link

Reviewed in community backlog refinement: Not clear whether we need to generate the unique set or pick one org per user and create a set from that. Needs more discussion.

@klbynum
Copy link
Contributor

klbynum commented Jul 31, 2024

Hey @spencerschrock, my team (@SilasVM & @Jordin221) and I have been looking into this issue. We noticed this bug is related to issues #3996 and #4175. We also noticed you closed PR #3673 and mentioned it is not a high priority bug. We were wondering if we should work on this or look into another good first issue.

Thank you!

@spencerschrock
Copy link
Contributor

Hey @spencerschrock, my team (@SilasVM & @Jordin221) and I have been looking into this issue. We noticed this bug is related to issues #3996 and #4175. We also noticed you closed PR #3673 and mentioned it is not a high priority bug. We were wondering if we should work on this or look into another good first issue.

Thank you!

So the Contributors check in general is very much on the heuristic end of analysis, and is game-able from a few different angles. I think the problem is trickier than it seems if we want to avoid edge cases, as it's an optimization problem. There will likely be more complex edge cases when the companies overlap more between contributors.

I think there are some more straightforward issues to tackle if you wanted a first issue, but up to you.

#4029, #4030, #3915, #3832, #3701, #2174

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Community contributions welcome, maintainers supportive of idea but not a high priority kind/bug Something isn't working needs discussion
Projects
Status: Backlog - Bugs
Development

No branches or pull requests

9 participants