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 AffectsOverallServiceLevels field to Scorecard and ScorecardInput #282

Merged

Conversation

davidbloss
Copy link
Contributor

Issues

#71

Changelog

Add AffectsOverallServiceLevels field to Scorecard and ScorecardInput structs

  • List your changes here
  • Make a changie entry

Tophatting

task test passes all tests

@davidbloss davidbloss requested review from rocktavious and a user October 20, 2023 19:43
@codecov
Copy link

codecov bot commented Oct 20, 2023

Codecov Report

Merging #282 (55e98d3) into main (eb1f300) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #282      +/-   ##
==========================================
- Coverage   77.45%   77.43%   -0.02%     
==========================================
  Files          50       50              
  Lines        3335     3333       -2     
==========================================
- Hits         2583     2581       -2     
  Misses        549      549              
  Partials      203      203              
Files Coverage Δ
common.go 94.59% <100.00%> (-0.28%) ⬇️
scorecards.go 90.16% <ø> (ø)

p := new(bool)
*p = v
return p
return &v
Copy link

Choose a reason for hiding this comment

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

I'm confused about this change and the function in general, doesn't this have a different result than the comment above this function?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@taimoor-at-opslevel So the problem is that you cannot do this

input := ScorecardInput{
  AffectsOverallServiceLevels: &true
}

So you have two ways to fix it - pass the bool value through a function to get it stored in a var and then return the address of the variable

input := ScorecardInput{
  AffectsOverallServiceLevels: ol.Bool(true)
}

OR make a local var and give the address

myBool := true
input := ScorecardInput{
  AffectsOverallServiceLevels: &myBool
}

Copy link
Collaborator

@rocktavious rocktavious Oct 20, 2023

Choose a reason for hiding this comment

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

The way the function was originally written was unnecessary - its creates an unneeded pointer - the way David fixed it is more idomatic go.

But you are right we should probably adjust the function docstring

@rocktavious
Copy link
Collaborator

Gonna merge this and fixup the doc string later

@rocktavious rocktavious merged commit 2408eec into main Oct 20, 2023
5 checks passed
@rocktavious rocktavious deleted the db/add-affectsOverallServiceLevels-field-to-scorecard branch October 20, 2023 20: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.

2 participants