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

Feature: Improve dependabot detection thru PRs or parsing config file #874

Closed
arieltorti opened this issue Aug 19, 2021 · 9 comments · Fixed by #2125
Closed

Feature: Improve dependabot detection thru PRs or parsing config file #874

arieltorti opened this issue Aug 19, 2021 · 9 comments · Fixed by #2125
Assignees
Labels
kind/bug Something isn't working

Comments

@arieltorti
Copy link

Describe the bug
When running Scorecard against this repo https://github.com/tngan/samlify I get an score 0 on the Dependency Update Tool check, however the repo does have dependabot.

Reproduction steps
Steps to reproduce the behavior:

  1. Run docker run -e GITHUB_AUTH_TOKEN=<token> gcr.io/openssf/scorecard:stable --show-details --repo=https://github.com/tngan/samlify
  2. Check the score of the Dependency Update Tool.

Expected behavior
Dependency Update Check has a non-zero score because the repo has dependabot.

@arieltorti arieltorti added the kind/bug Something isn't working label Aug 19, 2021
@laurentsimon
Copy link
Contributor

do you have dependabot enabled as a GitHub setting rather than a config file under .github/?

@arieltorti
Copy link
Author

I'm not the owner of the samlify repository so I can't fully confirm.

But after some testing on a private repo I own I noticed that dependabot is not detected if enabled through Github settings, I would suspect same thing is happening with samlify.

@laurentsimon
Copy link
Contributor

yep that makes sense. We encourage owners to make their config public.

That said, we have plans to improve the check to look for dependabot PRs (accepted/rejected) to make the check more robust. Thanks for reminding us, I realized there was no tracking issue for it.

If you're interested in helping, PRs are welcome!

@laurentsimon
Copy link
Contributor

Additional note: we should also check for reverted dependabot PRs by maintainers

@arieltorti
Copy link
Author

That said, we have plans to improve the check to look for dependabot PRs (accepted/rejected) to make the check more robust.

Any ideas on how to implement this ? I've been looking at the Github API and haven't found a way to know if the repository has dependabot (or similar) enabled.
Another way would be to check for commits authored by the dependabot in the last N days, what do you think about it ?

@laurentsimon
Copy link
Contributor

That said, we have plans to improve the check to look for dependabot PRs (accepted/rejected) to make the check more robust.

Any ideas on how to implement this ? I've been looking at the Github API and haven't found a way to know if the repository has dependabot (or similar) enabled.
Another way would be to check for commits authored by the dependabot in the last N days, what do you think about it ?

I think that is a good start and aligned with what we had in mind.
Do you know if this API https://docs.github.com/en/rest/reference/pulls#check-if-a-pull-request-has-been-merged can list PRs that have been rejected/dismissed as well?

@jeffmendoza please let us know if you have better ideas/insights for now.

FYI @inferno-chromium @naveensrinivasan @oliverchang @azeemsgoogle how many days shall we look back for merged PRs?

@laurentsimon
Copy link
Contributor

laurentsimon commented Nov 22, 2021

see also a discussion step-security/agent#35 (comment), between dependabot security and dependabot dep. We should check whether the config file can differentiate between the two types of dependabot.

FYI @varunsh-coder

@laurentsimon laurentsimon changed the title BUG Dependency update bot not detected Feature: Improve dependabot detection thru PRs or parsing config file Nov 22, 2021
@laurentsimon
Copy link
Contributor

(renaming the title of this issue to Feature: Improve dependabot detection thru PRs or parsing config file)

@azeemshaikh38
Copy link
Contributor

Looking at PRs to get a hint about dependabot usage sounds like a good idea to me. I would say a good starting point would be to use the existing ListMergedPRs API. We can then consider expanding the support to non-merged or reverted PRs too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
3 participants