Closed
Bug 1476652
Opened 7 years ago
Closed 6 years ago
Convert lodash .omit(), .invert() and .mapValues() to native ES6 JS
Categories
(Tree Management :: Treeherder: Frontend, defect, P3)
Tree Management
Treeherder: Frontend
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: soundharya, Assigned: SirR4T)
References
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
Updated•7 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Comment 1•7 years ago
|
||
Assignee | ||
Comment 2•7 years ago
|
||
needs review.
Added a
arg.filter(x => !!x)
instead of
_.omit(arg, [undefined])
Updated•7 years ago
|
Assignee: nobody → sarat.addepalli
Status: NEW → ASSIGNED
Updated•7 years ago
|
Attachment #8996627 -
Flags: review?(cdawson)
Assignee | ||
Comment 3•7 years ago
|
||
Since _.omit, _.invert, and _.mapValues are used only once in the treeherder code base,
and since all three relate to building an inverted map of buildbot buildername to taskcluster tasklabel,
I propose that Bugs 1476652, 1468308 and 1476243 be merged as one, so that this can be tackled in one place.
I suggest the code should be converted to the following:
const builderToTask = {};
Object.entries(graph).forEach(([key, value]) => {
if (value && value.task && value.task.payload && value.task.payload.buildername) {
builderToTask[value.task.payload.buildername] = key;
}
});
Comment 4•7 years ago
|
||
That sounds fine to me - happy for you to update the existing PR (amend the commit locally including commit message, then force push to the same branch, then update the PR title etc).
Assignee | ||
Comment 5•7 years ago
|
||
Cool! done. Although i'm not sure if the PR title in GitHub will be picked up by autolander to mark all the three bugs.
Updated•7 years ago
|
Summary: Convert lodash .omit() to native ES6 JS → Convert lodash .omit(), .invert() and .mapValues() to native ES6 JS
Comment 8•6 years ago
|
||
Left review feedback in the PR. :)
Assignee | ||
Comment 9•6 years ago
|
||
thanks! in hindsight, reduce obviously! fixed and pushed.
Comment 10•6 years ago
|
||
Commit pushed to master at https://github.com/mozilla/treeherder
https://github.com/mozilla/treeherder/commit/44032ff5185049ebf9ccb412c3b17067db6d1d2d
Bug 1476652 1468308 1476243 - _.omit, _.invert, _.mapValues to ES6 (#3859)
Since _.omit, _.invert, and _.mapValues are all used only once in
the treeherder codebase, for building a map of buildbot buildername
to taskcluster tasklabel, this commit fixes all the three at once
instead of three different bugs.
Related Bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1476652
- https://bugzilla.mozilla.org/show_bug.cgi?id=1468308
- https://bugzilla.mozilla.org/show_bug.cgi?id=1476243
Updated•6 years ago
|
Attachment #8996627 -
Flags: review?(cdawson) → review+
Updated•6 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•