RFR: 1433: The change of the CSR status doesn't force the CheckWorkItem to re-run the check

Guoxiong Li gli at openjdk.java.net
Sat May 28 16:52:09 UTC 2022


Hi all,

Currently, the CheckWorkItem of the PR bot doesn't re-run the check in the following two situations so that the message of the PR body is not updated and then confuses the developers.

Situation 1 steps:
- The issue has no csr at first
- Use command `/csr needed` (now the PR has `csr` label)
- Create a csr for this issue
- Then the CheckWorkItem doesn't re-run the check (Because the `csr` label is kept in the PR and no new metadata found by CheckWorkItem)
- (optionally) use command `/csr needed` again
- (optionally) then the CheckWorkItem also doesn't re-run the check

Situation 2 steps:
- The issue has no csr at first (now the PR doesn't have `csr` label)
- Add the new fix version to the existing approved csr. (Now the issue has the csr issue. And because this csr issue had been approved, PR also doesn't have `csr` label.)
- then the CheckWorkItem doesn't re-run the check (No new metadata found by CheckWorkItem)
- (optionally) use command `/csr needed`
- (optionally) then the CheckWorkItem doesn't re-run the check

It is because these two situations don't add or remove the `csr` label so that the `CheckWorkItem#getMetadata` doesn't return new metadata and then `CheckWorkItem#currentCheckValid` returns true and then the check doesn't re-run.

This patch adds a new tag/marker named `<!-- csr:` so that `CheckWorkItem#getMetadata` can generate new metadata from it. When the developers use the `/csr` command or the csr issue status has been modified, the CSRBot or CSRCommand will add the `<!-- csr:` tag to the PR body or the comment. Then the CheckWorkItem will re-run the check because `CheckWorkItem#getMetadata` meets the newly added `<!-- csr:` tag.

Some test cases are added or adjusted.

Thanks for taking the time to review.

Best Regards,
-- Guoxiong

-------------

Commit messages:
 - SKARA-1433

Changes: https://git.openjdk.java.net/skara/pull/1327/files
 Webrev: https://webrevs.openjdk.java.net/?repo=skara&pr=1327&range=00
  Issue: https://bugs.openjdk.java.net/browse/SKARA-1433
  Stats: 159 lines in 6 files changed: 118 ins; 16 del; 25 mod
  Patch: https://git.openjdk.java.net/skara/pull/1327.diff
  Fetch: git fetch https://git.openjdk.java.net/skara pull/1327/head:pull/1327

PR: https://git.openjdk.java.net/skara/pull/1327


More information about the skara-dev mailing list