Change ReviewRequest.createFromCommit to return a promise.

Review Request #11632 — Created May 27, 2021 and updated

david
Review Board
master
reviewboard

This change updates the post-commit review request creation method to
return a promise instead of using callbacks for success and error.

  • Ran js-tests.
  • Created a post-commit review request.
Summary
Change ReviewRequest.createFromCommit to return a promise.
Description From Last Updated

Col: 44 'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

reviewbotreviewbot

Col: 27 'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

reviewbotreviewbot

Col: 44 'arrow function syntax (=>)' is only available in ES6 (use 'esversion: 6').

reviewbotreviewbot

The description went missing.

chipx86chipx86
Checks run (1 failed, 1 succeeded)
flake8 passed.
JSHint failed.

JSHint

chipx86
  1. The code itself looks fine.

    Before I jump into the other files, the thing we just really need to figure out is what we consider to be API-stable. While I have no idea which parts of the JS codebase are in use elsewhere, we do offer JavaScript extensions and those are in use extensively at some places. So I'm tempted to say we should avoid breaking function signatures wherever possible, especially in areas that interface with the API (like resources/).

    The updates here remove options and replace it with a commitID argument. I'm fine with this, but if we do it, we should retain backwards-compatibility (check whether we have an object or a string) and go through a deprecation warning process like we do on the Python side.

  2. 
      
david
chipx86
  1. 
      
  2. The description went missing.

  3. 
      
david
Review request changed

Commits:

Summary
-
Change ReviewRequest.createFromCommit to return a promise.
+
Change ReviewRequest.createFromCommit to return a promise.

Diff:

Revision 3 (+584 -482)

Show changes

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
Loading...