-
Notifications
You must be signed in to change notification settings - Fork 5
feat(mcl/host_info): Upload results to Coda #104
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
Conversation
00b941d to
8c7b681
Compare
b5368a3 to
fcf842e
Compare
66797ca to
b9b7a6c
Compare
262859d to
f00425a
Compare
|
Thanks for your Pull Request! Below you will find a summary of the cachix status of each package, for each supported platform.
|
| import std.array : join; | ||
| import std.algorithm : map; | ||
| import std.conv : to; | ||
| import std.stdio : writeln; |
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 like this line is unused:
| import std.stdio : writeln; |
| coda.deleteRow("dEJJPwdxcw", tables[0].id, resp[0]); | ||
| } | ||
|
|
||
| void updateOrInsertRow(string docId, string tableId, RowValues values) { |
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.
According to the Coda Api docs, we should be able to directly create an "Upsert" request, without first fetching the data:
https://coda.io/developers/apis/v1#tag/Rows/operation/upsertRows
Can you look into directly doing an upsert?
| info.hardwareInfo.displayInfo = getDisplayInfo(); | ||
| info.hardwareInfo.graphicsProcessorInfo = getGraphicsProcessorInfo(); | ||
|
|
||
| if (params.codaApiToken) { |
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.
Inform the user of this conditional behavior by logging:
- No Coda API token specified -> not uploading to Coda
- Coda API token specified -> uploading
(feed free to rephrase the messages)
| { | ||
| } | ||
| } | ||
| Params params; |
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.
Avoid global variables, as they make the control flow harder to reason about as the codebase evolves.
| export void host_info() | ||
| { | ||
| const params = parseEnv!Params; | ||
| params = parseEnv!Params; |
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.
This should remain a local const variable. If necessary add parameters to the functions that need to access it.
| folder-size-metrics = pkgs.callPackage ./folder-size-metrics { }; | ||
| } | ||
| // optionalAttrs (system == "x86_64-linux") { | ||
| // optionalAttrs (system == "x86_64-linux") rec { |
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 don't think we need to make this attrset recursive:
| // optionalAttrs (system == "x86_64-linux") rec { | |
| // optionalAttrs (system == "x86_64-linux") { |
| import mcl.utils.number : humanReadableSize; | ||
| import mcl.utils.array : uniqIfSame; | ||
| import mcl.utils.nix : Literal; | ||
| import mcl.utils.coda; |
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.
Use selective imports:
| import mcl.utils.coda; | |
| import mcl.utils.coda : CodaApiClient, RowValues, CodaCell; |
Co-authored-by: Petar Kirov <[email protected]>
No description provided.