Skip to content

2479: PR marked as ready with jcheck error #1714

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

Closed
wants to merge 8 commits into from

Conversation

zhaosongzs
Copy link
Member

@zhaosongzs zhaosongzs commented Apr 17, 2025

Currently, when determining if a PR is ready, if the PR doesn't require a review, it also ignores all jcheck failures. Instead, only reviewers check should be ignored in this case.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace

Issue

  • SKARA-2479: PR marked as ready with jcheck error (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/skara.git pull/1714/head:pull/1714
$ git checkout pull/1714

Update a local copy of the PR:
$ git checkout pull/1714
$ git pull https://git.openjdk.org/skara.git pull/1714/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1714

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/skara/pull/1714.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 17, 2025

👋 Welcome back zsong! 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
Copy link

openjdk bot commented Apr 17, 2025

@zhaosongzs 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:

2479: PR marked as ready with jcheck error

Reviewed-by: 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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@zhaosongzs zhaosongzs changed the title Skara 2479 2479 Apr 17, 2025
@openjdk openjdk bot changed the title 2479 2479: PR marked as ready with jcheck error Apr 17, 2025
@zhaosongzs zhaosongzs marked this pull request as ready for review April 17, 2025 17:34
@openjdk openjdk bot added the rfr label Apr 17, 2025
@mlbridge
Copy link

mlbridge bot commented Apr 17, 2025

Webrevs

Comment on lines 1472 to 1473
var onlyReviewersCheckFailed = visitor.errorFailedChecksMessages().stream()
.allMatch(message -> message.contains("Too few reviewers"));
Copy link
Member

Choose a reason for hiding this comment

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

This looks awkward. Can we extend the Visitor with an explicit method for this instead? The role of the Visitor implementation is to gather the jcheck errors and present them in a way that makes sense to the caller, in this case the pr bot classes.

@@ -72,6 +72,14 @@ List<String> errorFailedChecksMessages() {
return errorFailedChecks.values().stream().flatMap(List::stream).toList();
}

List<String> errorFailedCheckMessagesWithoutReviewersCheck() {
Copy link
Member

Choose a reason for hiding this comment

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

This is a mouthful. I was thinking something like boolean tooFewReviewers().

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you mean that tooFewReviewers() should return true when there is only ReviewersCheck Failure?

Copy link
Member Author

Choose a reason for hiding this comment

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

Or does tooFewReviewers() return true when there is a ReviewersCheck Failure in the list?
If so, the logic should be like this
var readyToPostApprovalNeededComment = readyForReview && ((!reviewNeeded && visitor.errorFailedChecksMessages().size() == 1 && visitor.tooFewReviewers()) || visitor.errorFailedChecksMessages().isEmpty()) && integrationBlockers.isEmpty() && !statusMessage.contains(TEMPORARY_ISSUE_FAILURE_MARKER);

Copy link
Member

Choose a reason for hiding this comment

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

Right, I didn't think that through and this gets messy and I think it's because we aren't using the right abstraction. Can we just push something like this down to the visitor:

boolean hasErrors(boolean reviewNeeded)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, sounds good

@zhaosongzs zhaosongzs marked this pull request as draft April 17, 2025 20:45
@openjdk openjdk bot removed the rfr label Apr 17, 2025
@zhaosongzs zhaosongzs marked this pull request as ready for review April 17, 2025 21:37
@openjdk openjdk bot added the rfr label Apr 17, 2025
@@ -1470,7 +1470,7 @@ private void checkStatus() {
var commitMessage = String.join("\n", commit.message());

var readyToPostApprovalNeededComment = readyForReview &&
(!reviewNeeded || visitor.errorFailedChecksMessages().isEmpty()) &&
visitor.hasErrors(reviewNeeded) &&
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be negated?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for catching it. You are right. I remember I added "!" but Somehow it disappeared...

@openjdk openjdk bot added the ready label Apr 23, 2025
@zhaosongzs
Copy link
Member Author

Thanks for the review!
/integrate

@openjdk
Copy link

openjdk bot commented Apr 23, 2025

Going to push as commit 1107983.

@openjdk openjdk bot added the integrated label Apr 23, 2025
@openjdk openjdk bot closed this Apr 23, 2025
@openjdk
Copy link

openjdk bot commented Apr 23, 2025

@zhaosongzs Pushed as commit 1107983.

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

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

Successfully merging this pull request may close these issues.

2 participants