-
Notifications
You must be signed in to change notification settings - Fork 29
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
Accomodate params that are lists #1818
Conversation
extension/src/cli/reader.ts
Outdated
@@ -49,7 +49,7 @@ export type StatusesOrAlwaysChanged = StageOrFileStatuses | 'always changed' | |||
|
|||
export type StatusOutput = Record<string, StatusesOrAlwaysChanged[]> | |||
|
|||
export type Value = string | number | boolean | null | |||
export type Value = string | number | boolean | null | number[] |
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.
[F] This was the oversight, we never expected Value
aka param or metric leaf values to be an array.
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 it ever be a string array or even a boolean array?
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.
good point, updated
@@ -27,7 +27,7 @@ const walkValueTree = ( | |||
ancestors: string[] = [] | |||
) => { | |||
for (const [key, value] of Object.entries(tree)) { | |||
if (value && typeof value === 'object') { | |||
if (value && !Array.isArray(value) && typeof value === '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.
typeof [0,1] === 'object'
which meant that we then split the array into different params or metrics and got the error shown in #1814 (everywhere, table was even broken).
get(originalRow, pathArray) | ||
pathArray => originalRow => { | ||
const value = get(originalRow, pathArray) | ||
if (!Array.isArray(value)) { |
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.
f7249d7
to
61bd2e5
Compare
extension/src/cli/reader.ts
Outdated
@@ -49,7 +49,7 @@ export type StatusesOrAlwaysChanged = StageOrFileStatuses | 'always changed' | |||
|
|||
export type StatusOutput = Record<string, StatusesOrAlwaysChanged[]> | |||
|
|||
export type Value = string | number | boolean | null | |||
export type Value = string | number | boolean | null | number[] |
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 it ever be a string array or even a boolean array?
43c2dd0
to
27811f4
Compare
Code Climate has analyzed commit 27811f4 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (85% is the threshold). This pull request will bring the total coverage in the repository to 96.8% (0.0% change). View more on Code Climate. |
1/2
main
<- this <- #1819Closes #1814.
Comments inline.
Demo
Screen.Recording.2022-06-02.at.8.24.52.pm.mov