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

🐛 Add go installs to Pinned-Dependencies score #3424

Merged
merged 8 commits into from
Aug 25, 2023

Conversation

gabibguti
Copy link
Contributor

What kind of change does this PR introduce?

This is a bug fix. Just like pip and npm installs, go installs were identified but did not count for Pinned-Dependencies score. Now, they do.

What is the current behavior?

go installs are identified as pinned or unpinned and reported by Scorecard, but do not count for Pinned-Dependencies score.

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

go installs now count in the aggregated score for Pinned-Dependencies.

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

Which issue(s) this PR fixes

It's addressing one of the problems reported at #2582

Special notes for your reviewer

Does this PR introduce a user-facing change?

For user-facing changes, please add a concise, human-readable release note to
the release-note

(In particular, describe what changes users might need to make in their
application as a result of this pull request.)

go installs count for Pinned-Dependencies score.

Considering the new go installs dependencies in Pinned-Dependencies score, there are some changes. Now, all tests generate one more Info log for "go installs are all pinned".

Signed-off-by: Gabriela Gutierrez <[email protected]>
Considering the new go installs dependencies in Pinned-Dependencies score, there are some changes. Now, all tests have to weight 7 scores instead of 6.

For "download then run pinned debug and warn", we have a 0 for 2 groups, `dockerDownloadScore` and `scriptScore`. Previously, it scored 4/6 =~ 6, and now it scores 5/7 =~ 7.

Signed-off-by: Gabriela Gutierrez <[email protected]>
Considering the new go installs dependencies in Pinned-Dependencies score, there are some changes. Now, all tests have to weight 7 scores instead of 6.

For "various warnings", we have a 0 for 4 groups, `pipScore`, `dockerDownloadScore`, `scriptScore` and `dockerFromScore`. Previously, it scored 2/6 =~ 3, and now it scores 3/7 =~ 4.

Signed-off-by: Gabriela Gutierrez <[email protected]>
Considering the new go installs dependencies in Pinned-Dependencies score, there are some changes. Now, all tests have to weight 7 scores instead of 6.

For "Validate various warnings and info", we have a 0 for 4 groups, `pipScore`, `dockerDownloadScore`, `scriptScore` and `dockerFromScore`. Previously, it scored 2/6 =~ 3, and now it scores 3/7 =~ 4.

Signed-off-by: Gabriela Gutierrez <[email protected]>
Considering the new go installs dependencies in Pinned-Dependencies score, there are some changes. The repo being tested, `ossf-tests/scorecard-check-pinned-dependencies-e2e`, has third-party GitHub actions pinned, no npm installs, multiple go installs all pinned, and all other dependencies types are unpinned. This gives us 8 for actionScore, 10 for npm score, 10 for goScore, and 0 for all other scores. Previously the total score was 18/6 =~ 3, and now the total score is 28/7 =~ 4. Since all go installs are pinned, there's an additional info log for "go installs are pinned".

Signed-off-by: Gabriela Gutierrez <[email protected]>
When having one unpinned go install and all other dependencies pinned, the score should be 60/7 =~ 8. Also, it should raise 1 warning for the unpinned go install, 7 infos saying the other dependency types are pinned (2 for GHAs, 2 for dockerfile image and downdloads, 1 for script downdloads, 1 for pip installs and 1 for npm installs), and 0 debug logs since the go install dependency does not have an error message.

Signed-off-by: Gabriela Gutierrez <[email protected]>
@gabibguti gabibguti temporarily deployed to gitlab August 24, 2023 19:05 — with GitHub Actions Inactive
@gabibguti gabibguti temporarily deployed to integration-test August 24, 2023 19:05 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Merging #3424 (d9423d0) into main (d6ed810) will increase coverage by 2.64%.
Report is 2 commits behind head on main.
The diff coverage is 70.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3424      +/-   ##
==========================================
+ Coverage   63.80%   66.44%   +2.64%     
==========================================
  Files         183      183              
  Lines       12942    12951       +9     
==========================================
+ Hits         8257     8605     +348     
+ Misses       4226     3861     -365     
- Partials      459      485      +26     

Copy link
Contributor

@spencerschrock spencerschrock left a comment

Choose a reason for hiding this comment

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

conversations are good to resolve, mainly leaving them as FYI comments. I think we should prioritize #3254 before any more forgotten ecosystems.

@spencerschrock spencerschrock temporarily deployed to gitlab August 25, 2023 16:44 — with GitHub Actions Inactive
@spencerschrock spencerschrock temporarily deployed to integration-test August 25, 2023 16:44 — with GitHub Actions Inactive
@spencerschrock spencerschrock merged commit 383e556 into ossf:main Aug 25, 2023
36 checks passed
ashearin pushed a commit to kgangerlm/scorecard-gitlab that referenced this pull request Nov 13, 2023
* feat: Add go install to pinned dependencies score

Signed-off-by: Gabriela Gutierrez <[email protected]>

* test: Fix info logs count

Considering the new go installs dependencies in Pinned-Dependencies score, there are some changes. Now, all tests generate one more Info log for "go installs are all pinned".

Signed-off-by: Gabriela Gutierrez <[email protected]>

* test: Fix "download then run pinned debug and warn"

Considering the new go installs dependencies in Pinned-Dependencies score, there are some changes. Now, all tests have to weight 7 scores instead of 6.

For "download then run pinned debug and warn", we have a 0 for 2 groups, `dockerDownloadScore` and `scriptScore`. Previously, it scored 4/6 =~ 6, and now it scores 5/7 =~ 7.

Signed-off-by: Gabriela Gutierrez <[email protected]>

* test: Fix "various warnings"

Considering the new go installs dependencies in Pinned-Dependencies score, there are some changes. Now, all tests have to weight 7 scores instead of 6.

For "various warnings", we have a 0 for 4 groups, `pipScore`, `dockerDownloadScore`, `scriptScore` and `dockerFromScore`. Previously, it scored 2/6 =~ 3, and now it scores 3/7 =~ 4.

Signed-off-by: Gabriela Gutierrez <[email protected]>

* test: Fix "Validate various warnings and info"

Considering the new go installs dependencies in Pinned-Dependencies score, there are some changes. Now, all tests have to weight 7 scores instead of 6.

For "Validate various warnings and info", we have a 0 for 4 groups, `pipScore`, `dockerDownloadScore`, `scriptScore` and `dockerFromScore`. Previously, it scored 2/6 =~ 3, and now it scores 3/7 =~ 4.

Signed-off-by: Gabriela Gutierrez <[email protected]>

* test: Fix "ossf-tests/scorecard-check-pinned-dependencies-e2e"

Considering the new go installs dependencies in Pinned-Dependencies score, there are some changes. The repo being tested, `ossf-tests/scorecard-check-pinned-dependencies-e2e`, has third-party GitHub actions pinned, no npm installs, multiple go installs all pinned, and all other dependencies types are unpinned. This gives us 8 for actionScore, 10 for npm score, 10 for goScore, and 0 for all other scores. Previously the total score was 18/6 =~ 3, and now the total score is 28/7 =~ 4. Since all go installs are pinned, there's an additional info log for "go installs are pinned".

Signed-off-by: Gabriela Gutierrez <[email protected]>

* test: Unpinned go install score

When having one unpinned go install and all other dependencies pinned, the score should be 60/7 =~ 8. Also, it should raise 1 warning for the unpinned go install, 7 infos saying the other dependency types are pinned (2 for GHAs, 2 for dockerfile image and downdloads, 1 for script downdloads, 1 for pip installs and 1 for npm installs), and 0 debug logs since the go install dependency does not have an error message.

Signed-off-by: Gabriela Gutierrez <[email protected]>

---------

Signed-off-by: Gabriela Gutierrez <[email protected]>
Signed-off-by: Allen Shearin <[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.

None yet

2 participants