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

✨ enforce check scores are between the min and max #3769

Merged
merged 3 commits into from
Jan 19, 2024

Conversation

spencerschrock
Copy link
Contributor

What kind of change does this PR introduce?

feature / bug fix combined?

What is the current behavior?

there was no logic on what the scores could be

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

if the score is invalid, the Error field is set and the score is replaced with an inconclusive result score.

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

Which issue(s) this PR fixes

Related to #3766

Special notes for your reviewer

I have this split into two commits, because I'm not certain about forcing callers who want InconclusiveResultScore to use CreateInconclusiveResult, but I think it's the right decision. The goal is partly to enforce a consistent coding style, and partly to limit proportions which score to -1 accidentally.

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.)

Added logic to ensure check scores are between 0 and 10

if the score is invalid, the Error field is set and the score is
replaced with an inconclusive result score.

Signed-off-by: Spencer Schrock <sschrock@google.com>
Callers who want the score should use the CreateInconclusiveResult function.
The goal is partly to enforce a consistent coding style, and partly to
limit proportions which score to -1 accidentally.

Signed-off-by: Spencer Schrock <sschrock@google.com>
Copy link

codecov bot commented Jan 4, 2024

Codecov Report

Merging #3769 (106efd5) into main (b556d93) will decrease coverage by 4.86%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3769      +/-   ##
==========================================
- Coverage   75.49%   70.64%   -4.86%     
==========================================
  Files         230      230              
  Lines       15624    15621       -3     
==========================================
- Hits        11795    11035     -760     
- Misses       3103     3911     +808     
+ Partials      726      675      -51     

@spencerschrock
Copy link
Contributor Author

/scdiff generate

Copy link

@spencerschrock
Copy link
Contributor Author

/scdiff generate Dependency-Update-Tool,Packaging,Branch-Protection,Code-Review,Vulnerabilities,CII-Best-Practices,Fuzzing,Pinned-Dependencies,Binary-Artifacts,Token-Permissions,Dangerous-Workflow,License,Maintained,Signed-Releases,Contributors,SAST,Security-Policy,CI-Tests

I'll need to debug the scdiff workflow later to see why the "no checks specified" invocation didn't work.

Copy link

@spencerschrock spencerschrock merged commit 0dcad3a into ossf:main Jan 19, 2024
38 checks passed
@spencerschrock spencerschrock deleted the bug/invalid-scores branch January 19, 2024 21:45
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