-
Notifications
You must be signed in to change notification settings - Fork 38
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
feat(usage-view): download usage data in csv format #214
Conversation
ea9b1af
to
a4b3ac0
Compare
Signed-off-by: Michal Wasilewski <[email protected]>
1da3dc6
to
24c879b
Compare
|
||
// save response to a file | ||
var filePath string | ||
if !ctx.IsSet(flagUsageViewCSVFile.Name) { |
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.
If this is not set, we could just print to stdout. My reasoning is one could just call it like spacectl profile usage-view-csv > myfile.csv
, it would also be possible to do additional modifications on the fly if this was possible.
One thing that makes this not great is that we also print things like log.Println("Querying Spacelift for usage data...")
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 guess a global logging flag would be helpful here. Since we don't have that, what we can do is write csv file to stdout
and print messages to stderr
. Although that would be inconsistent with how it's done in other parts of the project. Let me know what you think.
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 guess a global logging flag would be helpful here.
I guess, we should maybe create an issue for this.
Let me know what you think.
I had the idea myself, but didnt suggest it because it is inconsistent. Honestly I have no strong feeling for this. You can merge the code as is. Don't want to block you.
Signed-off-by: Michal Wasilewski <[email protected]>
related to: https://app.clickup.com/t/8693k73r6
Adds support for downloading usage view data in csv format.