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

286: Add a link to CSR in the PR's first comment #1244

Closed
wants to merge 6 commits into from

Conversation

lgxbslgx
Copy link
Member

@lgxbslgx lgxbslgx commented Nov 23, 2021

Hi all,

This patch adds a link to the csr in the PR's first comment under Issue.
And the corresponding test is added.

Thanks for taking the time to review.

Best Regards,
-- Guoxiong


Progress

  • Change must not contain extraneous whitespace
  • Change must be properly reviewed

Issue

  • SKARA-286: Add a link to CSR in the PR's first comment

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/skara pull/1244/head:pull/1244
$ git checkout pull/1244

Update a local copy of the PR:
$ git checkout pull/1244
$ git pull https://git.openjdk.java.net/skara pull/1244/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1244

View PR using the GUI difftool:
$ git pr show -t 1244

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/skara/pull/1244.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Nov 23, 2021

👋 Welcome back gli! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr label Nov 23, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Nov 23, 2021

Webrevs

Copy link
Member

@magicus magicus left a comment

Looks good to me, but please await Erik's review as well.

@openjdk
Copy link

@openjdk openjdk bot commented Nov 23, 2021

@lgxbslgx This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

🔍 One or more changes in this pull request modifies files in areas of the source code that often require two reviewers. Please consider if this is the case for this pull request, and if so, await a second reviewer to approve this pull request before you integrate it.

After integration, the commit message for the final commit will be:

286: Add a link to CSR in the PR's first comment

Reviewed-by: ihse, erikj

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been no new commits pushed to the master branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@magicus, @erikj79) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready label Nov 23, 2021
@lgxbslgx
Copy link
Member Author

@lgxbslgx lgxbslgx commented Nov 24, 2021

@magicus Thanks for your review. I updated the code to solve the null exception.

Also wait @erikj79 to review.

@erikj79
Copy link
Member

@erikj79 erikj79 commented Nov 24, 2021

Overall I like this change. I'm wondering if we should add something like "CSR" either before or after the CSR link to make it clearer what the issue link is. I would suggest a bold CSR within normal parentheses after the title. This matches the formatting of the reviewer attributions further down in the body.

var relationship = link.relationship();
if (relationship.isPresent() && relationship.get().equals("csr for")) {
csr = link.issue().orElseThrow(
() -> new IllegalStateException("Link with title 'csr for' does not contain issue")
Copy link
Member

@erikj79 erikj79 Nov 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should throw an exception here. If we do, then a bad state in JBS will completely prevent the PullRequestBot from updating the status of the affected PR. I would prefer logging a warning and returning Optional.empty().

@lgxbslgx
Copy link
Member Author

@lgxbslgx lgxbslgx commented Nov 24, 2021

Thanks for the review. I updated the code just now.

I would suggest a bold CSR within normal parentheses after the title.

Added.

I don't think we should throw an exception here

Fixed.

And I find the intergration blocker shouldn't invoke the method CheckRun#issues directly, so I add a parameter withCsr to the method CheckRun#issues to separate these two situations.

Copy link
Member

@erikj79 erikj79 left a comment

Looks good!

@lgxbslgx lgxbslgx changed the title 286: Add more info about CSR in the PR's first comment 286: Add a link to CSR in the PR's first comment Nov 25, 2021
@lgxbslgx
Copy link
Member Author

@lgxbslgx lgxbslgx commented Nov 25, 2021

@erikj79 @magicusThanks for the reviews. Could I get your help to sponsor this patch?

/integrate

@openjdk openjdk bot added the sponsor label Nov 25, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 25, 2021

@lgxbslgx
Your change (at version 19521b6) is now ready to be sponsored by a Committer.

@openjdk openjdk bot removed the sponsor label Nov 26, 2021
@lgxbslgx
Copy link
Member Author

@lgxbslgx lgxbslgx commented Nov 26, 2021

I updated the code to reduce the nested if statements and reduce the number of iterations in for statement.

@lgxbslgx
Copy link
Member Author

@lgxbslgx lgxbslgx commented Nov 27, 2021

/integrate

@openjdk openjdk bot added the sponsor label Nov 27, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 27, 2021

@lgxbslgx
Your change (at version c867030) is now ready to be sponsored by a Committer.

Copy link
Member

@erikj79 erikj79 left a comment

I can sponsor this.

@erikj79
Copy link
Member

@erikj79 erikj79 commented Nov 29, 2021

/sponsor

@openjdk
Copy link

@openjdk openjdk bot commented Nov 29, 2021

Going to push as commit 43aedeb.

@openjdk openjdk bot closed this Nov 29, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Nov 29, 2021

@erikj79 @lgxbslgx Pushed as commit 43aedeb.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@lgxbslgx lgxbslgx deleted the SKARA-286 branch Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants