Skip to content
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

docs(sequelize): explain what options.retry accepts #11643

Merged
merged 3 commits into from Nov 9, 2019

Conversation

@davidjb
Copy link
Contributor

davidjb commented Nov 5, 2019

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you update the typescript typings accordingly (if applicable)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

This explains that options.retry accepts additional options and refers users to that documentation within retry-as-promised's library. Inspired by this comment: #2113 (comment)

For what it's worth, if useful, all the other options from https://github.com/mickhansen/retry-as-promised#configuration could be documented in Sequelize directly, but there's a risk they could make things confusing or dangerous (eg especially the timeout option within retry).

@codecov

This comment has been minimized.

Copy link

codecov bot commented Nov 5, 2019

Codecov Report

Merging #11643 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #11643   +/-   ##
=======================================
  Coverage   96.26%   96.26%           
=======================================
  Files          94       94           
  Lines        9190     9190           
=======================================
  Hits         8847     8847           
  Misses        343      343
Impacted Files Coverage Δ
lib/sequelize.js 95.93% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update afb8cc3...822953e. Read the comment docs.

@papb

This comment has been minimized.

Copy link
Member

papb commented Nov 9, 2019

Nice, thanks for the PR. This addition is good.

I am now asking myself if our docs for the max and match options should actually be removed, making the reader go to the main source to check it out. What do you think?

@davidjb

This comment has been minimized.

Copy link
Contributor Author

davidjb commented Nov 9, 2019

It's a tough one -- I think it'd be best to expand Sequelize's documentation to cover at least the most common or useful options and then treat them as "features" of Sequelize itself, since the retry functionality is just that.

The existing options are useful to know about and if they were removed, then they'd be a lot less obvious because someone may not click through to the underlying library. Even if they did, it's hard to make the connection between the retry option object in Sequelize and the second argument in https://github.com/mickhansen/retry-as-promised#configuration. I've started using retry-as-promised in other code and it took a while to get my head around it all -- I was able to see the options in Sequelize's docs and notice the common properties. There's also the risk of being dependent on the structure and quality of the underlying library's documentation too.

@papb
papb approved these changes Nov 9, 2019
Copy link
Member

papb left a comment

Thanks, I'm convinced, let's keep it this way!

Thanks for the PR!

@papb papb merged commit c3dd6a3 into sequelize:master Nov 9, 2019
4 checks passed
4 checks passed
codecov/patch Coverage not affected when comparing afb8cc3...822953e
Details
codecov/project 96.26% remains the same compared to afb8cc3
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.