-
Notifications
You must be signed in to change notification settings - Fork 199
Conversation
1b287d6
to
afca374
Compare
packages/cli/src/telemetry.ts
Outdated
const { telemetry } = await inquirer.prompt({ | ||
name: 'telemetry', | ||
type: 'confirm', | ||
message: 'telemetry?', |
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 want advice from legal on what should be the wording here.
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.
Hey @frangio and @jcarpanelli! Amazing job in a such short time! 🚢 🍾
Tests are especially well written!
I've left a few comments mostly TypeScript related - Make SKD Typed Again!
@@ -24,6 +24,8 @@ const TruffleConfig = { | |||
if (!networkList[network]) | |||
throw Error(`Given network '${network}' is not defined in your ${this.getTruffleConfigFileName(path)} file`); | |||
config.network = network; | |||
config.networkId = config.network_id; |
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 looks like textbook bad code. Why do we need networkId
and network_id
fields on the same object?
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.
Also I feel TruffleConfig is important enough to receive a type instead.
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.
Why do we need networkId and network_id fields on the same object?
We considered deleting network_id
, but decided to keep it in case it would break something else. I would be okay with deleting it. Would that be better for you?
packages/cli/src/telemetry.ts
Outdated
|
||
function hashField(field: Field, salt: string): string { | ||
const hash = crypto.createHash('sha256'); | ||
hash.update(salt); |
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.
Let's check here if (salt)
because if files will be corrupted we salt with empty string.
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.
What kind of scenario would we be trying to cover for here?
I'm not sure it's worth checking for the empty string. It would be just as bad if we were using any other non-random salt, and there's no way to check for all of them.
I was thinking we might want to also log the version of the CLI that is running. |
ca43e44
to
c19b5ee
Compare
The only thing failing is an unrelated test about |
Co-authored-by: Francisco Giordano <[email protected]>
Co-authored-by: Francisco Giordano <[email protected]>
Co-authored-by: Francisco Giordano <[email protected]>
Co-authored-by: Francisco Giordano <[email protected]>
Co-authored-by: Francisco Giordano <[email protected]>
Co-authored-by: Francisco Giordano <[email protected]>
Co-authored-by: Francisco Giordano <[email protected]>
Co-authored-by: Francisco Giordano <[email protected]>
Co-authored-by: Francisco Giordano <[email protected]>
Co-authored-by: Francisco Giordano <[email protected]>
Co-authored-by: Francisco Giordano <[email protected]>
Co-authored-by: Francisco Giordano <[email protected]>
Co-authored-by: Francisco Giordano <[email protected]>
Co-authored-by: Francisco Giordano <[email protected]>
Co-authored-by: Francisco Giordano <[email protected]>
Co-authored-by Francisco Giordano <[email protected]>
Co-authored-by: Francisco Giordano <[email protected]>
1603978
to
49ec734
Compare
Thanks everyone! 🚀 |
This PR implements telemetry to the
cli
package.TODO:
Add tests.Disable interactive prompt for telemetry (this is the reason why tests are failing).Disable telemetry in CI environments.Write document explaining data collected and how it's anonymized. @frangio should we update this PR description with the document you wrote?Do not hash the network name.Out of scope: