Add JSON output to rbt review.
Review Request #12673 — Created Oct. 11, 2022 and submitted
This adds JSON output to the
rbt review
command. The output contains
information relevant to the review, such as:
- The review ID.
- The review API URL.
- The review URL.
- The review status which can bedraft
,published
, ordiscarded
.
- The review request ID.
- The review request URL.When a comment subcommand is used, the following comment details are also
included in the output:
- The comment type which can bediff_comment
,file_attachment_comment
,
orgeneral_comment
.
- The comment ID.
- The comment API URL.During testing, a regression in Review Board 5.0's API was discovered
which broke thereviews
URI template on the Root List Resource. This breaks
the command in cases where a new review draft needs to be created. While the
API regression is being tracked and dealt with separately, this change allows
the command to work normally by accessing the reviews through the review
request resource instead of the root since we're fetching the review request
resource anyways in order to include its URL in the output.An upcoming change will add unit tests for the
rbt review
command.This also fixes a bug in the add diff comment subcommand where we add
the comment to the wrong file. The comment would always be added to the
last file in the diffset.
- Manually tested the command and all of its subcommands.
- Tested on RB5, RB6 and RB7.
- Tested the case where a new review draft is created, and where one
already exists.
Summary | ID |
---|---|
ce90c2361aab8bb8ab56fc4421a4bb1f8c3988de |
- Summary:
-
[WIP] Add JSON output to rbt review.Add JSON output to rbt review.
- Description:
-
This adds JSON output to the
rbt review
command. The output containsinformation relevant to the review, such as: - The review ID. - The review API URL. - The review URL. - The review status which can be draft
,published
, ordiscarded
.- The review request ID. - The review request URL. When a comment subcommand is used, the following comment details are also
included in the output: - The comment type which can be diff_comment
,file_attachment_comment
,or general_comment
.- The comment ID. - The comment API URL. ~ During this change, a regression in Review Board 5.0's API was discovered
~ which broke the reviews
URI template on the Root List Resource. While this~ issue is being tracked and dealt with separately, this change avoids ~ accessing the reviews URI template through the root resource, and instead ~ accesses the reviews through the review request resource since we're fetching ~ the review request anyways in order to include its URL in the output. ~ During testing, a regression in Review Board 5.0's API was discovered
~ which broke the reviews
URI template on the Root List Resource. This breaks~ the command in cases where a new review draft needs to be created. While the ~ API regression is being tracked and dealt with separately, this change allows ~ the command to work normally by accessing the reviews through the review ~ request resource instead of the root since we're fetching the review request + resource anyways in order to include its URL in the output. + + An upcoming change will add unit tests for the
rbt review
command. - Testing Done:
-
~ - Manually tested the command with all of its subcommands.
~ Manually tested the command and all of its subcommands.
- - TODO: Write unit tests for
rbt review
.
- Commits:
-
Summary ID f20e992c349791556c68cb9422d5ed88122f0768 0023fc84006e53c800db27ed0a58b73ae96dbac1 - Diff:
-
Revision 2 (+84 -24)
Checks run (2 succeeded)
- Change Summary:
-
Fixed a bug in the add diff comment subcommand where we add the comment to the wrong file.
- Description:
-
This adds JSON output to the
rbt review
command. The output containsinformation relevant to the review, such as: - The review ID. - The review API URL. - The review URL. - The review status which can be draft
,published
, ordiscarded
.- The review request ID. - The review request URL. When a comment subcommand is used, the following comment details are also
included in the output: - The comment type which can be diff_comment
,file_attachment_comment
,or general_comment
.- The comment ID. - The comment API URL. During testing, a regression in Review Board 5.0's API was discovered
which broke the reviews
URI template on the Root List Resource. This breaksthe command in cases where a new review draft needs to be created. While the API regression is being tracked and dealt with separately, this change allows the command to work normally by accessing the reviews through the review request resource instead of the root since we're fetching the review request resource anyways in order to include its URL in the output. An upcoming change will add unit tests for the
rbt review
command.+ + This also fixes a bug in the add diff comment subcommand where we add
+ the comment to the wrong file. The comment would always be added to the + last file in the diffset. - Testing Done:
-
~ Manually tested the command and all of its subcommands.
~ - Manually tested the command and all of its subcommands.
+ - Tested on RB5, RB6 and RB7.
+ - Tested the case where a new review draft is created, and where one
already exists.
- Commits:
-
Summary ID 0023fc84006e53c800db27ed0a58b73ae96dbac1 ce90c2361aab8bb8ab56fc4421a4bb1f8c3988de - Diff:
-
Revision 3 (+86 -26)