-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
bull-arena: support for bullmq #48886
bull-arena: support for bullmq #48886
Conversation
@gtpan77 Thank you for submitting this PR! This is a live comment which I will keep updated. This PR doesn't modify any tests, so it's hard to know what's being fixed, and your changes might regress in the future. Have you considered adding tests to cover the change you're making? Including tests allows this PR to be merged by yourself and the owners of this module. This can potentially save days of time for you. 1 package in this PRCode ReviewsThis PR can be merged once it's reviewed. 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": 48886,
"author": "gtpan77",
"owners": [
"levibostian",
"gtpan77"
],
"dangerLevel": "ScopedAndUntested",
"headCommitAbbrOid": "0dc2422",
"headCommitOid": "0dc24227f8f526504c19a60fda1223a2ed9af9df",
"mergeIsRequested": true,
"stalenessInDays": 0,
"lastPushDate": "2020-10-20T14:28:06.000Z",
"reopenedDate": "2020-10-20T05:41:23.000Z",
"lastCommentDate": "2020-10-20T17:42:54.000Z",
"maintainerBlessed": true,
"reviewLink": "https://github.com/DefinitelyTyped/DefinitelyTyped/pull/48886/files",
"hasMergeConflict": false,
"authorIsOwner": true,
"isFirstContribution": false,
"popularityLevel": "Well-liked by everyone",
"newPackages": [],
"packages": [
"bull-arena"
],
"files": [
{
"path": "types/bull-arena/index.d.ts",
"kind": "definition",
"package": "bull-arena"
},
{
"path": "types/bull-arena/package.json",
"kind": "package-meta-ok",
"package": "bull-arena"
}
],
"hasDismissedReview": false,
"ciResult": "pass",
"lastReviewDate": "2020-10-20T16:40:00.000Z",
"firstApprovalDate": "2020-10-20T16:40:00.000Z",
"reviewersWithStaleReviews": [],
"approvalFlags": 2,
"isChangesRequested": false
} |
🔔 @levibostian — please review this PR in the next few days. Be sure to explicitly select |
@gtpan77 The CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
👋 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. |
@@ -3,12 +3,13 @@ | |||
// Definitions by: Levi Bostian <https://github.com/levibostian> | |||
// Gaurav Sharma <https://github.com/gtpan77> | |||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | |||
// TypeScript Version: 2.8 | |||
// TypeScript Version: 4.0 |
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 is the reason for bumping this up?
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.
will revert
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.
Build is failing when I reverted to 2.8
Accessors are only available when targeting ECMAScript 5 and higher.
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 am not knowledgeable on that error. But, from looking at this PR, I don't see a need to bump the version as the change is quite minimal. That's why I asked about the bump.
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.
CI build was failing on 2.8. When I changed it to 4.0, build passed without any problem. I guess bullmq is using latest version of typescript. I am not familiar with Accessors.
types/bull-arena/index.d.ts
Outdated
@@ -33,7 +35,7 @@ declare namespace BullArena { | |||
interface QueueOptions { | |||
name: string; | |||
hostId?: string; | |||
type?: "bull" | "bee"; | |||
type?: "bull" | "bee" | 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.
I am not sure how Arena deals with bullmq. Do we send "bullmq" as the type param when using bullmq? If we can make the type stronger then string
here that would be better.
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.
Thanks for pointing this. I'll add bullmq
but there is a reason for adding string because of a compilation error.
string
is in use in prefix param. Similarly I used it here and it fixed the issue.
Type '{ name: string; hostId: string; type: string; url: string; }[]' is not assignable to type '((QueueOptions & PortHostConnectionOptions) | (QueueOptions & RedisUrlConnectionOptions) | (QueueOptions & RedisClientConnectionOptions))[]'.
Type '{ name: string; hostId: string; type: string; url: string; }' is not assignable to type '(QueueOptions & PortHostConnectionOptions) | (QueueOptions & RedisUrlConnectionOptions) | (QueueOptions & RedisClientConnectionOptions)'.
Type '{ name: string; hostId: string; type: string; url: string; }' is not assignable to type 'QueueOptions & RedisUrlConnectionOptions'.
Type '{ name: string; hostId: string; type: string; url: string; }' is not assignable to type 'QueueOptions'.
Types of property 'type' are incompatible.
Type 'string' is not assignable to type '"bull" | "bee" | undefined'.
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 understand the compilation error. Does the compiler pass before your changes? Before your PR, | string
didn't exist. That's why I don't think we need it now.
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.
Whenever I pass type
parameter in Arena constructor, then this compilation error pops up.
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 you add some tests to the definitions that show Arena construction?
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 compilation error was coming even before my changes. This error is not related to these changes.
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 have tested it by making a sample project. See prefix
parameter in Arena constructor where it is allowed to have any string.
@gtpan77 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! |
@gtpan77 The CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
@levibostian 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? |
Ready to merge |
I just published |
I would suggest not shipping new type definitions until the underlying feature has landed in the underlying library - bee-queue/arena#251 hasn't landed yet. |
These changes will not affect the existing code. I'll submit requested changes of PR 251 before weekend. |
Please fill in this template.
npm test YOUR_PACKAGE_NAME
.)npm run lint package-name
(ortsc
if notslint.json
is present).Select one of these and delete the others:
If changing an existing definition:
tslint.json
containing{ "extends": "dtslint/dt.json" }
. If for reason the any rule need to be disabled, disable it for that line using// tslint:disable-next-line [ruleName]
and not for whole package so that the need for disabling can be reviewed.Currently needs microsoft/DefinitelyTyped-tools#137.