[@types/underscore] Collection and Array Tests - Usage Tests Cleanup#47543
Conversation
|
@reubenrybnik Thank you for submitting this PR! This is a live comment which I will keep updated. 1 package in this PRCode ReviewsBecause you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it. Status
All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes. Diagnostic Information: What the bot saw about this PR{
"type": "info",
"now": "-",
"pr_number": 47543,
"author": "reubenrybnik",
"owners": [
"borisyankov",
"jbaldwin",
"ccurrens",
"confususs",
"jgonggrijp",
"ffflorian",
"regevbr",
"peterblazejewicz",
"reubenrybnik"
],
"dangerLevel": "ScopedAndTested",
"headCommitAbbrOid": "7cbc73a",
"headCommitOid": "7cbc73a9a5ea6ce47b53e4a7c268a615cd62851a",
"mergeIsRequested": true,
"stalenessInDays": 0,
"lastPushDate": "2020-09-25T04:36:25.000Z",
"reopenedDate": "2020-09-25T04:36:45.000Z",
"lastCommentDate": "2020-09-25T16:57:23.000Z",
"maintainerBlessed": false,
"reviewLink": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/47543/files",
"hasMergeConflict": false,
"authorIsOwner": true,
"isFirstContribution": false,
"popularityLevel": "Popular",
"newPackages": [],
"packages": [
"underscore"
],
"files": [
{
"path": "types/underscore/index.d.ts",
"kind": "definition",
"package": "underscore"
},
{
"path": "types/underscore/underscore-tests.ts",
"kind": "test",
"package": "underscore"
}
],
"hasDismissedReview": false,
"ciResult": "pass",
"lastReviewDate": "2020-09-25T09:50:06.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 2,
"isChangesRequested": false
} |
|
🔔 @borisyankov @jbaldwin @ccurrens @confususs @jgonggrijp @ffflorian @regevbr @peterblazejewicz — please review this PR in the next few days. Be sure to explicitly select |
|
These ended up being way more naturally organized than I thought they were (I hadn't originally anticipated being able to divide these into sections - at least not without moving a lot more stuff around), and except for chaining, each, reduce*, and map there was generally only one test function per Underscore function. In retrospect, I wish I would have cleaned up the existing tests for each function as I was adding their combinatorial tests rather than doing a larger cleanup PR like this. I could potentially move the usage examples for each function to just above their corresponding combinatorial examples if folks think that that would be a better way to organize this file. |
|
👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings. Let’s review the numbers, shall we? Comparison details 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. |
jgonggrijp
left a comment
There was a problem hiding this comment.
In the current diff, it takes too much energy to track for each removal whether it was completely removed or whether just the notation changed and the diff algorithm moved it next to a nonmatching addition somewhere else in the file. Would it be possible to split this PR in three reviews, but rather than splitting by section, splitting by type of change? I'm thinking along the following lines.
Subset A (notation changes):
- Removes
EnumerableKeybecause it was causing issues with linting between different versions of TS (see #45201 (comment) for more details)- Updates usage tests to use $ExpectType
Subset B (order changes, see also comment below):
- Splits usage tests into sections
Subset C (addition and removal of tests):
- Removes a few redundant or impractical tests (pretty sure around 15 tests in total and mostly redundant or overly simple chain tests)
- Adds some more chain tests
I don't care about the order between these subsets (whatever is most convenient for you), and we could do the opposite of what you did in the grand draft PR, i.e., construct the sub-PRs just for review and still merge the present one after we're done with those. You could create PRs on your own fork to give you more control over available branches, since you'll probably want to build one set of changes on top of another.
Regarding your later comment, I do think I'd prefer all tests for a given function to be in close proximity to each other. For review purposes, moving the usage tests for each function directly above its combinatorial tests (or the latter below the former) should be part of subset B.
|
@reubenrybnik One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits or comments. If you disagree with the reviewer's comments, you can "dismiss" the review using GitHub's review UI. Thank you! |
|
Works for me @jgonggrijp! I think I'll go C then A then B, but I think I'll need to move the removal of |
|
The original commits and diff will be available for reference in master...reubenrybnik:underscore-tests-usage-tests-cleanup-old. |
f3669d0 to
bacc188
Compare
|
@reubenrybnik — There was an error that prevented me from properly processing this PR: |
|
Well that didn't work, won't try to do that again 😞 |
|
To be fair, I didn't force push it back to its original base like I said, instead I forced it to current master. My plan might have worked if I had stuck with the original base and then merged current master in instead. |
|
Looks like this is in a special place on the PR board with a special label now; to the DT maintainer that will likely end up looking at this, please feel free to drop this PR off the board, and sorry for getting this into an unpleasant state that you've needed to come and investigate. |
|
Huzzah, I did what I said was what I probably should have done and fixed it and now DT maintainers won't need to come visit! 😬 Edit: Except this still has the error label, so maybe I'll get a visit anyway. 😬 😬 😬 At least I know the right and wrong way to do this now. |
|
On the bright side, maybe they have enough PRs with an error label that they don't inspect each of them individually. ;-) |
|
@jgonggrijp The first child PR is up at reubenrybnik#1 😄 I've invited you to be a collaborator in my fork, which was hopefully the right thing to do; let me know if there's something different that I should be doing to provide you with the power to effectively review PRs in my fork. |
|
@reubenrybnik Since your fork is public, I probably didn’t need any type of special permission in order to review your PRs. In public repos, everyone can review everything. I have accepted the invitation, but I might never use it. I take no offense if you remove my access again. |
|
@jgonggrijp Meh, might as well leave things as they are for the moment at least to be safe, this way too I can directly request you as a reviewer which is nice. I'll only do that for PRs like these that you know about in advance, though. |
* Removing the EnumerableKey type alias because DT linting is not good at dealing with it between different versions of TypeScript. (cherry picked from commit abe1df7) * Adding comments that describe and anchor tests, changing a few tests slightly, and removing some tests. * Adding some chain tests. * Fixing spelling error. Co-authored-by: Julian Gonggrijp <dev@juliangonggrijp.com> * Updating the mixin test to properly augment Underscore types. * Removing an unnecessary generic type specification. * Wrapping a comment. * Referencing DefinitelyTyped#33479 in more places. Co-authored-by: Julian Gonggrijp <dev@juliangonggrijp.com>
* Adding type assertions to usage tests. * Minor updates to the bind test. * Removing comments for chain tests that are already in the chain tests section of the file and updating the chain tests header. * Breaking a function into multiple lines for better readability. * Adding a separate toArray test that infers a more interesting type than any[]. * Replacing a movie reference with a more generic example. * Make indentation more consistent. Co-authored-by: Julian Gonggrijp <dev@juliangonggrijp.com> * Revert "Replacing a movie reference with a more generic example." This reverts commit 49c0a79. Co-authored-by: Julian Gonggrijp <dev@juliangonggrijp.com>
* Removing the combinatorial tests label for types. * Making to the types section of tests. * Making updates to the collections section of tests. * Making updates to the arrays section of tests. * Making updates to the functions section of tests. * Making updates to the objects section of tests. * Making updates to the utility section of tests. * Making updates to the OOP section of tests and adding an OOP header to UnderscoreStatic. * Making updates to the chaining section of tests. * Adding a missing word to a sentence. Co-authored-by: Julian Gonggrijp <dev@juliangonggrijp.com> * Changing "sorting" to "order" when describing sortedIndex Co-authored-by: Julian Gonggrijp <dev@juliangonggrijp.com> * Switching "values its keys" to "vice versa" Co-authored-by: Julian Gonggrijp <dev@juliangonggrijp.com> * Removing an inaccurate "no-op" from a description Co-authored-by: Julian Gonggrijp <dev@juliangonggrijp.com> * Splitting up comments between calling mixin and augmenting type definitions Co-authored-by: Julian Gonggrijp <dev@juliangonggrijp.com> * Removing an extra memoize header. * Changing "TSC" to "TypeScript." Co-authored-by: Julian Gonggrijp <dev@juliangonggrijp.com>
|
@jgonggrijp Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review? |
|
Yay, the PR is fully back in a good state! Excellent job dealing with my fail @typescript-bot 😅 |
jgonggrijp
left a comment
There was a problem hiding this comment.
There are five commits: two merge commits that synchronize the feature branch with the master branch, and three squash merge commits, one from each of the above linked sub-PRs on @reubenrybnik's own fork. I have verified that the latter three commits match. Since I reviewed and approved each of the sub-PRs, I approve the current one as well.
@reubenrybnik Congratulations with completing a huge project that extended over many PRs. Thank you for giving the Underscore typings as well the corresponding tests such a major, thorough quality boost. The improved types will benefit all Underscore+TypeScript users (which I suspect is a substantial population) in the coming years, while the improved tests will benefit all who will edit the types in the future.
Working with you has been a pleasure; I appreciate your high quality standards, your thoroughness and your considerateness. Last but not least, your perseverance is truly impressive. I look forward to the next time our paths will cross.
If you ever need support for Underscore, Underscore-contrib, (future) Underscore-Fusion, Backbone, Backbone-Machina, Backbone-Fractal, (future) Backbone-Bulma or (future) Backbone-RDF, just let me know.
|
@reubenrybnik Everything looks good here. Great job! I am ready to merge this PR on your behalf. If you'd like that to happen, please post a comment saying:
and I'll merge this PR almost instantly. Thanks for helping out! ❤️ (@borisyankov, @jbaldwin, @ccurrens, @confususs, @jgonggrijp, @ffflorian, @regevbr, @peterblazejewicz: you can do this too.) |
|
Thanks @jgonggrijp! I appreciate your responsiveness during this round of reviews, your willingness to review so many PRs, and your feedback and ideas for improvement which provided a substantial quality boost to the result of this effort. I look forward to working with you again as well, quite possibly on more improvements to these type definitions since there are definitely more that can be made both now and as future versions of TS become available but hopefully in other areas of the open-source world too 😄 |
|
Ready to merge |
…ay Tests - Usage Tests Cleanup by @reubenrybnik (cherry picked from commit 61deea7)
|
I just published |
npm test.)npm run lint package-name(ortscif notslint.jsonis present).This is the last of three planned cleanup PRs for #45201 and includes the following changes:
EnumerableKeybecause it was causing issues with linting between different versions of TS (see [@types/underscore] More comprehensive tests for Underscore collection and array functions + definition changes as appropriate #45201 (comment) for more details)If folks feel that this PR contains more changes than they'd like to review in one go, I'd be happy to split this into three or four PRs that each address a different set of usage tests.