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: Group commits into changesets #2260

Merged
merged 12 commits into from
Sep 20, 2022

Conversation

raghavkaul
Copy link
Contributor

@raghavkaul raghavkaul commented Sep 13, 2022

What kind of change does this PR introduce?

Introduce a Changeset construct, which contains several Commits that were reviewed as a unit, along with any associated review activity.

What is the current behavior?

Today, scorecard inconsistently uses either Commits or Pull Requests. Commits are more universal than PRs, but evaluating each Commit in a vacuuum may lead to scoring incorrectly when there are multiple, unsquashed commits in a repo's history which all really were part of a singular "code review". This is also the case with CI test runs, where we look at tests run on individual commits, when tests are really run on all commits that are part of an unsquashed PR.

What is the new behavior (if this is a feature change)?**

Scorecard will batch all related commits that are part of a single GitHub Merge request or Phabricator differential revision into a single Changeset. If a commit is not linked to any external SCM or we can't find the associated code review, the commit is part of a standalone changeset.

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

Special notes for your reviewer

  • Not all SCMs are supported equally
  • For Phabricator, we now consider a Differential Revision "reviewed" even if there is no "Reviewed By" line
  • Scoring should not be affected by this PR

Does this PR introduce a user-facing change?

Raw Results: Commits are now grouped into changesets and associated with review activity, if any

@raghavkaul raghavkaul changed the title Feature changesets 🌱 Feature: Group commits into changesets Sep 13, 2022
@codecov
Copy link

codecov bot commented Sep 13, 2022

Codecov Report

Merging #2260 (f1bb485) into main (3629fd8) will increase coverage by 0.41%.
The diff coverage is 51.02%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2260      +/-   ##
==========================================
+ Coverage   44.45%   44.87%   +0.41%     
==========================================
  Files          95       95              
  Lines        7987     7953      -34     
==========================================
+ Hits         3551     3569      +18     
+ Misses       4173     4121      -52     
  Partials      263      263              

Signed-off-by: Raghav Kaul <[email protected]>
Signed-off-by: Raghav Kaul <[email protected]>
checks/code_review.go Outdated Show resolved Hide resolved
@azeemshaikh38
Copy link
Contributor

I took a quick glance, will take a closer tomorrow and provide my detailed feedback.

Just wanted to comment to say this is an awesome change and will really help improve Scorecard results - thanks for working through this!

clients/pull_request.go Outdated Show resolved Hide resolved
clients/pull_request.go Outdated Show resolved Hide resolved
clients/user.go Outdated Show resolved Hide resolved
checks/raw/code_review.go Outdated Show resolved Hide resolved
checks/raw/code_review.go Outdated Show resolved Hide resolved
checks/raw/code_review.go Outdated Show resolved Hide resolved
checks/raw/code_review.go Outdated Show resolved Hide resolved
checks/raw/code_review.go Outdated Show resolved Hide resolved
checks/raw/code_review.go Outdated Show resolved Hide resolved
clients/pull_request.go Outdated Show resolved Hide resolved
Signed-off-by: Raghav Kaul <[email protected]>
raghavkaul and others added 2 commits September 19, 2022 16:06
* Handle randomized order
* e2e

Signed-off-by: Raghav Kaul <[email protected]>
@raghavkaul raghavkaul temporarily deployed to integration-test September 19, 2022 17:23 Inactive
@github-actions
Copy link

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

Copy link
Contributor

@azeemshaikh38 azeemshaikh38 left a comment

Choose a reason for hiding this comment

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

LGTM with comments. Thanks for fixing this!

checker/raw_result.go Outdated Show resolved Hide resolved
checker/raw_result.go Outdated Show resolved Hide resolved
checks/code_review_test.go Show resolved Hide resolved
checks/evaluation/code_review.go Outdated Show resolved Hide resolved
checks/evaluation/code_review.go Outdated Show resolved Hide resolved
checks/evaluation/code_review.go Outdated Show resolved Hide resolved
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

Signed-off-by: Raghav Kaul <[email protected]>
@raghavkaul raghavkaul temporarily deployed to integration-test September 20, 2022 17:23 Inactive
@azeemshaikh38 azeemshaikh38 temporarily deployed to integration-test September 20, 2022 17:34 Inactive
@azeemshaikh38 azeemshaikh38 enabled auto-merge (squash) September 20, 2022 17:35
@github-actions
Copy link

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

@github-actions
Copy link

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

@azeemshaikh38 azeemshaikh38 merged commit d75dea8 into ossf:main Sep 20, 2022
N8BWert pushed a commit to N8BWert/scorecard that referenced this pull request Sep 23, 2022
* Group raw commits into changesets

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

* Add tests, fix golint

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

* Fix lint

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

* Address PR comments

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

* Fix test failures, remove unneeded fields from raw results

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

* Fix lint

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

* Fix tests

* Handle randomized order
* e2e

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

* Accept code reviews on any commit, not just HEAD

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

* Address PR comments

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

Signed-off-by: Raghav Kaul <[email protected]>
Co-authored-by: Azeem Shaikh <[email protected]>
N8BWert pushed a commit to N8BWert/scorecard that referenced this pull request Nov 28, 2022
* Group raw commits into changesets

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

* Add tests, fix golint

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

* Fix lint

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

* Address PR comments

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

* Fix test failures, remove unneeded fields from raw results

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

* Fix lint

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

* Fix tests

* Handle randomized order
* e2e

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

* Accept code reviews on any commit, not just HEAD

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

* Address PR comments

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

Signed-off-by: Raghav Kaul <[email protected]>
Co-authored-by: Azeem Shaikh <[email protected]>
Signed-off-by: nathaniel.wert <[email protected]>
N8BWert pushed a commit to N8BWert/scorecard that referenced this pull request Nov 28, 2022
* Group raw commits into changesets

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

* Add tests, fix golint

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

* Fix lint

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

* Address PR comments

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

* Fix test failures, remove unneeded fields from raw results

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

* Fix lint

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

* Fix tests

* Handle randomized order
* e2e

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

* Accept code reviews on any commit, not just HEAD

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

* Address PR comments

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

Signed-off-by: Raghav Kaul <[email protected]>
Co-authored-by: Azeem Shaikh <[email protected]>
N8BWert pushed a commit to N8BWert/scorecard that referenced this pull request Nov 28, 2022
* Group raw commits into changesets

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

* Add tests, fix golint

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

* Fix lint

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

* Address PR comments

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

* Fix test failures, remove unneeded fields from raw results

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

* Fix lint

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

* Fix tests

* Handle randomized order
* e2e

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

* Accept code reviews on any commit, not just HEAD

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

* Address PR comments

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

Signed-off-by: Raghav Kaul <[email protected]>
Co-authored-by: Azeem Shaikh <[email protected]>
Signed-off-by: nathaniel.wert <[email protected]>
N8BWert pushed a commit to N8BWert/scorecard that referenced this pull request Nov 28, 2022
* Group raw commits into changesets

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

* Add tests, fix golint

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

* Fix lint

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

* Address PR comments

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

* Fix test failures, remove unneeded fields from raw results

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

* Fix lint

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

* Fix tests

* Handle randomized order
* e2e

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

* Accept code reviews on any commit, not just HEAD

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

* Address PR comments

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

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

3 participants