-
Notifications
You must be signed in to change notification settings - Fork 22
Add an API endpoint to generate a CSV compliance report #167
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 an API endpoint to generate a CSV compliance report #167
Conversation
825fdd8
to
e69ffa9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good overall! Easy to follow.
c1ba460
to
a34432e
Compare
a34432e
to
0e7e43e
Compare
1455258
to
a1b3dc5
Compare
@JustinKuli @mprahl Ready again Thanks!!! |
a1b3dc5
to
52cff6b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/hold for Matt
LGTM overall! I just had one (almost inconsequential) comment. I didn't check if Matt had any remaining requests.
52cff6b
to
f42aa4d
Compare
return vv | ||
case int32: | ||
// All int32 related id | ||
if int(vv) == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0 mean id is empty
@mprahl @JustinKuli Ready Again! Thanks all |
case int32: | ||
// All int32 related id | ||
if int(vv) == 0 { | ||
return "nil" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think no value is more readable in a spreadsheet.
return "nil" | |
return "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about
case JSONMap:
if vv == nil {
return "nil"
}
Since most nil cases change to ""? should we change this too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jsonByte, err := json.MarshalIndent(vv, "", " ") output like this:
"{
""test"": true
}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But in Mac spreadsheet and slack spreadsheet looks fine
{
"severity": "low",
"test": "one"
}
return vv.String() | ||
case pq.StringArray: | ||
// nil will be [] | ||
return fmt.Sprintf("%v", vv) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you do a strings.Join on this so that you get val1, val2
. This is more friendly than an array like syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Join with a comma is confusing because CSV is comma-based. Is there any other way??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the CSV writer not escape the commas for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strings.join
output is like this:
"cat-3, cat-4"
which looks good to me
return fmt.Sprintf("%v", vv) | ||
default: | ||
// case nil: | ||
return "nil" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be a programming error if we encounter a type we do not know how to convert?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think at least, you could return this:
return "nil" | |
return fmt.Sprintf("%v", vv) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error
looks like this:
,configmaps [common] found in namespace default,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very close!
Ref: https://issues.redhat.com/browse/ACM-6884 Signed-off-by: Yi Rae Kim <[email protected]>
f42aa4d
to
ef8c2a0
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mprahl, yiraeChristineKim The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Generating a report as described in the design.
Ref: https://issues.redhat.com/browse/ACM-6884