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: Add types to some private functions #27816

Merged
merged 2 commits into from Aug 20, 2018

Conversation

Projects
None yet
4 participants
@aleccool213
Copy link
Contributor

aleccool213 commented Aug 2, 2018

  • Job.moveToCompleted
  • Job.moveToFailed
  • Queue.getNextJob
  • Also add null possibility to Queue.getJob

Me and my team are using these functions to implement a multiple-repo job processor service (despite being told by the author that this pattern for Bull isn't supported or planned). We are manually moving jobs from state to state as the process function is not being used. Work for a job is being done in another repo and we are exposing these functions via an API. We know these functions are private currently but hopefully with this exposure and a future PR to the actual Bull repo, we can get these functions to be public. We have this working in production for hundreds of jobs per day and this pattern seems to be working just fine.

Please fill in this template.

  • Use a meaningful title for the pull request. Include the name of the package modified.
  • Test the change in your own code. (Compile and run.)
  • Add or edit tests to reflect the change. (Run with npm test.)
  • Follow the advice from the readme.
  • Avoid common mistakes.
  • Run npm run lint package-name (or tsc if no tslint.json is present).

Select one of these and delete the others:

If changing an existing definition:

@typescript-bot

This comment has been minimized.

Copy link

typescript-bot commented Aug 2, 2018

@aleccool213 Thank you for submitting this PR!

🔔 @bgrieder @JProgrammer @marshall007 @weeco @blaugold @iamolegga @koblas - please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead.

Add types to private functions
- Job.moveToCompleted
- Job.moveToFailed
- Queue.getNextJob
- Also add null possibility to Queue.getJob

@aleccool213 aleccool213 force-pushed the wishabi:bull-private branch from 6bc13ae to 589188a Aug 2, 2018

@typescript-bot typescript-bot moved this from Waiting for Reviewers to Review in Pull Request Status Board Aug 7, 2018

@typescript-bot

This comment has been minimized.

Copy link

typescript-bot commented Aug 7, 2018

After 5 days, no one has reviewed the PR 😞. A maintainer will be reviewing the PR in the next few days and will either merge it or request revisions. Thank you for your patience!

@rbuckton

This comment has been minimized.

Copy link
Collaborator

rbuckton commented Aug 7, 2018

I would be wary about making "private" APIs public in a package, especially when the package author has expressly indicated that these APIs are private and may change. Are you able to use a module augmentation in your own project to add these APIs for your own internal use, as opposed to making this change for all users? Alternatively, are you able to work with the package author to find ways of making these APIs public first? Unless there is a very compelling case for adding these types for the entire development community, I would caution against adding them here.

@aleccool213

This comment has been minimized.

Copy link
Contributor Author

aleccool213 commented Aug 7, 2018

@rbuckton You raise a very good point. Thanks for being defence compared to just merging :)

I have opened a PR on the original module where I speak to the author and have received his blessing.

@rbuckton

This comment has been minimized.

Copy link
Collaborator

rbuckton commented Aug 7, 2018

@aleccool213: I would like to postpone merging until that PR has been merged, in the event the package author requires any other API changes, per this comment:

I am not against to expose these functions, but I think the APIs needs to be sanitised first […]

Once that PR has merged and this PR is up to date with any changes, post a comment to this thread and a reviewer will take another look.

@aleccool213

This comment has been minimized.

Copy link
Contributor Author

aleccool213 commented Aug 7, 2018

@rbuckton good points! sounds good!

@uniqueiniquity
Copy link
Contributor

uniqueiniquity left a comment

Marking as changes requested until the other PR is merged.

@typescript-bot typescript-bot moved this from Review to Needs Author Attention in Pull Request Status Board Aug 17, 2018

@typescript-bot

This comment has been minimized.

Copy link

typescript-bot commented Aug 17, 2018

@aleccool213 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. Thank you!

@aleccool213

This comment has been minimized.

Copy link
Contributor Author

aleccool213 commented Aug 20, 2018

@rbuckton @uniqueiniquity good to go! other pr has been merged

@uniqueiniquity

This comment has been minimized.

Copy link
Contributor

uniqueiniquity commented Aug 20, 2018

Congratulations on your first DefinitelyTyped contribution!
Thank you for being a part of the community!

@uniqueiniquity uniqueiniquity merged commit b3c691d into DefinitelyTyped:master Aug 20, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@aleccool213 aleccool213 deleted the wishabi:bull-private branch Aug 20, 2018

@typescript-bot typescript-bot removed this from Needs Author Attention in Pull Request Status Board Aug 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment