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

🐛 Ensure CODEOWNERS file exists for corresponding Branch-Protection check #2463

Merged
merged 5 commits into from
Dec 14, 2022

Conversation

raghavkaul
Copy link
Contributor

What kind of change does this PR introduce?

Ensure that the CODEOWNRS file exists for the corresponding Branch-Protection check by gathering a set of CODEOWNERS files in the repo. If file doesn't exist, CODEOWNERS branch protection is not in effect even if the setting is enabled. This fixes a bug where we would have incorrectly reported scores for the branch protection check.

  • Tests for the changes have been added (for bug fixes/features)

Which issue(s) this PR fixes

Fixes #2348.

@raghavkaul raghavkaul temporarily deployed to integration-test November 18, 2022 15:55 Inactive
@raghavkaul raghavkaul changed the title Ensure CODEOWNERS file exists for corresponding Branch-Protection check 🐛 Ensure CODEOWNERS file exists for corresponding Branch-Protection check Nov 18, 2022
@github-actions
Copy link

Integration tests success for
[35b67cd]
(https://github.com/ossf/scorecard/actions/runs/3498334133)

@codecov
Copy link

codecov bot commented Nov 18, 2022

Codecov Report

Merging #2463 (f4431fc) into main (93ef087) will decrease coverage by 0.03%.
The diff coverage is 32.55%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2463      +/-   ##
==========================================
- Coverage   39.95%   39.92%   -0.04%     
==========================================
  Files         122      122              
  Lines        9815     9852      +37     
==========================================
+ Hits         3922     3933      +11     
- Misses       5612     5637      +25     
- Partials      281      282       +1     

Copy link
Contributor

@laurentsimon laurentsimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

checks/raw/branch_protection.go Show resolved Hide resolved
checks/evaluation/branch_protection.go Outdated Show resolved Hide resolved
@raghavkaul raghavkaul temporarily deployed to integration-test November 30, 2022 16:49 Inactive
@github-actions
Copy link

Integration tests success for
[0146987]
(https://github.com/ossf/scorecard/actions/runs/3585330629)

Copy link
Contributor

@laurentsimon laurentsimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Can you also add the raw result changes to pkg/json_raw_results.go?

* If CODEOWNERS file doesn't exist, CODEOWNERS branch protection is not
  in effect even if the setting is enabled

Signed-off-by: Raghav Kaul <[email protected]>
Signed-off-by: Raghav Kaul <[email protected]>
@raghavkaul raghavkaul temporarily deployed to integration-test December 8, 2022 16:25 — with GitHub Actions Inactive
@github-actions
Copy link

github-actions bot commented Dec 8, 2022

Integration tests success for
[8719a2b]
(https://github.com/ossf/scorecard/actions/runs/3650137292)

@laurentsimon laurentsimon enabled auto-merge (squash) December 8, 2022 17:42
@raghavkaul raghavkaul temporarily deployed to integration-test December 12, 2022 18:07 — with GitHub Actions Inactive
@github-actions
Copy link

Integration tests success for
[32bc2d6]
(https://github.com/ossf/scorecard/actions/runs/3678501377)

@raghavkaul raghavkaul temporarily deployed to integration-test December 14, 2022 16:28 — with GitHub Actions Inactive
@github-actions
Copy link

Integration tests success for
[f4431fc]
(https://github.com/ossf/scorecard/actions/runs/3696745401)

@laurentsimon laurentsimon self-requested a review December 14, 2022 16:55
@laurentsimon laurentsimon merged commit 746b6e9 into ossf:main Dec 14, 2022
raghavkaul added a commit to raghavkaul/scorecard that referenced this pull request Feb 9, 2023
…heck (ossf#2463)

* Ensure CODEOWNERS file exists for corresponding Branch-Protection check

* If CODEOWNERS file doesn't exist, CODEOWNERS branch protection is not
  in effect even if the setting is enabled

Signed-off-by: Raghav Kaul <[email protected]>

* cr comments

Signed-off-by: Raghav Kaul <[email protected]>

Signed-off-by: Raghav Kaul <[email protected]>
Co-authored-by: laurentsimon <[email protected]>
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.

Feature
2 participants