From vkempik at azul.com Tue Nov 2 15:44:24 2021 From: vkempik at azul.com (Vladimir Kempik) Date: Tue, 2 Nov 2021 15:44:24 +0000 Subject: New Skara feature: dependent pull requests In-Reply-To: <34c2711b-e1b3-6537-8044-2cc6fed2f7ec@oracle.com> References: <34c2711b-e1b3-6537-8044-2cc6fed2f7ec@oracle.com> Message-ID: Hello I?m tying to use dependent pr feautre in skara cli and I can?t I?m working in jdk11u-dev repo and the command git sync --branches pull/574 doesn?t get me desired branch in my fork. any tips ? Regards, Vladimir > 23 ????? 2021 ?., ? 10:41, Erik Helin ???????(?): > > Hi all, > > me and Robin are looking to deploy a new feature for the jdk [0] repository this week: dependent pull requests. Dependent pull requests are used when you have a change that depends on work in a pull request that is not yet integrated. > > For an example, lets say that you are fixing a bug and realize that you first need to refactor a piece of code in order to make the bugfix cleaner. To aid reviewers you do *not* want to create a pull request containing both the refactoring and the bugfix - they are distinct changes and should be reviewed independently. You create a pull request for the first change, the refactoring, but then what? You cannot create a pull request for the bugfix only since the refactoring is not yet integrated. The review of the refactoring might take a while and during this time you cannot receive reviews for the bugfix. > > Dependent pull requests will help in the above scenario. When a pull request is created then the Skara bots will automatically create a branch in the upstream repository named `pr/` where `` is the id of the pull request (e.g. `17`). This `pr/` branch can then be used as the target branch when creating a pull request. A pull request with a dependency is automatically targeted to the dependency's target branch when the dependency is integrated. For example, if the first pull request (with id `17`) targets the `master` branch and the second pull request targets the `pr/17` branch, then the second pull request will be automatically re-targeted to the `master` branch when the first pull request (with id `17`) is integrated. It is not possible to integrate a pull request with a dependency on an open pull request (i.e. the dependency must be integrated first). The branches named `pr/` are automatically removed when the corresponding pull request is closed. > > Dependent pull requests have been enabled for a long time for the skara repository [1] and an example of a pull request with a dependency can be seen here [2]. > > For those of you using the Skara CLI tools [3] then `git-sync` will by default *not* sync branches named `pr/` to the personal fork. If it did then you would have to delete all `pr/` branches in your personal fork yourself. This default behavior can be overridden by passing `--branches` to `git-sync`. > > Let us know on the skara-dev [4] mailing list if you have any questions! > > Thanks, > Erik and Robin > > [0]: https://github.com/openjdk/jdk > [1]: https://github.com/openjdk/skara > [2]: https://github.com/openjdk/skara/pull/1087 > [3]: https://wiki.openjdk.java.net/display/SKARA/CLI+Tools > [4]: https://mail.openjdk.java.net/mailman/listinfo/skara-dev > From erik.joelsson at oracle.com Tue Nov 2 16:18:30 2021 From: erik.joelsson at oracle.com (erik.joelsson at oracle.com) Date: Tue, 2 Nov 2021 09:18:30 -0700 Subject: New Skara feature: dependent pull requests In-Reply-To: References: <34c2711b-e1b3-6537-8044-2cc6fed2f7ec@oracle.com> Message-ID: <468e9a57-488a-ccd4-f81f-b55679140bea@oracle.com> Hello Vladimir, I've never used sync to get pr branches to my fork, but after a quick peek at the source it seems Erik's instructions below are wrong. Just using --branches will not override the default "ignore" of "pr/.*". I think you can get around this by also overriding the ignore list with a dummy value. Something like this: git sync --branches pull/574 --ignore foo I believe this should be fixed. If something is explicitly matched by the --branches, it shouldn't also be ignored. Feel free to file an issue. /Erik On 2021-11-02 08:44, Vladimir Kempik wrote: > Hello > I?m tying to use dependent pr feautre in skara cli and I can?t > I?m working in jdk11u-dev repo and > the command > git sync --branches pull/574 > doesn?t get me desired branch in my fork. > any tips ? > Regards, Vladimir >> 23 ????? 2021 ?., ? 10:41, Erik Helin ???????(?): >> >> Hi all, >> >> me and Robin are looking to deploy a new feature for the jdk [0] repository this week: dependent pull requests. Dependent pull requests are used when you have a change that depends on work in a pull request that is not yet integrated. >> >> For an example, lets say that you are fixing a bug and realize that you first need to refactor a piece of code in order to make the bugfix cleaner. To aid reviewers you do *not* want to create a pull request containing both the refactoring and the bugfix - they are distinct changes and should be reviewed independently. You create a pull request for the first change, the refactoring, but then what? You cannot create a pull request for the bugfix only since the refactoring is not yet integrated. The review of the refactoring might take a while and during this time you cannot receive reviews for the bugfix. >> >> Dependent pull requests will help in the above scenario. When a pull request is created then the Skara bots will automatically create a branch in the upstream repository named `pr/` where `` is the id of the pull request (e.g. `17`). This `pr/` branch can then be used as the target branch when creating a pull request. A pull request with a dependency is automatically targeted to the dependency's target branch when the dependency is integrated. For example, if the first pull request (with id `17`) targets the `master` branch and the second pull request targets the `pr/17` branch, then the second pull request will be automatically re-targeted to the `master` branch when the first pull request (with id `17`) is integrated. It is not possible to integrate a pull request with a dependency on an open pull request (i.e. the dependency must be integrated first). The branches named `pr/` are automatically removed when the corresponding pull request is closed. >> >> Dependent pull requests have been enabled for a long time for the skara repository [1] and an example of a pull request with a dependency can be seen here [2]. >> >> For those of you using the Skara CLI tools [3] then `git-sync` will by default *not* sync branches named `pr/` to the personal fork. If it did then you would have to delete all `pr/` branches in your personal fork yourself. This default behavior can be overridden by passing `--branches` to `git-sync`. >> >> Let us know on the skara-dev [4] mailing list if you have any questions! >> >> Thanks, >> Erik and Robin >> >> [0]: https://github.com/openjdk/jdk >> [1]: https://github.com/openjdk/skara >> [2]: https://github.com/openjdk/skara/pull/1087 >> [3]: https://wiki.openjdk.java.net/display/SKARA/CLI+Tools >> [4]: https://mail.openjdk.java.net/mailman/listinfo/skara-dev >> From erik.joelsson at oracle.com Tue Nov 2 19:19:05 2021 From: erik.joelsson at oracle.com (erik.joelsson at oracle.com) Date: Tue, 2 Nov 2021 12:19:05 -0700 Subject: Switch jdk7u development to Git/Skara In-Reply-To: <24feab95-a6fb-6959-c7bc-7c6de51d28a1@oracle.com> References: <24feab95-a6fb-6959-c7bc-7c6de51d28a1@oracle.com> Message-ID: <846b02be-c078-7bc8-2b9a-62b5192f2268@oracle.com> Resending this as there have been no replies yet. On 2021-10-12 14:51, erik.joelsson at oracle.com wrote: > Hello jdk7u maintainers, > > I would like to raise the subject of potentially moving jdk7u > development over to Github/Skara at some point in the future. > Currently the only 2 projects still on hg.openjdk.java.net are jdk7u > and jdk8u, and we are currently in the process of figuring out the > migration path for jdk8u [1]. If the current plan holds, then in April > 2022, jdk7u will be the only project left. I don't know how long jdk7u > will stay active, but even if it's for a limited time, the move would > be greatly appreciated from an infrastructure support point of view. > > The move for 7u is similar to 8u and a bit trickier than the previous > move of 11u. We first need to consolidate the Mercurial repositories > into one, like we did for 10. I have already produced a prototype > conversion, both of a consolidated HG repo [2] and then also to Github > [3]. In the jdk8u plan, we are aiming for a separate forest > consolidation step in November, followed by a two step move to Git in > February and April respectively. We can do the same thing for 7u, or > we can do it all in one step. Note that the consolidation is the step > that has the most potential for down time. I would recommend planning > for a full week just in case something goes wrong, though expected > time is more likely around 1-2 days. > > I would like to hear from the maintainers of jdk7u what your preferred > strategy would be and what timelines would potentially work for you. > > /Erik > > [1] > https://mail.openjdk.java.net/pipermail/jdk8u-dev/2021-October/014316.html > [2] http://hg.openjdk.java.net/jdk7u/consol-proto/ > [3] https://github.com/openjdk/jdk7u From rkennke at redhat.com Mon Nov 8 23:32:32 2021 From: rkennke at redhat.com (Roman Kennke) Date: Tue, 9 Nov 2021 00:32:32 +0100 Subject: Interference between mailing list and GH notifications Message-ID: <2b0de22b-a277-d295-9656-ec23b2d15129@redhat.com> Hi there, Today I noticed a weird interference between Lilliput mailing list and GH notifications. It started when Dave Dice posted something to lilliput-dev: https://mail.openjdk.java.net/pipermail/lilliput-dev/2021-November/000196.html It seems like Skara/GH thought this somehow belongs to Lilliput PR27, and attached the email to its comments: https://github.com/openjdk/lilliput/pull/27#issuecomment-963500322 Since then, any reply to this original email got copied into PR27, even if I *excluded* all GH email addresses from CC, and only put in lilliput-dev. Can you please check what is up there? Have I done a mistake in Lilliput configuration somehow? I haven't changed anything recently since initial project set-up, and I've never seen such behaviour before. Thanks, Roman From erik.joelsson at oracle.com Tue Nov 9 00:11:00 2021 From: erik.joelsson at oracle.com (erik.joelsson at oracle.com) Date: Mon, 8 Nov 2021 16:11:00 -0800 Subject: Interference between mailing list and GH notifications In-Reply-To: <2b0de22b-a277-d295-9656-ec23b2d15129@redhat.com> References: <2b0de22b-a277-d295-9656-ec23b2d15129@redhat.com> Message-ID: Hello Roman, The mailinglist bridge in Skara parses the mbox archives on the mailinglist server to figure out what emails belong to PR threads, and then posts them as comments. It does this by looking at the In-reply-to headers, which tie emails together in threads. In this case, Dave must have hit "reply" on an existing email in his mail reader and then repurposed the email by just changing the subject. Behind the scenes, the in-reply-to header is still included and recorded by the mailinglist server, and the Skara mailinglist bridge can't reasonably tell that this email wasn't intended for PR27. I would also add that using the reply function of your mail reader in this way will also confuse threading for many email readers, so I would consider it bad practice. Looking at the raw mbox archive for lilliput-dev for November: https://mail.openjdk.java.net/pipermail/lilliput-dev/2021-November.txt We can see that Dave's emails has this header: In-Reply-To: Looking back through the October archive: https://mail.openjdk.java.net/pipermail/lilliput-dev/2021-October.txt We can trace this back to this email, which Skara sent on your behalf based on a comment in PR27: https://mail.openjdk.java.net/pipermail/lilliput-dev/2021-October/000194.html /Erik On 2021-11-08 15:32, Roman Kennke wrote: > Hi there, > > Today I noticed a weird interference between Lilliput mailing list and > GH notifications. > > It started when Dave Dice posted something to lilliput-dev: > > https://mail.openjdk.java.net/pipermail/lilliput-dev/2021-November/000196.html > > > It seems like Skara/GH thought this somehow belongs to Lilliput PR27, > and attached the email to its comments: > > https://github.com/openjdk/lilliput/pull/27#issuecomment-963500322 > > Since then, any reply to this original email got copied into PR27, > even if I *excluded* all GH email addresses from CC, and only put in > lilliput-dev. > > Can you please check what is up there? Have I done a mistake in > Lilliput configuration somehow? I haven't changed anything recently > since initial project set-up, and I've never seen such behaviour before. > > Thanks, > Roman > From gli at openjdk.java.net Wed Nov 10 05:59:24 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Wed, 10 Nov 2021 05:59:24 GMT Subject: RFR: 1239: The backport command bot replies multiple `@username` unexpectedly Message-ID: Hi all, After [SKARA-1201](https://bugs.openjdk.java.net/browse/SKARA-1201), the backport command bot will reply multiple `@username` unexpectedly when we use command `/backport branch-name`. Please see [this link](https://github.com/openjdk/jdk/commit/2b02b6f513b062261195ca1edd059d16abb7bec6) for the detailed messages. The bot replied two `@lgxbslgx` unexpectedly. This patch fixes the issue and adds the corresponding test cases. Thanks for taking the time to review. Best Regards, -- Guoxiong ------------- Commit messages: - SKARA-1239: The backport command bot replies multiple @username unexpectedly Changes: https://git.openjdk.java.net/skara/pull/1238/files Webrev: https://webrevs.openjdk.java.net/?repo=skara&pr=1238&range=00 Issue: https://bugs.openjdk.java.net/browse/SKARA-1239 Stats: 4 lines in 2 files changed: 2 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/skara/pull/1238.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1238/head:pull/1238 PR: https://git.openjdk.java.net/skara/pull/1238 From ihse at openjdk.java.net Wed Nov 10 11:44:56 2021 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Wed, 10 Nov 2021 11:44:56 GMT Subject: RFR: 1239: The backport command bot replies multiple `@username` unexpectedly In-Reply-To: References: Message-ID: On Wed, 10 Nov 2021 05:55:08 GMT, Guoxiong Li wrote: > Hi all, > > After [SKARA-1201](https://bugs.openjdk.java.net/browse/SKARA-1201), the backport command bot will reply multiple `@username` unexpectedly when we use command `/backport branch-name`. > > Please see [this link](https://github.com/openjdk/jdk/commit/2b02b6f513b062261195ca1edd059d16abb7bec6) for the detailed messages. The bot replied two `@lgxbslgx` unexpectedly. > > This patch fixes the issue and adds the corresponding test cases. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong LGTM ------------- Marked as reviewed by ihse (Reviewer). PR: https://git.openjdk.java.net/skara/pull/1238 From gli at openjdk.java.net Wed Nov 10 12:07:18 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Wed, 10 Nov 2021 12:07:18 GMT Subject: RFR: 1239: The backport command bot replies multiple `@username` unexpectedly In-Reply-To: References: Message-ID: On Wed, 10 Nov 2021 11:42:25 GMT, Magnus Ihse Bursie wrote: >> Hi all, >> >> After [SKARA-1201](https://bugs.openjdk.java.net/browse/SKARA-1201), the backport command bot will reply multiple `@username` unexpectedly when we use command `/backport branch-name`. >> >> Please see [this link](https://github.com/openjdk/jdk/commit/2b02b6f513b062261195ca1edd059d16abb7bec6) for the detailed messages. The bot replied two `@lgxbslgx` unexpectedly. >> >> This patch fixes the issue and adds the corresponding test cases. >> >> Thanks for taking the time to review. >> >> Best Regards, >> -- Guoxiong > > LGTM @magicus thanks for your review. Could I get your help to sponsor this patch? ------------- PR: https://git.openjdk.java.net/skara/pull/1238 From gli at openjdk.java.net Wed Nov 10 13:35:45 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Wed, 10 Nov 2021 13:35:45 GMT Subject: Integrated: 1239: The backport command bot replies multiple `@username` unexpectedly In-Reply-To: References: Message-ID: On Wed, 10 Nov 2021 05:55:08 GMT, Guoxiong Li wrote: > Hi all, > > After [SKARA-1201](https://bugs.openjdk.java.net/browse/SKARA-1201), the backport command bot will reply multiple `@username` unexpectedly when we use command `/backport branch-name`. > > Please see [this link](https://github.com/openjdk/jdk/commit/2b02b6f513b062261195ca1edd059d16abb7bec6) for the detailed messages. The bot replied two `@lgxbslgx` unexpectedly. > > This patch fixes the issue and adds the corresponding test cases. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong This pull request has now been integrated. Changeset: 48567a0a Author: Guoxiong Li Committer: Magnus Ihse Bursie URL: https://git.openjdk.java.net/skara/commit/48567a0a49c8bb89024aba81e022d1a99b9e3e75 Stats: 4 lines in 2 files changed: 2 ins; 0 del; 2 mod 1239: The backport command bot replies multiple `@username` unexpectedly Reviewed-by: ihse ------------- PR: https://git.openjdk.java.net/skara/pull/1238 From erikj at openjdk.java.net Wed Nov 10 14:00:43 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Wed, 10 Nov 2021 14:00:43 GMT Subject: RFR: 1239: The backport command bot replies multiple `@username` unexpectedly In-Reply-To: References: Message-ID: On Wed, 10 Nov 2021 05:55:08 GMT, Guoxiong Li wrote: > Hi all, > > After [SKARA-1201](https://bugs.openjdk.java.net/browse/SKARA-1201), the backport command bot will reply multiple `@username` unexpectedly when we use command `/backport branch-name`. > > Please see [this link](https://github.com/openjdk/jdk/commit/2b02b6f513b062261195ca1edd059d16abb7bec6) for the detailed messages. The bot replied two `@lgxbslgx` unexpectedly. > > This patch fixes the issue and adds the corresponding test cases. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong Thank you for the contribution! ------------- PR: https://git.openjdk.java.net/skara/pull/1238 From Matthew.Carter at microsoft.com Wed Nov 10 15:43:42 2021 From: Matthew.Carter at microsoft.com (Mat Carter) Date: Wed, 10 Nov 2021 15:43:42 +0000 Subject: Windows x64 (build release) job/jcheck fails with segmentation fault Message-ID: Hopefully this is the right mailing list to post issues; if not then please redirect me :) I have 3 chained PRs for jdk11u-dev, the final PR just failed on of the jchecks, looking at the issue it seems to be a build failure rather than a code issue (all other jobs succeeded including the debug build). PR:?https://github.com/openjdk/jdk11u-dev/pull/607 Failure details:?https://github.com/macarte/jdk11u-dev/runs/4159447159?check_suite_focus=true I wanted to share this before I try a restart of the job.? Which raises a question: how do I restart the jcheck? Here's a copy of the build output (error on line 19): $env:Path = "$HOME\cygwin\cygwin64\bin;$HOME\cygwin\cygwin64\bin;$env:Path" ; 3 $env:Path = $env:Path -split ";" -match "C:\\Windows|PowerShell|cygwin" -join ";" ; 4 & make CONF_NAME=windows-x64 5 shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'" 6 env: 7 JDK_VERSION: 11.0.14 8 BOOT_JDK_VERSION: 11 9 BOOT_JDK_FILENAME: openjdk-11_windows-x64_bin.zip 10 BOOT_JDK_URL: https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.12%2B7/OpenJDK11U-jdk_x64_windows_hotspot_11.0.12_7.zip 11 BOOT_JDK_SHA256: c54123dd4b0d6473221539e7003b8ca1c1757c5588c46465565b03bf8781f807 12Building configuration 'windows-x64' (matching CONF_NAME=windows-x64) 13Building configuration 'windows-x64' (matching CONF_NAME=windows-x64) 14Building target 'default (product-bundles test-bundles)' in configuration 'windows-x64' 15Compiling 8 files for BUILD_TOOLS_LANGTOOLS 16Warning: No SCM configuration present and no .src-rev 17Parsing 2 properties into enum-like class for jdk.compiler 18Compiling 19 properties into resource bundles for jdk.compiler 19/usr/bin/bash: line 1: 1003 Segmentation fault (core dumped) /usr/bin/make -s -r -R -I /cygdrive/d/a/jdk11u-dev/jdk11u-dev/jdk/make/common SPEC=/cygdrive/d/a/jdk11u-dev/jdk11u-dev/jdk/build/windows-x64/spec.gmk MAKE_LOG_FLAGS="-s" -f ModuleWrapper.gmk -I/cygdrive/d/a/jdk11u-dev/jdk11u-dev/jdk/make -I/cygdrive/d/a/jdk11u-dev/jdk11u-dev/jdk/make/copy MODULE=java.base MAKEFILE_PREFIX=Copy 20make[2]: *** [make/Main.gmk:162: java.base-copy] Error 139 21make[2]: *** Waiting for unfinished jobs.... 22Compiling 13 properties into resource bundles for jdk.javadoc 23 24ERROR: Build failed for target 'default (product-bundles test-bundles)' in configuration 'windows-x64' (exit code 2) 25 26No indication of failed target found. 27Hint: Try searching the build log for '] Error'. 28Hint: See doc/building.html#troubleshooting for assistance. 29 30make[1]: *** [/cygdrive/d/a/jdk11u-dev/jdk11u-dev/jdk/make/Init.gmk:305: main] Error 2 31make: *** [/cygdrive/d/a/jdk11u-dev/jdk11u-dev/jdk/make/Init.gmk:186: default] Error 2 32Error: Process completed with exit code 1. Cheers Mat Sent from Outlook From shade at redhat.com Wed Nov 10 15:45:41 2021 From: shade at redhat.com (Aleksey Shipilev) Date: Wed, 10 Nov 2021 16:45:41 +0100 Subject: Windows x64 (build release) job/jcheck fails with segmentation fault In-Reply-To: References: Message-ID: On 11/10/21 4:43 PM, Mat Carter wrote: > Hopefully this is the right mailing list to post issues; if not then please redirect me :) > > I have 3 chained PRs for jdk11u-dev, the final PR just failed on of the jchecks, looking at the issue it seems to be a build failure rather than a code issue (all other jobs succeeded including the debug build). > > PR:?https://github.com/openjdk/jdk11u-dev/pull/607 > Failure details:?https://github.com/macarte/jdk11u-dev/runs/4159447159?check_suite_focus=true > 19/usr/bin/bash: line 1: 1003 Segmentation fault (core dumped) /usr/bin/make -s -r -R -I /cygdrive/d/a/jdk11u-dev/jdk11u-dev/jdk/make/common SPEC=/cygdrive/d/a/jdk11u-dev/jdk11u-dev/jdk/build/windows-x64/spec.gmk MAKE_LOG_FLAGS="-s" -f ModuleWrapper.gmk -I/cygdrive/d/a/jdk11u-dev/jdk11u-dev/jdk/make -I/cygdrive/d/a/jdk11u-dev/jdk11u-dev/jdk/make/copy MODULE=java.base MAKEFILE_PREFIX=Copy > 20make[2]: *** [make/Main.gmk:162: java.base-copy] Error 139 Known thing: https://bugs.openjdk.java.net/browse/JDK-8276854 The backport to 11u is in progress... -- Thanks, -Aleksey From erikj at openjdk.java.net Wed Nov 17 14:25:32 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Wed, 17 Nov 2021 14:25:32 GMT Subject: RFR: 1242: The /clean command for backports is ignored Message-ID: When dealing with backport pull requests, Skara tries to automatically determine if the backport is "clean". This automatic check is rather picky, so the user is supposed to be able to override this result with the command "/clean". Issuing the command works so far as the bot will react to it and add the "clean" label, but then it will ignore the label and still not consider the pull request clean. This patch fixes this and updates the test to also verify that the pull request gets the "ready" label. ------------- Commit messages: - SKARA-1242 Changes: https://git.openjdk.java.net/skara/pull/1239/files Webrev: https://webrevs.openjdk.java.net/?repo=skara&pr=1239&range=00 Issue: https://bugs.openjdk.java.net/browse/SKARA-1242 Stats: 5 lines in 2 files changed: 2 ins; 0 del; 3 mod Patch: https://git.openjdk.java.net/skara/pull/1239.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1239/head:pull/1239 PR: https://git.openjdk.java.net/skara/pull/1239 From kcr at openjdk.java.net Wed Nov 17 14:36:08 2021 From: kcr at openjdk.java.net (Kevin Rushforth) Date: Wed, 17 Nov 2021 14:36:08 GMT Subject: RFR: 1242: The /clean command for backports is ignored In-Reply-To: References: Message-ID: On Wed, 17 Nov 2021 14:22:03 GMT, Erik Joelsson wrote: > When dealing with backport pull requests, Skara tries to automatically determine if the backport is "clean". This automatic check is rather picky, so the user is supposed to be able to override this result with the command "/clean". Issuing the command works so far as the bot will react to it and add the "clean" label, but then it will ignore the label and still not consider the pull request clean. > > This patch fixes this and updates the test to also verify that the pull request gets the "ready" label. The fix looks fine. I see that there are failing Linux tests. Can you check whether this is a glitch or a real test failure? ------------- PR: https://git.openjdk.java.net/skara/pull/1239 From erikj at openjdk.java.net Wed Nov 17 14:50:50 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Wed, 17 Nov 2021 14:50:50 GMT Subject: RFR: 1242: The /clean command for backports is ignored In-Reply-To: References: Message-ID: On Wed, 17 Nov 2021 14:33:40 GMT, Kevin Rushforth wrote: > The fix looks fine. I see that there are failing Linux tests. Can you check whether this is a glitch or a real test failure? I noticed that too. My local test run succeeded. Looking at this test, it's definitely not related to my change. It's trying to verify scheduling behavior, and I can see a potential race in there that would cause this to fail intermittently. ------------- PR: https://git.openjdk.java.net/skara/pull/1239 From erikj at openjdk.java.net Wed Nov 17 14:57:53 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Wed, 17 Nov 2021 14:57:53 GMT Subject: RFR: 1242: The /clean command for backports is ignored In-Reply-To: References: Message-ID: On Wed, 17 Nov 2021 14:48:28 GMT, Erik Joelsson wrote: > > The fix looks fine. I see that there are failing Linux tests. Can you check whether this is a glitch or a real test failure? > > I noticed that too. My local test run succeeded. Looking at this test, it's definitely not related to my change. It's trying to verify scheduling behavior, and I can see a potential race in there that would cause this to fail intermittently. Filed https://bugs.openjdk.java.net/browse/SKARA-1243 ------------- PR: https://git.openjdk.java.net/skara/pull/1239 From ihse at openjdk.java.net Wed Nov 17 15:02:00 2021 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Wed, 17 Nov 2021 15:02:00 GMT Subject: RFR: 1242: The /clean command for backports is ignored In-Reply-To: References: Message-ID: <6XaEz_3V4hAQgtfE1iJE_6BEF4PkOHM3Rxctfkie_d0=.24482313-a12b-4554-96f3-5039d9c399f5@github.com> On Wed, 17 Nov 2021 14:22:03 GMT, Erik Joelsson wrote: > When dealing with backport pull requests, Skara tries to automatically determine if the backport is "clean". This automatic check is rather picky, so the user is supposed to be able to override this result with the command "/clean". Issuing the command works so far as the bot will react to it and add the "clean" label, but then it will ignore the label and still not consider the pull request clean. > > This patch fixes this and updates the test to also verify that the pull request gets the "ready" label. Marked as reviewed by ihse (Reviewer). ------------- PR: https://git.openjdk.java.net/skara/pull/1239 From kcr at openjdk.java.net Wed Nov 17 15:02:00 2021 From: kcr at openjdk.java.net (Kevin Rushforth) Date: Wed, 17 Nov 2021 15:02:00 GMT Subject: RFR: 1242: The /clean command for backports is ignored In-Reply-To: References: Message-ID: On Wed, 17 Nov 2021 14:22:03 GMT, Erik Joelsson wrote: > When dealing with backport pull requests, Skara tries to automatically determine if the backport is "clean". This automatic check is rather picky, so the user is supposed to be able to override this result with the command "/clean". Issuing the command works so far as the bot will react to it and add the "clean" label, but then it will ignore the label and still not consider the pull request clean. > > This patch fixes this and updates the test to also verify that the pull request gets the "ready" label. Marked as reviewed by kcr (Reviewer). ------------- PR: https://git.openjdk.java.net/skara/pull/1239 From erikj at openjdk.java.net Wed Nov 17 15:37:22 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Wed, 17 Nov 2021 15:37:22 GMT Subject: RFR: 1243: BotRunnerTests may fail intermittently Message-ID: <9LoqsGkOetm2sTEYW9_huxR8n-HPl871s-pZj01nEQI=.da402b5a-206d-4bd2-a628-a0fae44bd42f@github.com> There is a potential race causing intermittent failures in the BotRunnerTests. This patch reduces concurrency to 1 for the executor in the affected tests. I believe the tests are still verifying the core behavior as intended even without parallel execution. ------------- Commit messages: - Unify formatting - SKARA-1243 Changes: https://git.openjdk.java.net/skara/pull/1240/files Webrev: https://webrevs.openjdk.java.net/?repo=skara&pr=1240&range=00 Issue: https://bugs.openjdk.java.net/browse/SKARA-1243 Stats: 6 lines in 1 file changed: 4 ins; 0 del; 2 mod Patch: https://git.openjdk.java.net/skara/pull/1240.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1240/head:pull/1240 PR: https://git.openjdk.java.net/skara/pull/1240 From erikj at openjdk.java.net Wed Nov 17 16:55:36 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Wed, 17 Nov 2021 16:55:36 GMT Subject: Integrated: 1242: The /clean command for backports is ignored In-Reply-To: References: Message-ID: <2Z7LtTYUwiTyspgGKj-0cLB67KiTaQrvOEPptwFlUzo=.86addc39-b253-48cd-8964-f8d5f6e0133a@github.com> On Wed, 17 Nov 2021 14:22:03 GMT, Erik Joelsson wrote: > When dealing with backport pull requests, Skara tries to automatically determine if the backport is "clean". This automatic check is rather picky, so the user is supposed to be able to override this result with the command "/clean". Issuing the command works so far as the bot will react to it and add the "clean" label, but then it will ignore the label and still not consider the pull request clean. > > This patch fixes this and updates the test to also verify that the pull request gets the "ready" label. This pull request has now been integrated. Changeset: 625a4db8 Author: Erik Joelsson URL: https://git.openjdk.java.net/skara/commit/625a4db8df3bb2cd7ab2b2345729f1812bf4fa48 Stats: 5 lines in 2 files changed: 2 ins; 0 del; 3 mod 1242: The /clean command for backports is ignored Reviewed-by: ihse, kcr ------------- PR: https://git.openjdk.java.net/skara/pull/1239 From ihse at openjdk.java.net Wed Nov 17 23:41:47 2021 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Wed, 17 Nov 2021 23:41:47 GMT Subject: RFR: 1243: BotRunnerTests may fail intermittently In-Reply-To: <9LoqsGkOetm2sTEYW9_huxR8n-HPl871s-pZj01nEQI=.da402b5a-206d-4bd2-a628-a0fae44bd42f@github.com> References: <9LoqsGkOetm2sTEYW9_huxR8n-HPl871s-pZj01nEQI=.da402b5a-206d-4bd2-a628-a0fae44bd42f@github.com> Message-ID: On Wed, 17 Nov 2021 15:33:16 GMT, Erik Joelsson wrote: > There is a potential race causing intermittent failures in the BotRunnerTests. This patch reduces concurrency to 1 for the executor in the affected tests. I believe the tests are still verifying the core behavior as intended even without parallel execution. Marked as reviewed by ihse (Reviewer). ------------- PR: https://git.openjdk.java.net/skara/pull/1240 From erikj at openjdk.java.net Thu Nov 18 13:18:42 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Thu, 18 Nov 2021 13:18:42 GMT Subject: Integrated: 1243: BotRunnerTests may fail intermittently In-Reply-To: <9LoqsGkOetm2sTEYW9_huxR8n-HPl871s-pZj01nEQI=.da402b5a-206d-4bd2-a628-a0fae44bd42f@github.com> References: <9LoqsGkOetm2sTEYW9_huxR8n-HPl871s-pZj01nEQI=.da402b5a-206d-4bd2-a628-a0fae44bd42f@github.com> Message-ID: On Wed, 17 Nov 2021 15:33:16 GMT, Erik Joelsson wrote: > There is a potential race causing intermittent failures in the BotRunnerTests. This patch reduces concurrency to 1 for the executor in the affected tests. I believe the tests are still verifying the core behavior as intended even without parallel execution. This pull request has now been integrated. Changeset: f0c9e8a5 Author: Erik Joelsson URL: https://git.openjdk.java.net/skara/commit/f0c9e8a57d29216de60a1c815d1af194d1cb457a Stats: 6 lines in 1 file changed: 4 ins; 0 del; 2 mod 1243: BotRunnerTests may fail intermittently Reviewed-by: ihse ------------- PR: https://git.openjdk.java.net/skara/pull/1240 From gli at openjdk.java.net Sun Nov 21 09:04:40 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Sun, 21 Nov 2021 09:04:40 GMT Subject: RFR: 1206: Skara: TagCommand creates malformed Markdown link Message-ID: Hi all, This little patch fixes the malformed link and adds the corresponding test case. Thanks for taking the time to review. Best Regards, -- Guoxiong ------------- Commit messages: - SKARA-1206: Skara: TagCommand creates malformed Markdown link Changes: https://git.openjdk.java.net/skara/pull/1241/files Webrev: https://webrevs.openjdk.java.net/?repo=skara&pr=1241&range=00 Issue: https://bugs.openjdk.java.net/browse/SKARA-1206 Stats: 2 lines in 2 files changed: 1 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/skara/pull/1241.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1241/head:pull/1241 PR: https://git.openjdk.java.net/skara/pull/1241 From gli at openjdk.java.net Sun Nov 21 14:59:55 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Sun, 21 Nov 2021 14:59:55 GMT Subject: RFR: 1188: The pr/NNNN branches are not always deleted when a PR is closed Message-ID: Hi all, When a PR is ready for reviewing, the label `rfr` will be added and skara will create the branch `pr/NNNN` for it. If we convert the PR back to draft, the label `rfr` would be removed and the branch `pr/NNNN` won't be deleted. Then we close the PR, **the bot won't deleted the branch**. The reason is that the following code checks the label `rfr` or `integrated` to decide whether the bot should remove the branch. private boolean isOfInterest(PullRequest pr) { var labels = new HashSet<>(pr.labelNames()); if (!(labels.contains("rfr") || labels.contains("integrated"))) { log.fine("PR is not yet ready - needs either 'rfr' or 'integrated' label"); return false; } // ignore...... } To solve this issue, this patch adds one situation about the branch existing or not. And the corresponding test is added. Thanks for taking the time to review. Best Regards, -- Guoxiong ------------- Commit messages: - 1188: The pr/NNNN branches are not always deleted when a PR is closed Changes: https://git.openjdk.java.net/skara/pull/1242/files Webrev: https://webrevs.openjdk.java.net/?repo=skara&pr=1242&range=00 Issue: https://bugs.openjdk.java.net/browse/SKARA-1188 Stats: 61 lines in 2 files changed: 58 ins; 0 del; 3 mod Patch: https://git.openjdk.java.net/skara/pull/1242.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1242/head:pull/1242 PR: https://git.openjdk.java.net/skara/pull/1242 From dholmes at openjdk.java.net Mon Nov 22 04:31:13 2021 From: dholmes at openjdk.java.net (David Holmes) Date: Mon, 22 Nov 2021 04:31:13 GMT Subject: RFR: 1188: The pr/NNNN branches are not always deleted when a PR is closed In-Reply-To: References: Message-ID: On Sun, 21 Nov 2021 14:56:30 GMT, Guoxiong Li wrote: > Hi all, > > When a PR is ready for reviewing, the label `rfr` will be added and skara will create the branch `pr/NNNN` for it. > If we convert the PR back to draft, the label `rfr` would be removed and the branch `pr/NNNN` won't be deleted. > Then we close the PR, **the bot won't deleted the branch**. > > The reason is that the following code checks the label `rfr` or `integrated` to decide whether the bot should remove the branch. > > > private boolean isOfInterest(PullRequest pr) { > var labels = new HashSet<>(pr.labelNames()); > if (!(labels.contains("rfr") || labels.contains("integrated"))) { > log.fine("PR is not yet ready - needs either 'rfr' or 'integrated' label"); > return false; > } > // ignore...... > } > > > To solve this issue, this patch adds one situation about the branch existing or not. And the corresponding test is added. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong If the PR is re-opened again will the branch be recreated? ------------- PR: https://git.openjdk.java.net/skara/pull/1242 From gli at openjdk.java.net Mon Nov 22 04:38:28 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Mon, 22 Nov 2021 04:38:28 GMT Subject: RFR: 1188: The pr/NNNN branches are not always deleted when a PR is closed In-Reply-To: References: Message-ID: On Mon, 22 Nov 2021 04:28:41 GMT, David Holmes wrote: > If the PR is re-opened again will the branch be recreated? It depends on whether the PR has the label `rfr`. As you can see the condition `labels.contains("rfr") || labels.contains("integrated") || branchExists`, only the PR has label `rfr` or `integrated` or has branch `pr/NNNN`, the `PullRequestWorkItem` would be added to be invoked. ------------- PR: https://git.openjdk.java.net/skara/pull/1242 From gli at openjdk.java.net Mon Nov 22 04:41:40 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Mon, 22 Nov 2021 04:41:40 GMT Subject: RFR: 1188: The pr/NNNN branches are not always deleted when a PR is closed In-Reply-To: References: Message-ID: On Sun, 21 Nov 2021 14:56:30 GMT, Guoxiong Li wrote: > Hi all, > > When a PR is ready for reviewing, the label `rfr` will be added and skara will create the branch `pr/NNNN` for it. > If we convert the PR back to draft, the label `rfr` would be removed and the branch `pr/NNNN` won't be deleted. > Then we close the PR, **the bot won't deleted the branch**. > > The reason is that the following code checks the label `rfr` or `integrated` to decide whether the bot should remove the branch. > > > private boolean isOfInterest(PullRequest pr) { > var labels = new HashSet<>(pr.labelNames()); > if (!(labels.contains("rfr") || labels.contains("integrated"))) { > log.fine("PR is not yet ready - needs either 'rfr' or 'integrated' label"); > return false; > } > // ignore...... > } > > > To solve this issue, this patch adds one situation about the branch existing or not. And the corresponding test is added. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong The newly added test case also tests this situation. Please see the following code taken from the test case. // Reopen the PR pr.setState(Issue.State.OPEN); TestBotRunner.runPeriodicItems(notifyBot); // The target repo should not contain the branch, because the pr doesn't have label `rfr`. assertThrows(IOException.class, () -> localRepo.fetch(repo.url(), PreIntegrations.preIntegrateBranch(pr))); // add label `rfr` pr.addLabel("rfr"); TestBotRunner.runPeriodicItems(notifyBot); // The branch should have reappeared hash = localRepo.fetch(repo.url(), PreIntegrations.preIntegrateBranch(pr)); assertEquals(editHash, hash); ------------- PR: https://git.openjdk.java.net/skara/pull/1242 From gli at openjdk.java.net Mon Nov 22 05:40:02 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Mon, 22 Nov 2021 05:40:02 GMT Subject: RFR: 1206: Skara: TagCommand creates malformed Markdown link [v2] In-Reply-To: References: Message-ID: > Hi all, > > This little patch fixes the malformed link and adds the corresponding test case. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: Fix regex because the text may have line terminators ------------- Changes: - all: https://git.openjdk.java.net/skara/pull/1241/files - new: https://git.openjdk.java.net/skara/pull/1241/files/87c115ee..f1fecab6 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=skara&pr=1241&range=01 - incr: https://webrevs.openjdk.java.net/?repo=skara&pr=1241&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/skara/pull/1241.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1241/head:pull/1241 PR: https://git.openjdk.java.net/skara/pull/1241 From gli at openjdk.java.net Mon Nov 22 05:57:35 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Mon, 22 Nov 2021 05:57:35 GMT Subject: RFR: 1206: Skara: TagCommand creates malformed Markdown link [v3] In-Reply-To: References: Message-ID: > Hi all, > > This little patch fixes the malformed link and adds the corresponding test case. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: Use multiline mode. ------------- Changes: - all: https://git.openjdk.java.net/skara/pull/1241/files - new: https://git.openjdk.java.net/skara/pull/1241/files/f1fecab6..c9d88e29 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=skara&pr=1241&range=02 - incr: https://webrevs.openjdk.java.net/?repo=skara&pr=1241&range=01-02 Stats: 4 lines in 1 file changed: 3 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/skara/pull/1241.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1241/head:pull/1241 PR: https://git.openjdk.java.net/skara/pull/1241 From gli at openjdk.java.net Mon Nov 22 10:01:41 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Mon, 22 Nov 2021 10:01:41 GMT Subject: RFR: 1252: Improve the output message about the command `csr` Message-ID: <_K3CXQzhp1erqW5Ob8wzHB9R1kehqhzUrnIC__PTtwQ=.7aa1592b-dafb-441a-a157-8b2e9e0fb3fe@github.com> Hi all, Currently, when a user, who is not the author of the pr and is not a reviewer, uses the command `/csr unneeded`, the bot will output the message `only the pull request author and [Reviewers](https://openjdk.java.net/bylaws#reviewer) are allowed to require a CSR.`. The message is good when meeting the command `/csr` or `/csr needed` but it is not good when meeting the command `/csr unneeded` or `/csr uneeded`. This patch changes the message `are allowed to require a CSR` to `are allowed to use the csr command` and adds the corresponding test cases. Thanks for taking the time to review. Best Regards, -- Guoxiong ------------- Commit messages: - 1252: Improve the output message about the command `csr` Changes: https://git.openjdk.java.net/skara/pull/1243/files Webrev: https://webrevs.openjdk.java.net/?repo=skara&pr=1243&range=00 Issue: https://bugs.openjdk.java.net/browse/SKARA-1252 Stats: 28 lines in 2 files changed: 24 ins; 0 del; 4 mod Patch: https://git.openjdk.java.net/skara/pull/1243.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1243/head:pull/1243 PR: https://git.openjdk.java.net/skara/pull/1243 From erikj at openjdk.java.net Mon Nov 22 14:02:50 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Mon, 22 Nov 2021 14:02:50 GMT Subject: RFR: 1252: Improve the output message about the command `csr` In-Reply-To: <_K3CXQzhp1erqW5Ob8wzHB9R1kehqhzUrnIC__PTtwQ=.7aa1592b-dafb-441a-a157-8b2e9e0fb3fe@github.com> References: <_K3CXQzhp1erqW5Ob8wzHB9R1kehqhzUrnIC__PTtwQ=.7aa1592b-dafb-441a-a157-8b2e9e0fb3fe@github.com> Message-ID: On Mon, 22 Nov 2021 09:58:13 GMT, Guoxiong Li wrote: > Hi all, > > Currently, when a user, who is not the author of the pr and is not a reviewer, uses the command `/csr unneeded`, the bot will output the message `only the pull request author and [Reviewers](https://openjdk.java.net/bylaws#reviewer) are allowed to require a CSR.`. The message is good when meeting the command `/csr` or `/csr needed` but it is not good when meeting the command `/csr unneeded` or `/csr uneeded`. > > This patch changes the message `are allowed to require a CSR` to `are allowed to use the csr command` and adds the corresponding test cases. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong Looks good, thanks for fixing this! ------------- Marked as reviewed by erikj (Lead). PR: https://git.openjdk.java.net/skara/pull/1243 From erikj at openjdk.java.net Mon Nov 22 14:14:27 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Mon, 22 Nov 2021 14:14:27 GMT Subject: RFR: 1188: The pr/NNNN branches are not always deleted when a PR is closed In-Reply-To: References: Message-ID: <7qdS9EJ8ezdrRobgv1E2fdWn1YUvIj8yRQBdSSn2JZs=.6591d2cb-048a-49db-afb9-a5a8cf3d4787@github.com> On Sun, 21 Nov 2021 14:56:30 GMT, Guoxiong Li wrote: > Hi all, > > When a PR is ready for reviewing, the label `rfr` will be added and skara will create the branch `pr/NNNN` for it. > If we convert the PR back to draft, the label `rfr` would be removed and the branch `pr/NNNN` won't be deleted. > Then we close the PR, **the bot won't deleted the branch**. > > The reason is that the following code checks the label `rfr` or `integrated` to decide whether the bot should remove the branch. > > > private boolean isOfInterest(PullRequest pr) { > var labels = new HashSet<>(pr.labelNames()); > if (!(labels.contains("rfr") || labels.contains("integrated"))) { > log.fine("PR is not yet ready - needs either 'rfr' or 'integrated' label"); > return false; > } > // ignore...... > } > > > To solve this issue, this patch adds one situation about the branch existing or not. And the corresponding test is added. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong Looks good and well spotted! ------------- Marked as reviewed by erikj (Lead). PR: https://git.openjdk.java.net/skara/pull/1242 From erikj at openjdk.java.net Mon Nov 22 14:16:12 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Mon, 22 Nov 2021 14:16:12 GMT Subject: RFR: 1206: Skara: TagCommand creates malformed Markdown link [v3] In-Reply-To: References: Message-ID: On Mon, 22 Nov 2021 05:57:35 GMT, Guoxiong Li wrote: >> Hi all, >> >> This little patch fixes the malformed link and adds the corresponding test case. >> >> Thanks for taking the time to review. >> >> Best Regards, >> -- Guoxiong > > Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: > > Use multiline mode. Marked as reviewed by erikj (Lead). ------------- PR: https://git.openjdk.java.net/skara/pull/1241 From gli at openjdk.java.net Mon Nov 22 15:44:33 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Mon, 22 Nov 2021 15:44:33 GMT Subject: RFR: 1206: Skara: TagCommand creates malformed Markdown link [v3] In-Reply-To: References: Message-ID: On Mon, 22 Nov 2021 14:13:34 GMT, Erik Joelsson wrote: >> Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: >> >> Use multiline mode. > > Marked as reviewed by erikj (Lead). @erikj79 Thanks for your review. Could I get your help to sponsor this patch? ------------- PR: https://git.openjdk.java.net/skara/pull/1241 From gli at openjdk.java.net Mon Nov 22 15:44:54 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Mon, 22 Nov 2021 15:44:54 GMT Subject: RFR: 1188: The pr/NNNN branches are not always deleted when a PR is closed In-Reply-To: <7qdS9EJ8ezdrRobgv1E2fdWn1YUvIj8yRQBdSSn2JZs=.6591d2cb-048a-49db-afb9-a5a8cf3d4787@github.com> References: <7qdS9EJ8ezdrRobgv1E2fdWn1YUvIj8yRQBdSSn2JZs=.6591d2cb-048a-49db-afb9-a5a8cf3d4787@github.com> Message-ID: On Mon, 22 Nov 2021 14:11:57 GMT, Erik Joelsson wrote: >> Hi all, >> >> When a PR is ready for reviewing, the label `rfr` will be added and skara will create the branch `pr/NNNN` for it. >> If we convert the PR back to draft, the label `rfr` would be removed and the branch `pr/NNNN` won't be deleted. >> Then we close the PR, **the bot won't deleted the branch**. >> >> The reason is that the following code checks the label `rfr` or `integrated` to decide whether the bot should remove the branch. >> >> >> private boolean isOfInterest(PullRequest pr) { >> var labels = new HashSet<>(pr.labelNames()); >> if (!(labels.contains("rfr") || labels.contains("integrated"))) { >> log.fine("PR is not yet ready - needs either 'rfr' or 'integrated' label"); >> return false; >> } >> // ignore...... >> } >> >> >> To solve this issue, this patch adds one situation about the branch existing or not. And the corresponding test is added. >> >> Thanks for taking the time to review. >> >> Best Regards, >> -- Guoxiong > > Looks good and well spotted! @erikj79 Thanks for your review. Could I get your help to sponsor this patch? ------------- PR: https://git.openjdk.java.net/skara/pull/1242 From gli at openjdk.java.net Mon Nov 22 15:45:07 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Mon, 22 Nov 2021 15:45:07 GMT Subject: RFR: 1252: Improve the output message about the command `csr` In-Reply-To: References: <_K3CXQzhp1erqW5Ob8wzHB9R1kehqhzUrnIC__PTtwQ=.7aa1592b-dafb-441a-a157-8b2e9e0fb3fe@github.com> Message-ID: On Mon, 22 Nov 2021 14:00:08 GMT, Erik Joelsson wrote: >> Hi all, >> >> Currently, when a user, who is not the author of the pr and is not a reviewer, uses the command `/csr unneeded`, the bot will output the message `only the pull request author and [Reviewers](https://openjdk.java.net/bylaws#reviewer) are allowed to require a CSR.`. The message is good when meeting the command `/csr` or `/csr needed` but it is not good when meeting the command `/csr unneeded` or `/csr uneeded`. >> >> This patch changes the message `are allowed to require a CSR` to `are allowed to use the csr command` and adds the corresponding test cases. >> >> Thanks for taking the time to review. >> >> Best Regards, >> -- Guoxiong > > Looks good, thanks for fixing this! @erikj79 Thanks for your review. Could I get your help to sponsor this patch? ------------- PR: https://git.openjdk.java.net/skara/pull/1243 From erikj at openjdk.java.net Mon Nov 22 17:17:13 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Mon, 22 Nov 2021 17:17:13 GMT Subject: RFR: 1252: Improve the output message about the command `csr` In-Reply-To: <_K3CXQzhp1erqW5Ob8wzHB9R1kehqhzUrnIC__PTtwQ=.7aa1592b-dafb-441a-a157-8b2e9e0fb3fe@github.com> References: <_K3CXQzhp1erqW5Ob8wzHB9R1kehqhzUrnIC__PTtwQ=.7aa1592b-dafb-441a-a157-8b2e9e0fb3fe@github.com> Message-ID: On Mon, 22 Nov 2021 09:58:13 GMT, Guoxiong Li wrote: > Hi all, > > Currently, when a user, who is not the author of the pr and is not a reviewer, uses the command `/csr unneeded`, the bot will output the message `only the pull request author and [Reviewers](https://openjdk.java.net/bylaws#reviewer) are allowed to require a CSR.`. The message is good when meeting the command `/csr` or `/csr needed` but it is not good when meeting the command `/csr unneeded` or `/csr uneeded`. > > This patch changes the message `are allowed to require a CSR` to `are allowed to use the csr command` and adds the corresponding test cases. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong Of course. ------------- PR: https://git.openjdk.java.net/skara/pull/1243 From gli at openjdk.java.net Mon Nov 22 17:17:13 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Mon, 22 Nov 2021 17:17:13 GMT Subject: Integrated: 1252: Improve the output message about the command `csr` In-Reply-To: <_K3CXQzhp1erqW5Ob8wzHB9R1kehqhzUrnIC__PTtwQ=.7aa1592b-dafb-441a-a157-8b2e9e0fb3fe@github.com> References: <_K3CXQzhp1erqW5Ob8wzHB9R1kehqhzUrnIC__PTtwQ=.7aa1592b-dafb-441a-a157-8b2e9e0fb3fe@github.com> Message-ID: On Mon, 22 Nov 2021 09:58:13 GMT, Guoxiong Li wrote: > Hi all, > > Currently, when a user, who is not the author of the pr and is not a reviewer, uses the command `/csr unneeded`, the bot will output the message `only the pull request author and [Reviewers](https://openjdk.java.net/bylaws#reviewer) are allowed to require a CSR.`. The message is good when meeting the command `/csr` or `/csr needed` but it is not good when meeting the command `/csr unneeded` or `/csr uneeded`. > > This patch changes the message `are allowed to require a CSR` to `are allowed to use the csr command` and adds the corresponding test cases. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong This pull request has now been integrated. Changeset: 9b1f05c0 Author: Guoxiong Li Committer: Erik Joelsson URL: https://git.openjdk.java.net/skara/commit/9b1f05c0e929b543f495889e2e66f0c56857e781 Stats: 28 lines in 2 files changed: 24 ins; 0 del; 4 mod 1252: Improve the output message about the command `csr` Reviewed-by: erikj ------------- PR: https://git.openjdk.java.net/skara/pull/1243 From gli at openjdk.java.net Mon Nov 22 17:17:45 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Mon, 22 Nov 2021 17:17:45 GMT Subject: Integrated: 1188: The pr/NNNN branches are not always deleted when a PR is closed In-Reply-To: References: Message-ID: <9HmsbMcJegHX3xGE_R2sYWiAJBMirIsWKT-hlRnS8iU=.86be9b7a-925b-4143-8eab-6865fa4464be@github.com> On Sun, 21 Nov 2021 14:56:30 GMT, Guoxiong Li wrote: > Hi all, > > When a PR is ready for reviewing, the label `rfr` will be added and skara will create the branch `pr/NNNN` for it. > If we convert the PR back to draft, the label `rfr` would be removed and the branch `pr/NNNN` won't be deleted. > Then we close the PR, **the bot won't deleted the branch**. > > The reason is that the following code checks the label `rfr` or `integrated` to decide whether the bot should remove the branch. > > > private boolean isOfInterest(PullRequest pr) { > var labels = new HashSet<>(pr.labelNames()); > if (!(labels.contains("rfr") || labels.contains("integrated"))) { > log.fine("PR is not yet ready - needs either 'rfr' or 'integrated' label"); > return false; > } > // ignore...... > } > > > To solve this issue, this patch adds one situation about the branch existing or not. And the corresponding test is added. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong This pull request has now been integrated. Changeset: e951b64e Author: Guoxiong Li Committer: Erik Joelsson URL: https://git.openjdk.java.net/skara/commit/e951b64e020941414866d292c81594e42e43243a Stats: 61 lines in 2 files changed: 58 ins; 0 del; 3 mod 1188: The pr/NNNN branches are not always deleted when a PR is closed Reviewed-by: erikj ------------- PR: https://git.openjdk.java.net/skara/pull/1242 From gli at openjdk.java.net Mon Nov 22 17:18:09 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Mon, 22 Nov 2021 17:18:09 GMT Subject: Integrated: 1206: Skara: TagCommand creates malformed Markdown link In-Reply-To: References: Message-ID: On Sun, 21 Nov 2021 09:01:00 GMT, Guoxiong Li wrote: > Hi all, > > This little patch fixes the malformed link and adds the corresponding test case. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong This pull request has now been integrated. Changeset: 7367e956 Author: Guoxiong Li Committer: Erik Joelsson URL: https://git.openjdk.java.net/skara/commit/7367e956982a3095a9c5716595af030af608081f Stats: 5 lines in 2 files changed: 4 ins; 0 del; 1 mod 1206: Skara: TagCommand creates malformed Markdown link Reviewed-by: erikj ------------- PR: https://git.openjdk.java.net/skara/pull/1241 From gli at openjdk.java.net Tue Nov 23 17:43:34 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Tue, 23 Nov 2021 17:43:34 GMT Subject: RFR: 286: Add more info about CSR in the PR's first comment Message-ID: 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 ------------- Commit messages: - 286: Add more info about CSR in the PR's first comment Changes: https://git.openjdk.java.net/skara/pull/1244/files Webrev: https://webrevs.openjdk.java.net/?repo=skara&pr=1244&range=00 Issue: https://bugs.openjdk.java.net/browse/SKARA-286 Stats: 69 lines in 2 files changed: 69 ins; 0 del; 0 mod Patch: https://git.openjdk.java.net/skara/pull/1244.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1244/head:pull/1244 PR: https://git.openjdk.java.net/skara/pull/1244 From ihse at openjdk.java.net Tue Nov 23 19:26:42 2021 From: ihse at openjdk.java.net (Magnus Ihse Bursie) Date: Tue, 23 Nov 2021 19:26:42 GMT Subject: RFR: 286: Add more info about CSR in the PR's first comment In-Reply-To: References: Message-ID: On Tue, 23 Nov 2021 17:39:47 GMT, Guoxiong Li wrote: > 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 Looks good to me, but please await Erik's review as well. ------------- Marked as reviewed by ihse (Reviewer). PR: https://git.openjdk.java.net/skara/pull/1244 From gli at openjdk.java.net Wed Nov 24 07:27:06 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Wed, 24 Nov 2021 07:27:06 GMT Subject: RFR: 286: Add more info about CSR in the PR's first comment [v2] In-Reply-To: References: Message-ID: > 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 Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: Fix null exception. ------------- Changes: - all: https://git.openjdk.java.net/skara/pull/1244/files - new: https://git.openjdk.java.net/skara/pull/1244/files/c023b808..55fc8dda Webrevs: - full: https://webrevs.openjdk.java.net/?repo=skara&pr=1244&range=01 - incr: https://webrevs.openjdk.java.net/?repo=skara&pr=1244&range=00-01 Stats: 20 lines in 1 file changed: 6 ins; 3 del; 11 mod Patch: https://git.openjdk.java.net/skara/pull/1244.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1244/head:pull/1244 PR: https://git.openjdk.java.net/skara/pull/1244 From gli at openjdk.java.net Wed Nov 24 13:43:03 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Wed, 24 Nov 2021 13:43:03 GMT Subject: RFR: 286: Add more info about CSR in the PR's first comment [v2] In-Reply-To: References: Message-ID: On Tue, 23 Nov 2021 19:24:06 GMT, Magnus Ihse Bursie wrote: >> Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix null exception. > > Looks good to me, but please await Erik's review as well. @magicus Thanks for your review. I updated the code to resolve the null exception. Also wait @erikj79 to review. ------------- PR: https://git.openjdk.java.net/skara/pull/1244 From erikj at openjdk.java.net Wed Nov 24 14:00:06 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Wed, 24 Nov 2021 14:00:06 GMT Subject: RFR: 286: Add more info about CSR in the PR's first comment [v2] In-Reply-To: References: Message-ID: <5rmq0C7sjc1IooGAt5KpOd3V-so0QExAFMKy-_Tr65E=.e02eb3e8-abd4-47aa-8308-63d79cd5f13f@github.com> On Wed, 24 Nov 2021 07:27:06 GMT, Guoxiong Li wrote: >> 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 > > Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: > > Fix null exception. 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. bots/pr/src/main/java/org/openjdk/skara/bots/pr/CheckRun.java line 137: > 135: if (relationship.isPresent() && relationship.get().equals("csr for")) { > 136: csr = link.issue().orElseThrow( > 137: () -> new IllegalStateException("Link with title 'csr for' does not contain issue") 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(). ------------- PR: https://git.openjdk.java.net/skara/pull/1244 From gli at openjdk.java.net Wed Nov 24 16:02:47 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Wed, 24 Nov 2021 16:02:47 GMT Subject: RFR: 286: Add more info about CSR in the PR's first comment [v3] In-Reply-To: References: Message-ID: > 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 Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: Dont throw exception. Add CSR tag. Avoid the issue type intergration blocker. ------------- Changes: - all: https://git.openjdk.java.net/skara/pull/1244/files - new: https://git.openjdk.java.net/skara/pull/1244/files/55fc8dda..2d7996ec Webrevs: - full: https://webrevs.openjdk.java.net/?repo=skara&pr=1244&range=02 - incr: https://webrevs.openjdk.java.net/?repo=skara&pr=1244&range=01-02 Stats: 15 lines in 2 files changed: 6 ins; 2 del; 7 mod Patch: https://git.openjdk.java.net/skara/pull/1244.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1244/head:pull/1244 PR: https://git.openjdk.java.net/skara/pull/1244 From gli at openjdk.java.net Wed Nov 24 16:01:17 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Wed, 24 Nov 2021 16:01:17 GMT Subject: RFR: 1071: auto-set `/csr` flag from JBS state Message-ID: Hi all, Currently, the author of the PR or a reviewer could type `/csr` in the comment to direct the need of the CSR. It is good for the bot to automatically scan the `scr for` link and set the `csr` label for the PR. This patch adds the automatically scanning feature. And the corresponding tests are added. Thanks for taking the time to review. Best Regards, -- Guoxiong ------------- Commit messages: - 1071: auto-set /csr flag from JBS state Changes: https://git.openjdk.java.net/skara/pull/1245/files Webrev: https://webrevs.openjdk.java.net/?repo=skara&pr=1245&range=00 Issue: https://bugs.openjdk.java.net/browse/SKARA-1071 Stats: 169 lines in 6 files changed: 145 ins; 13 del; 11 mod Patch: https://git.openjdk.java.net/skara/pull/1245.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1245/head:pull/1245 PR: https://git.openjdk.java.net/skara/pull/1245 From gli at openjdk.java.net Wed Nov 24 16:06:06 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Wed, 24 Nov 2021 16:06:06 GMT Subject: RFR: 286: Add more info about CSR in the PR's first comment [v3] In-Reply-To: References: Message-ID: On Wed, 24 Nov 2021 16:02:47 GMT, Guoxiong Li wrote: >> 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 > > Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: > > Dont throw exception. Add CSR tag. Avoid the issue type intergration blocker. 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. ------------- PR: https://git.openjdk.java.net/skara/pull/1244 From gli at openjdk.java.net Wed Nov 24 16:16:06 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Wed, 24 Nov 2021 16:16:06 GMT Subject: RFR: 286: Add more info about CSR in the PR's first comment [v4] In-Reply-To: References: Message-ID: > 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 Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: Add logging. ------------- Changes: - all: https://git.openjdk.java.net/skara/pull/1244/files - new: https://git.openjdk.java.net/skara/pull/1244/files/2d7996ec..19521b67 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=skara&pr=1244&range=03 - incr: https://webrevs.openjdk.java.net/?repo=skara&pr=1244&range=02-03 Stats: 3 lines in 1 file changed: 3 ins; 0 del; 0 mod Patch: https://git.openjdk.java.net/skara/pull/1244.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1244/head:pull/1244 PR: https://git.openjdk.java.net/skara/pull/1244 From erikj at openjdk.java.net Wed Nov 24 16:43:49 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Wed, 24 Nov 2021 16:43:49 GMT Subject: RFR: 286: Add more info about CSR in the PR's first comment [v4] In-Reply-To: References: Message-ID: On Wed, 24 Nov 2021 16:16:06 GMT, Guoxiong Li wrote: >> 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 > > Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: > > Add logging. Looks good! ------------- Marked as reviewed by erikj (Lead). PR: https://git.openjdk.java.net/skara/pull/1244 From erikj at openjdk.java.net Wed Nov 24 17:10:45 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Wed, 24 Nov 2021 17:10:45 GMT Subject: RFR: 1071: auto-set `/csr` flag from JBS state In-Reply-To: References: Message-ID: On Wed, 24 Nov 2021 15:57:55 GMT, Guoxiong Li wrote: > Hi all, > > Currently, the author of the PR or a reviewer could type `/csr` in the comment to direct the need of the CSR. > It is good for the bot to automatically scan the `scr for` link and set the `csr` label for the PR. > > This patch adds the automatically scanning feature. And the corresponding tests are added. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong bots/csr/src/main/java/org/openjdk/skara/bots/csr/CSRBot.java line 95: > 93: var resolution = csr.properties().get("resolution"); > 94: if (resolution == null || resolution.isNull()) { > 95: log.info("CSR issue resolution is null for " + describe(pr) + ", not removing CSR label"); I think the log message should reflect if we are leaving the label or adding it. bots/csr/src/test/java/org/openjdk/skara/bots/csr/CSRBotTests.java line 168: > 166: TestBotRunner.runPeriodicItems(bot); > 167: > 168: // The bot should have kept the CSR label Is this a check for if the bot added the label automatically? bots/csr/src/test/java/org/openjdk/skara/bots/csr/CSRBotTests.java line 172: > 170: > 171: // Add CSR label > 172: pr.addLabel("csr"); Adding the label here has no effect. bots/pr/src/main/java/org/openjdk/skara/bots/pr/CSRCommand.java line 81: > 79: > 80: // Change the CSR link relationship from `csr for` to `relates to` > 81: // so that the CSRBot won't add the `csr` label automatically. I'm not sure this is a good idea. The only reason to keep the /csr command around would be to have a way of manually correcting the state of a PR if the bots somehow fail, but I'm leaning towards just removing the command. If a CSR is already linked in JBS, but is later deemed to not be needed, I think the user should fix that in JBS rather than through a Skara command. I think this needs some discussion and input from more people. ------------- PR: https://git.openjdk.java.net/skara/pull/1245 From erikj at openjdk.java.net Wed Nov 24 17:21:02 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Wed, 24 Nov 2021 17:21:02 GMT Subject: RFR: 1071: auto-set `/csr` flag from JBS state In-Reply-To: References: Message-ID: On Wed, 24 Nov 2021 17:07:47 GMT, Erik Joelsson wrote: >> Hi all, >> >> Currently, the author of the PR or a reviewer could type `/csr` in the comment to direct the need of the CSR. >> It is good for the bot to automatically scan the `scr for` link and set the `csr` label for the PR. >> >> This patch adds the automatically scanning feature. And the corresponding tests are added. >> >> Thanks for taking the time to review. >> >> Best Regards, >> -- Guoxiong > > bots/pr/src/main/java/org/openjdk/skara/bots/pr/CSRCommand.java line 81: > >> 79: >> 80: // Change the CSR link relationship from `csr for` to `relates to` >> 81: // so that the CSRBot won't add the `csr` label automatically. > > I'm not sure this is a good idea. The only reason to keep the /csr command around would be to have a way of manually correcting the state of a PR if the bots somehow fail, but I'm leaning towards just removing the command. If a CSR is already linked in JBS, but is later deemed to not be needed, I think the user should fix that in JBS rather than through a Skara command. > > I think this needs some discussion and input from more people. I read up more on the history here. The /csr command can be invoked prior to creating a CSR issue in JBS, so it still makes sense to have the command. Given this, then invoking "/csr unneeded" can happen in two different scenarios: 1. No CSR has been filed yet, then just remove the csr label 2. A CSR is linked in JBS, in this case the CSRBot will likely automatically add the label again I still don't think it makes sense to have this command go and change things in JBS. In case 2, a better cause of action would be to tell the user in an error reply that a CSR already exists and needs to be closed/removed first. ------------- PR: https://git.openjdk.java.net/skara/pull/1245 From kcr at openjdk.java.net Wed Nov 24 17:42:06 2021 From: kcr at openjdk.java.net (Kevin Rushforth) Date: Wed, 24 Nov 2021 17:42:06 GMT Subject: RFR: 1071: auto-set `/csr` flag from JBS state In-Reply-To: References: Message-ID: <5S9qItTIC-xJlohOhqhFzHaSWlDKiJSM64hggmntEmA=.379e4c2b-0651-4bdb-81b2-55b6766d06f4@github.com> On Wed, 24 Nov 2021 15:57:55 GMT, Guoxiong Li wrote: > Hi all, > > Currently, the author of the PR or a reviewer could type `/csr` in the comment to direct the need of the CSR. > It is good for the bot to automatically scan the `scr for` link and set the `csr` label for the PR. > > This patch adds the automatically scanning feature. And the corresponding tests are added. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong The primary way that I use the `/csr` command is as a Reviewer to indicate that a PR needs to have a CSR when one might not yet exist. In some cases, the PR author might not realize that a CSR is needed. So the `/csr` command is definitely needed for this case. I also agree with Erik that the CSR bot should not modify anything in JBS. The automatic detection of an already-existing CSR in JBS seems like a "nice to have" feature for the case where a CSR already exists prior to creating the PR, so that the author (or a Reviewer) doesn't have to remember to say `/csr needed` explicitly, but we still need to be able to manually set it (and clear it in the case where further discussion indicates that a CSR really isn't needed). ------------- PR: https://git.openjdk.java.net/skara/pull/1245 From kcr at openjdk.java.net Wed Nov 24 18:08:22 2021 From: kcr at openjdk.java.net (Kevin Rushforth) Date: Wed, 24 Nov 2021 18:08:22 GMT Subject: RFR: 1071: auto-set `/csr` flag from JBS state In-Reply-To: References: Message-ID: <9ib5ZucxGm-g3iwkfQnZKrjRmMyzOBAOLk7YvHANYkA=.987c2e43-e3d5-458c-8e15-95a413bf9a5e@github.com> On Wed, 24 Nov 2021 15:57:55 GMT, Guoxiong Li wrote: > Hi all, > > Currently, the author of the PR or a reviewer could type `/csr` in the comment to direct the need of the CSR. > It is good for the bot to automatically scan the `scr for` link and set the `csr` label for the PR. > > This patch adds the automatically scanning feature. And the corresponding tests are added. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong Yes there is a closed "Withdrawn" state, but I would probably prefer a Reviewer to issue the `/csr unneeded` in that case. Otherwise, A PR author with the role of Committer could withdraw a CSR that a Reviewer had requested and integrate it without satisfying that requirement. ------------- PR: https://git.openjdk.java.net/skara/pull/1245 From erikj at openjdk.java.net Wed Nov 24 19:34:29 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Wed, 24 Nov 2021 19:34:29 GMT Subject: RFR: 1071: auto-set `/csr` flag from JBS state In-Reply-To: <9ib5ZucxGm-g3iwkfQnZKrjRmMyzOBAOLk7YvHANYkA=.987c2e43-e3d5-458c-8e15-95a413bf9a5e@github.com> References: <9ib5ZucxGm-g3iwkfQnZKrjRmMyzOBAOLk7YvHANYkA=.987c2e43-e3d5-458c-8e15-95a413bf9a5e@github.com> Message-ID: On Wed, 24 Nov 2021 18:05:48 GMT, Kevin Rushforth wrote: > Yes there is a closed "Withdrawn" state, but I would probably prefer a Reviewer to issue the `/csr unneeded` in that case. Otherwise, A PR author with the role of Committer could withdraw a CSR that a Reviewer had requested and integrate it without satisfying that requirement. Yes, that sounds good. What I'm mostly after is what conditions need to be met for the `/csr unneeded` command to succeed. Given this, there are two situations where it should succeed: 1. No CSR issue exists. 2. A CSR issue exists but has been withdrawn. If neither of those two are true, then issuing `/csr unneeded` should result in an error explaining that a CSR has already been filed and will need to be withdrawn first. ------------- PR: https://git.openjdk.java.net/skara/pull/1245 From kcr at openjdk.java.net Wed Nov 24 19:37:06 2021 From: kcr at openjdk.java.net (Kevin Rushforth) Date: Wed, 24 Nov 2021 19:37:06 GMT Subject: RFR: 1071: auto-set `/csr` flag from JBS state In-Reply-To: References: Message-ID: On Wed, 24 Nov 2021 15:57:55 GMT, Guoxiong Li wrote: > Hi all, > > Currently, the author of the PR or a reviewer could type `/csr` in the comment to direct the need of the CSR. > It is good for the bot to automatically scan the `scr for` link and set the `csr` label for the PR. > > This patch adds the automatically scanning feature. And the corresponding tests are added. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong Yes, this seems good. ------------- PR: https://git.openjdk.java.net/skara/pull/1245 From gli at openjdk.java.net Thu Nov 25 01:28:43 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Thu, 25 Nov 2021 01:28:43 GMT Subject: RFR: 286: Add a link to CSR in the PR's first comment [v2] In-Reply-To: <5rmq0C7sjc1IooGAt5KpOd3V-so0QExAFMKy-_Tr65E=.e02eb3e8-abd4-47aa-8308-63d79cd5f13f@github.com> References: <5rmq0C7sjc1IooGAt5KpOd3V-so0QExAFMKy-_Tr65E=.e02eb3e8-abd4-47aa-8308-63d79cd5f13f@github.com> Message-ID: On Wed, 24 Nov 2021 13:57:18 GMT, Erik Joelsson wrote: >> Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: >> >> Fix null exception. > > 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. @erikj79 @magicusThanks for the reviews. Could I get your help to sponsor this patch? ------------- PR: https://git.openjdk.java.net/skara/pull/1244 From gli at openjdk.java.net Thu Nov 25 04:13:23 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Thu, 25 Nov 2021 04:13:23 GMT Subject: RFR: 1071: auto-set `/csr` flag from JBS state [v2] In-Reply-To: References: Message-ID: > Hi all, > > Currently, the author of the PR or a reviewer could type `/csr` in the comment to direct the need of the CSR. > It is good for the bot to automatically scan the `scr for` link and set the `csr` label for the PR. > > This patch adds the automatically scanning feature. And the corresponding tests are added. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong Guoxiong Li has updated the pull request incrementally with three additional commits since the last revision: - Revise the logic of the command '/csr unneeded' - Fix the tests. - Revise logging. ------------- Changes: - all: https://git.openjdk.java.net/skara/pull/1245/files - new: https://git.openjdk.java.net/skara/pull/1245/files/e8a43a4e..d36ec3a5 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=skara&pr=1245&range=01 - incr: https://webrevs.openjdk.java.net/?repo=skara&pr=1245&range=00-01 Stats: 159 lines in 6 files changed: 59 ins; 89 del; 11 mod Patch: https://git.openjdk.java.net/skara/pull/1245.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1245/head:pull/1245 PR: https://git.openjdk.java.net/skara/pull/1245 From gli at openjdk.java.net Thu Nov 25 04:21:30 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Thu, 25 Nov 2021 04:21:30 GMT Subject: RFR: 1071: auto-set `/csr` flag from JBS state [v2] In-Reply-To: References: Message-ID: On Wed, 24 Nov 2021 16:56:55 GMT, Erik Joelsson wrote: >> Guoxiong Li has updated the pull request incrementally with three additional commits since the last revision: >> >> - Revise the logic of the command '/csr unneeded' >> - Fix the tests. >> - Revise logging. > > bots/csr/src/main/java/org/openjdk/skara/bots/csr/CSRBot.java line 95: > >> 93: var resolution = csr.properties().get("resolution"); >> 94: if (resolution == null || resolution.isNull()) { >> 95: log.info("CSR issue resolution is null for " + describe(pr) + ", not removing CSR label"); > > I think the log message should reflect if we are leaving the label or adding it. I adjusted the log message to reflect these two situation. > bots/csr/src/test/java/org/openjdk/skara/bots/csr/CSRBotTests.java line 168: > >> 166: TestBotRunner.runPeriodicItems(bot); >> 167: >> 168: // The bot should have kept the CSR label > > Is this a check for if the bot added the label automatically? yes, I revised the comment for readability. > bots/csr/src/test/java/org/openjdk/skara/bots/csr/CSRBotTests.java line 172: > >> 170: >> 171: // Add CSR label >> 172: pr.addLabel("csr"); > > Adding the label here has no effect. yes, because the bot has already added csr label automatically. I removed this step. ------------- PR: https://git.openjdk.java.net/skara/pull/1245 From gli at openjdk.java.net Thu Nov 25 04:21:31 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Thu, 25 Nov 2021 04:21:31 GMT Subject: RFR: 1071: auto-set `/csr` flag from JBS state [v2] In-Reply-To: References: Message-ID: On Wed, 24 Nov 2021 17:18:28 GMT, Erik Joelsson wrote: >> bots/pr/src/main/java/org/openjdk/skara/bots/pr/CSRCommand.java line 81: >> >>> 79: >>> 80: // Change the CSR link relationship from `csr for` to `relates to` >>> 81: // so that the CSRBot won't add the `csr` label automatically. >> >> I'm not sure this is a good idea. The only reason to keep the /csr command around would be to have a way of manually correcting the state of a PR if the bots somehow fail, but I'm leaning towards just removing the command. If a CSR is already linked in JBS, but is later deemed to not be needed, I think the user should fix that in JBS rather than through a Skara command. >> >> I think this needs some discussion and input from more people. > > I read up more on the history here. The /csr command can be invoked prior to creating a CSR issue in JBS, so it still makes sense to have the command. Given this, then invoking "/csr unneeded" can happen in two different scenarios: > > 1. No CSR has been filed yet, then just remove the csr label > 2. A CSR is linked in JBS, in this case the CSRBot will likely automatically add the label again > > I still don't think it makes sense to have this command go and change things in JBS. In case 2, a better cause of action would be to tell the user in an error reply that a CSR already exists and needs to be closed/removed first. I revised the logic of the command `/csr unneeded` according to your comments below. ------------- PR: https://git.openjdk.java.net/skara/pull/1245 From gli at openjdk.java.net Thu Nov 25 04:25:44 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Thu, 25 Nov 2021 04:25:44 GMT Subject: RFR: 1071: auto-set `/csr` flag from JBS state In-Reply-To: References: Message-ID: On Wed, 24 Nov 2021 19:34:36 GMT, Kevin Rushforth wrote: >> Hi all, >> >> Currently, the author of the PR or a reviewer could type `/csr` in the comment to direct the need of the CSR. >> It is good for the bot to automatically scan the `scr for` link and set the `csr` label for the PR. >> >> This patch adds the automatically scanning feature. And the corresponding tests are added. >> >> Thanks for taking the time to review. >> >> Best Regards, >> -- Guoxiong > > Yes, this seems good. @kevinrushforth @erikj79 Thanks for the reviews and comments. I updated the code just now. ------------- PR: https://git.openjdk.java.net/skara/pull/1245 From gli at openjdk.java.net Fri Nov 26 14:54:45 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Fri, 26 Nov 2021 14:54:45 GMT Subject: RFR: 286: Add a link to CSR in the PR's first comment [v5] In-Reply-To: References: Message-ID: > 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 Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: Reduce nested 'if' statement and reduce the number of iterations ------------- Changes: - all: https://git.openjdk.java.net/skara/pull/1244/files - new: https://git.openjdk.java.net/skara/pull/1244/files/19521b67..575de407 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=skara&pr=1244&range=04 - incr: https://webrevs.openjdk.java.net/?repo=skara&pr=1244&range=03-04 Stats: 18 lines in 1 file changed: 4 ins; 0 del; 14 mod Patch: https://git.openjdk.java.net/skara/pull/1244.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1244/head:pull/1244 PR: https://git.openjdk.java.net/skara/pull/1244 From gli at openjdk.java.net Fri Nov 26 14:54:45 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Fri, 26 Nov 2021 14:54:45 GMT Subject: RFR: 286: Add a link to CSR in the PR's first comment [v4] In-Reply-To: References: Message-ID: <85CSqliTRyOKLjtgaSmD253XjtJEM57UxSvSm2MsYVc=.fd238d64-ba07-4e4c-a8c8-b23bc702ba57@github.com> On Wed, 24 Nov 2021 16:16:06 GMT, Guoxiong Li wrote: >> 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 > > Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: > > Add logging. I updated the code to reduce the nested `if` statements and reduce the number of iterations in `for` statement. ------------- PR: https://git.openjdk.java.net/skara/pull/1244 From gli at openjdk.java.net Fri Nov 26 15:31:48 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Fri, 26 Nov 2021 15:31:48 GMT Subject: RFR: 1071: auto-set `/csr` flag from JBS state [v3] In-Reply-To: References: Message-ID: > Hi all, > > Currently, the author of the PR or a reviewer could type `/csr` in the comment to direct the need of the CSR. > It is good for the bot to automatically scan the `scr for` link and set the `csr` label for the PR. > > This patch adds the automatically scanning feature. And the corresponding tests are added. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: Refactor the code to reduce nested statements. ------------- Changes: - all: https://git.openjdk.java.net/skara/pull/1245/files - new: https://git.openjdk.java.net/skara/pull/1245/files/d36ec3a5..a725ac5f Webrevs: - full: https://webrevs.openjdk.java.net/?repo=skara&pr=1245&range=02 - incr: https://webrevs.openjdk.java.net/?repo=skara&pr=1245&range=01-02 Stats: 66 lines in 1 file changed: 35 ins; 15 del; 16 mod Patch: https://git.openjdk.java.net/skara/pull/1245.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1245/head:pull/1245 PR: https://git.openjdk.java.net/skara/pull/1245 From gli at openjdk.java.net Fri Nov 26 15:31:49 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Fri, 26 Nov 2021 15:31:49 GMT Subject: RFR: 1071: auto-set `/csr` flag from JBS state [v2] In-Reply-To: References: Message-ID: On Thu, 25 Nov 2021 04:13:23 GMT, Guoxiong Li wrote: >> Hi all, >> >> Currently, the author of the PR or a reviewer could type `/csr` in the comment to direct the need of the CSR. >> It is good for the bot to automatically scan the `scr for` link and set the `csr` label for the PR. >> >> This patch adds the automatically scanning feature. And the corresponding tests are added. >> >> Thanks for taking the time to review. >> >> Best Regards, >> -- Guoxiong > > Guoxiong Li has updated the pull request incrementally with three additional commits since the last revision: > > - Revise the logic of the command '/csr unneeded' > - Fix the tests. > - Revise logging. I refactor the code to reduce the nested statements. ------------- PR: https://git.openjdk.java.net/skara/pull/1245 From gli at openjdk.java.net Fri Nov 26 15:38:19 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Fri, 26 Nov 2021 15:38:19 GMT Subject: RFR: 286: Add a link to CSR in the PR's first comment [v6] In-Reply-To: References: Message-ID: <0xnd0wOUR_4kbi1Ov8fouj1jIjgkJj3DfQRKbp_Ulr0=.d4ac9a03-d1c0-49a1-85b0-07afad4d63dd@github.com> > 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 Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: Polish ------------- Changes: - all: https://git.openjdk.java.net/skara/pull/1244/files - new: https://git.openjdk.java.net/skara/pull/1244/files/575de407..c8670301 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=skara&pr=1244&range=05 - incr: https://webrevs.openjdk.java.net/?repo=skara&pr=1244&range=04-05 Stats: 9 lines in 1 file changed: 3 ins; 3 del; 3 mod Patch: https://git.openjdk.java.net/skara/pull/1244.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1244/head:pull/1244 PR: https://git.openjdk.java.net/skara/pull/1244 From gli at openjdk.java.net Sat Nov 27 13:58:09 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Sat, 27 Nov 2021 13:58:09 GMT Subject: RFR: 1254: Add a checkbox for CSR requirement Message-ID: Hi all, This patch adds a checkbox for CSR requirement in the `Progress` and adds the corresponding test cases. Thanks for taking the time to review. Best Regards, -- Guoxiong ------------- Commit messages: - 1254: Add a checkbox for CSR requirement Changes: https://git.openjdk.java.net/skara/pull/1246/files Webrev: https://webrevs.openjdk.java.net/?repo=skara&pr=1246&range=00 Issue: https://bugs.openjdk.java.net/browse/SKARA-1254 Stats: 29 lines in 2 files changed: 20 ins; 1 del; 8 mod Patch: https://git.openjdk.java.net/skara/pull/1246.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1246/head:pull/1246 PR: https://git.openjdk.java.net/skara/pull/1246 From gli at openjdk.java.net Sat Nov 27 14:16:24 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Sat, 27 Nov 2021 14:16:24 GMT Subject: RFR: 1071: auto-set `/csr` flag from JBS state [v4] In-Reply-To: References: Message-ID: > Hi all, > > Currently, the author of the PR or a reviewer could type `/csr` in the comment to direct the need of the CSR. > It is good for the bot to automatically scan the `scr for` link and set the `csr` label for the PR. > > This patch adds the automatically scanning feature. And the corresponding tests are added. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: Avoid the bot adding the CSR label again. ------------- Changes: - all: https://git.openjdk.java.net/skara/pull/1245/files - new: https://git.openjdk.java.net/skara/pull/1245/files/a725ac5f..37573bdd Webrevs: - full: https://webrevs.openjdk.java.net/?repo=skara&pr=1245&range=03 - incr: https://webrevs.openjdk.java.net/?repo=skara&pr=1245&range=02-03 Stats: 7 lines in 1 file changed: 6 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/skara/pull/1245.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1245/head:pull/1245 PR: https://git.openjdk.java.net/skara/pull/1245 From erikj at openjdk.java.net Mon Nov 29 15:01:29 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Mon, 29 Nov 2021 15:01:29 GMT Subject: RFR: 286: Add a link to CSR in the PR's first comment [v6] In-Reply-To: <0xnd0wOUR_4kbi1Ov8fouj1jIjgkJj3DfQRKbp_Ulr0=.d4ac9a03-d1c0-49a1-85b0-07afad4d63dd@github.com> References: <0xnd0wOUR_4kbi1Ov8fouj1jIjgkJj3DfQRKbp_Ulr0=.d4ac9a03-d1c0-49a1-85b0-07afad4d63dd@github.com> Message-ID: On Fri, 26 Nov 2021 15:38:19 GMT, Guoxiong Li wrote: >> 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 > > Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: > > Polish I can sponsor this. ------------- Marked as reviewed by erikj (Lead). PR: https://git.openjdk.java.net/skara/pull/1244 From gli at openjdk.java.net Mon Nov 29 15:01:30 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Mon, 29 Nov 2021 15:01:30 GMT Subject: Integrated: 286: Add a link to CSR in the PR's first comment In-Reply-To: References: Message-ID: On Tue, 23 Nov 2021 17:39:47 GMT, Guoxiong Li wrote: > 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 This pull request has now been integrated. Changeset: 43aedeb9 Author: Guoxiong Li Committer: Erik Joelsson URL: https://git.openjdk.java.net/skara/commit/43aedeb9d06d8d4a24905533ed2b8b86b86f8adc Stats: 86 lines in 2 files changed: 83 ins; 0 del; 3 mod 286: Add a link to CSR in the PR's first comment Reviewed-by: ihse, erikj ------------- PR: https://git.openjdk.java.net/skara/pull/1244 From erikj at openjdk.java.net Mon Nov 29 15:09:00 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Mon, 29 Nov 2021 15:09:00 GMT Subject: RFR: 1071: auto-set `/csr` flag from JBS state [v4] In-Reply-To: References: Message-ID: On Sat, 27 Nov 2021 14:16:24 GMT, Guoxiong Li wrote: >> Hi all, >> >> Currently, the author of the PR or a reviewer could type `/csr` in the comment to direct the need of the CSR. >> It is good for the bot to automatically scan the `scr for` link and set the `csr` label for the PR. >> >> This patch adds the automatically scanning feature. And the corresponding tests are added. >> >> Thanks for taking the time to review. >> >> Best Regards, >> -- Guoxiong > > Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: > > Avoid the bot adding the CSR label again. bots/csr/src/main/java/org/openjdk/skara/bots/csr/CSRBot.java line 131: > 129: // a Reviewer had requested and integrate it without satisfying that requirement. > 130: log.info("CSR closed and withdrawn for " + describe(pr) + ", not removing CSR label"); > 131: } else if (!pr.labelNames().contains(CSR_LABEL)) { I'm not sure about this case. For this to realistically happen, a CSR would have been filed and withdrawn before the PR was created. I don't think we should automatically add the label in this situation. @kevinrushforth what do you think? If the label is already there, then we should certainly leave it there however. ------------- PR: https://git.openjdk.java.net/skara/pull/1245 From kcr at openjdk.java.net Mon Nov 29 15:15:27 2021 From: kcr at openjdk.java.net (Kevin Rushforth) Date: Mon, 29 Nov 2021 15:15:27 GMT Subject: RFR: 1071: auto-set `/csr` flag from JBS state [v4] In-Reply-To: References: Message-ID: On Mon, 29 Nov 2021 15:06:16 GMT, Erik Joelsson wrote: >> Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: >> >> Avoid the bot adding the CSR label again. > > bots/csr/src/main/java/org/openjdk/skara/bots/csr/CSRBot.java line 131: > >> 129: // a Reviewer had requested and integrate it without satisfying that requirement. >> 130: log.info("CSR closed and withdrawn for " + describe(pr) + ", not removing CSR label"); >> 131: } else if (!pr.labelNames().contains(CSR_LABEL)) { > > I'm not sure about this case. For this to realistically happen, a CSR would have been filed and withdrawn before the PR was created. I don't think we should automatically add the label in this situation. @kevinrushforth what do you think? > > If the label is already there, then we should certainly leave it there however. I agree that we need not (should not) add a label in this case. I also agree that if there is a label we must leave it. This will handle the case where a PR author thinks a CSR might be needed, creates a CSR, withdraws it, creates the PR, and then later a Reviewer indicates that a CSR is needed. In that case, the bot should add the label and not auto-remove it. ------------- PR: https://git.openjdk.java.net/skara/pull/1245 From erikj at openjdk.java.net Mon Nov 29 15:28:11 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Mon, 29 Nov 2021 15:28:11 GMT Subject: RFR: 1254: Add a checkbox for CSR requirement In-Reply-To: References: Message-ID: On Sat, 27 Nov 2021 13:54:51 GMT, Guoxiong Li wrote: > Hi all, > > This patch adds a checkbox for CSR requirement in the `Progress` and adds the corresponding test cases. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong bots/pr/src/main/java/org/openjdk/skara/bots/pr/CheckRun.java line 176: > 174: ret.put("Change requires a CSR request to be approved", false); > 175: } else { > 176: ret.put("Change doesn't require a CSR request or the CSR request has been approved", true); I don't think we should show anything here if a CSR was never requested. The difference between "CSR was never requested" and "CSR is approved" isn't really tracked currently, so that would be tricky. I'm guessing this is a big reason why the original implementation didn't add checkboxes, but only a blocker message when active. For this to work we will need to add some state that tracks if a CSR is currently required. We basically have 3 states: 1. No CSR needed 2. CSR needed and not yet approved 3. CSR needed and approved Every PR starts in state 1. To get to state 2, you can either issue the /csr command, or with SKARA-1071 file a CSR and let Skara find it. To get to state 3, the CSR must be approved. At any time, the command "/csr unneeded" can take you back to state 1. This could be implemented with another label, or it could rely on special comments with markers. In this case, I think we want to make it visible to users, so labels probably make more sense. For backwards compatibility, to keep the current meaning of the "csr" label, the new label would need to be something like "csr-approved" and be added at the same time the csr label is removed when moving to state 3. ------------- PR: https://git.openjdk.java.net/skara/pull/1246 From gli at openjdk.java.net Mon Nov 29 15:42:07 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Mon, 29 Nov 2021 15:42:07 GMT Subject: RFR: 1071: auto-set `/csr` flag from JBS state [v4] In-Reply-To: References: Message-ID: On Mon, 29 Nov 2021 15:06:16 GMT, Erik Joelsson wrote: >> Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: >> >> Avoid the bot adding the CSR label again. > > bots/csr/src/main/java/org/openjdk/skara/bots/csr/CSRBot.java line 131: > >> 129: // a Reviewer had requested and integrate it without satisfying that requirement. >> 130: log.info("CSR closed and withdrawn for " + describe(pr) + ", not removing CSR label"); >> 131: } else if (!pr.labelNames().contains(CSR_LABEL)) { > > I'm not sure about this case. For this to realistically happen, a CSR would have been filed and withdrawn before the PR was created. I don't think we should automatically add the label in this situation. @kevinrushforth what do you think? > > If the label is already there, then we should certainly leave it there however. @erikj79 @kevinrushforth Thanks for the comments. It seems that my current code meets your comments. Did I misunderstand anything? Please see the code below. When the CSR has been withdrawn, the bot only prints the information and doesn't add the csr label automatically. if (!name.asString().equals("Approved")) { if (name.asString().equals("Withdrawn")) { log.info("CSR closed and withdrawn for " + describe(pr) + ", not removing CSR label"); // <----here } else if (!pr.labelNames().contains(CSR_LABEL)) { log.info("CSR issue resolution is not 'Approved' for " + describe(pr) + ", adding the CSR label"); pr.addLabel(CSR_LABEL); } else { log.info("CSR issue resolution is not 'Approved' for " + describe(pr) + ", not removing the CSR label"); } continue; } Maybe I should change the output message from `"CSR closed and withdrawn for " + describe(pr) + ", not removing CSR label"` to `"CSR closed and withdrawn for " + describe(pr) + ", not revising (not adding or not removing) CSR label"`. ------------- PR: https://git.openjdk.java.net/skara/pull/1245 From erikj at openjdk.java.net Mon Nov 29 15:50:48 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Mon, 29 Nov 2021 15:50:48 GMT Subject: RFR: 1071: auto-set `/csr` flag from JBS state [v4] In-Reply-To: References: Message-ID: On Sat, 27 Nov 2021 14:16:24 GMT, Guoxiong Li wrote: >> Hi all, >> >> Currently, the author of the PR or a reviewer could type `/csr` in the comment to direct the need of the CSR. >> It is good for the bot to automatically scan the `scr for` link and set the `csr` label for the PR. >> >> This patch adds the automatically scanning feature. And the corresponding tests are added. >> >> Thanks for taking the time to review. >> >> Best Regards, >> -- Guoxiong > > Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: > > Avoid the bot adding the CSR label again. Marked as reviewed by erikj (Lead). ------------- PR: https://git.openjdk.java.net/skara/pull/1245 From erikj at openjdk.java.net Mon Nov 29 15:50:49 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Mon, 29 Nov 2021 15:50:49 GMT Subject: RFR: 1071: auto-set `/csr` flag from JBS state [v4] In-Reply-To: References: Message-ID: On Mon, 29 Nov 2021 15:39:35 GMT, Guoxiong Li wrote: >> bots/csr/src/main/java/org/openjdk/skara/bots/csr/CSRBot.java line 131: >> >>> 129: // a Reviewer had requested and integrate it without satisfying that requirement. >>> 130: log.info("CSR closed and withdrawn for " + describe(pr) + ", not removing CSR label"); >>> 131: } else if (!pr.labelNames().contains(CSR_LABEL)) { >> >> I'm not sure about this case. For this to realistically happen, a CSR would have been filed and withdrawn before the PR was created. I don't think we should automatically add the label in this situation. @kevinrushforth what do you think? >> >> If the label is already there, then we should certainly leave it there however. > > @erikj79 @kevinrushforth Thanks for the comments. It seems that my current code meets your comments. Did I misunderstand anything? > > Please see the code below. When the CSR has been withdrawn, the bot only prints the information and doesn't add the csr label automatically. > > > if (!name.asString().equals("Approved")) { > if (name.asString().equals("Withdrawn")) { > log.info("CSR closed and withdrawn for " + describe(pr) + ", not removing CSR label"); // <----here > } else if (!pr.labelNames().contains(CSR_LABEL)) { > log.info("CSR issue resolution is not 'Approved' for " + describe(pr) + ", adding the CSR label"); > pr.addLabel(CSR_LABEL); > } else { > log.info("CSR issue resolution is not 'Approved' for " + describe(pr) + ", not removing the CSR label"); > } > continue; > } > > > > Maybe I should change the output message from `"CSR closed and withdrawn for " + describe(pr) + ", not removing CSR label"` to `"CSR closed and withdrawn for " + describe(pr) + ", not revising (not adding or not removing) CSR label"`. You are right, I misread your code. ------------- PR: https://git.openjdk.java.net/skara/pull/1245 From gli at openjdk.java.net Mon Nov 29 16:25:23 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Mon, 29 Nov 2021 16:25:23 GMT Subject: RFR: 1254: Add a checkbox for CSR requirement In-Reply-To: References: Message-ID: On Mon, 29 Nov 2021 15:25:31 GMT, Erik Joelsson wrote: >> Hi all, >> >> This patch adds a checkbox for CSR requirement in the `Progress` and adds the corresponding test cases. >> >> Thanks for taking the time to review. >> >> Best Regards, >> -- Guoxiong > > bots/pr/src/main/java/org/openjdk/skara/bots/pr/CheckRun.java line 176: > >> 174: ret.put("Change requires a CSR request to be approved", false); >> 175: } else { >> 176: ret.put("Change doesn't require a CSR request or the CSR request has been approved", true); > > I don't think we should show anything here if a CSR was never requested. The difference between "CSR was never requested" and "CSR is approved" isn't really tracked currently, so that would be tricky. I'm guessing this is a big reason why the original implementation didn't add checkboxes, but only a blocker message when active. For this to work we will need to add some state that tracks if a CSR is currently required. We basically have 3 states: > > 1. No CSR needed > 2. CSR needed and not yet approved > 3. CSR needed and approved > > Every PR starts in state 1. To get to state 2, you can either issue the /csr command, or with SKARA-1071 file a CSR and let Skara find it. To get to state 3, the CSR must be approved. At any time, the command "/csr unneeded" can take you back to state 1. > > This could be implemented with another label, or it could rely on special comments with markers. In this case, I think we want to make it visible to users, so labels probably make more sense. For backwards compatibility, to keep the current meaning of the "csr" label, the new label would need to be something like "csr-approved" and be added at the same time the csr label is removed when moving to state 3. @erikj79 The three states you mentioned above is clear. From your comment, I conclude the following things: 1. No CSR needed: the PR doesn't have `csr` and `csr-approved` labels. 2. CSR needed and not yet approved: the PR has `csr` label and doesn't have `csr-approved` label. 3. CSR needed and approved: the PR has `csr-approved` label and doesn't have `csr` label. And the `csr` label and `csr-approved` label can't appear at the same time. But currently, the CSRBot and CSRCommand have the following logic: 1. No CSR needed: the PR doesn't have `csr` label and the csr issue doesn't exist or has been withdrawn. 2. CSR needed and not yet approved: the PR has `csr` label. 3. CSR needed and approved: the PR doesn't have `csr` label and the csr issue has been Approved. If we obey the new logic and create the new label `csr-approved`, some checks can be achieved easily. But the logic change may cause the unexpected regression. As you can see the discussion in the [PR-1245](https://github.com/openjdk/skara/pull/1245) of the SKARA-1071, both the authors of the patch and the reviewers need to be very careful to avoid the misunderstanding and avoid making a mistake. So I would like to obey the origin logic. In this patch, I can check the csr link and issue to identify the state 1 and state 3 which is like the CSRBot and CSRCommand. So we don't need to add another label such as `csr-approved` to solve this problem. What is your opinion about this? --- And a related thing: There are many places which need to get the csr issue from the original issue. We should provide a common method to solve this common problem. So I filed [SKARA-1256](https://bugs.openjdk.java.net/browse/SKARA-1256) to solve it. ------------- PR: https://git.openjdk.java.net/skara/pull/1246 From gli at openjdk.java.net Mon Nov 29 16:26:31 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Mon, 29 Nov 2021 16:26:31 GMT Subject: RFR: 1071: auto-set `/csr` flag from JBS state In-Reply-To: References: <9ib5ZucxGm-g3iwkfQnZKrjRmMyzOBAOLk7YvHANYkA=.987c2e43-e3d5-458c-8e15-95a413bf9a5e@github.com> Message-ID: On Wed, 24 Nov 2021 19:31:57 GMT, Erik Joelsson wrote: >> Yes there is a closed "Withdrawn" state, but I would probably prefer a Reviewer to issue the `/csr unneeded` in that case. Otherwise, A PR author with the role of Committer could withdraw a CSR that a Reviewer had requested and integrate it without satisfying that requirement. > >> Yes there is a closed "Withdrawn" state, but I would probably prefer a Reviewer to issue the `/csr unneeded` in that case. Otherwise, A PR author with the role of Committer could withdraw a CSR that a Reviewer had requested and integrate it without satisfying that requirement. > > Yes, that sounds good. What I'm mostly after is what conditions need to be met for the `/csr unneeded` command to succeed. Given this, there are two situations where it should succeed: > > 1. No CSR issue exists. > 2. A CSR issue exists but has been withdrawn. > > If neither of those two are true, then issuing `/csr unneeded` should result in an error explaining that a CSR has already been filed and will need to be withdrawn first. @erikj79 Thanks for the review. Could I get your help to sponsor this patch? ------------- PR: https://git.openjdk.java.net/skara/pull/1245 From gli at openjdk.java.net Mon Nov 29 17:20:38 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Mon, 29 Nov 2021 17:20:38 GMT Subject: RFR: 1071: auto-set `/csr` flag from JBS state [v5] In-Reply-To: References: Message-ID: > Hi all, > > Currently, the author of the PR or a reviewer could type `/csr` in the comment to direct the need of the CSR. > It is good for the bot to automatically scan the `scr for` link and set the `csr` label for the PR. > > This patch adds the automatically scanning feature. And the corresponding tests are added. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: Fix logging. ------------- Changes: - all: https://git.openjdk.java.net/skara/pull/1245/files - new: https://git.openjdk.java.net/skara/pull/1245/files/37573bdd..079786b8 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=skara&pr=1245&range=04 - incr: https://webrevs.openjdk.java.net/?repo=skara&pr=1245&range=03-04 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.java.net/skara/pull/1245.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1245/head:pull/1245 PR: https://git.openjdk.java.net/skara/pull/1245 From erikj at openjdk.java.net Mon Nov 29 18:05:30 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Mon, 29 Nov 2021 18:05:30 GMT Subject: RFR: 1254: Add a checkbox for CSR requirement In-Reply-To: References: Message-ID: <1QtouCXVFGFNj1lrGb0036EbPmVOgrtH8iJJ1_cpjYI=.fb32f6af-cc0f-4939-b9f0-f22ed91e70c9@github.com> On Mon, 29 Nov 2021 16:22:53 GMT, Guoxiong Li wrote: >> bots/pr/src/main/java/org/openjdk/skara/bots/pr/CheckRun.java line 176: >> >>> 174: ret.put("Change requires a CSR request to be approved", false); >>> 175: } else { >>> 176: ret.put("Change doesn't require a CSR request or the CSR request has been approved", true); >> >> I don't think we should show anything here if a CSR was never requested. The difference between "CSR was never requested" and "CSR is approved" isn't really tracked currently, so that would be tricky. I'm guessing this is a big reason why the original implementation didn't add checkboxes, but only a blocker message when active. For this to work we will need to add some state that tracks if a CSR is currently required. We basically have 3 states: >> >> 1. No CSR needed >> 2. CSR needed and not yet approved >> 3. CSR needed and approved >> >> Every PR starts in state 1. To get to state 2, you can either issue the /csr command, or with SKARA-1071 file a CSR and let Skara find it. To get to state 3, the CSR must be approved. At any time, the command "/csr unneeded" can take you back to state 1. >> >> This could be implemented with another label, or it could rely on special comments with markers. In this case, I think we want to make it visible to users, so labels probably make more sense. For backwards compatibility, to keep the current meaning of the "csr" label, the new label would need to be something like "csr-approved" and be added at the same time the csr label is removed when moving to state 3. > > @erikj79 The three states you mentioned above is clear. From your comment, I conclude the following things: > > 1. No CSR needed: the PR doesn't have `csr` and `csr-approved` labels. > 2. CSR needed and not yet approved: the PR has `csr` label and doesn't have `csr-approved` label. > 3. CSR needed and approved: the PR has `csr-approved` label and doesn't have `csr` label. > > And the `csr` label and `csr-approved` label can't appear at the same time. > > But currently, the CSRBot and CSRCommand have the following logic: > > 1. No CSR needed: the PR doesn't have `csr` label and the csr issue doesn't exist or has been withdrawn. > 2. CSR needed and not yet approved: the PR has `csr` label. > 3. CSR needed and approved: the PR doesn't have `csr` label and the csr issue has been Approved. > > If we obey the new logic and create the new label `csr-approved`, some checks can be achieved easily. But the logic change may cause the unexpected regression. As you can see the discussion in the [PR-1245](https://github.com/openjdk/skara/pull/1245) of the SKARA-1071, both the authors of the patch and the reviewers need to be very careful to avoid the misunderstanding and avoid making a mistake. > > So I would like to obey the origin logic. In this patch, I can check the csr link and issue to identify the state 1 and state 3 which is like the CSRBot and CSRCommand. So we don't need to add another label such as `csr-approved` to solve this problem. What is your opinion about this? > > --- > And a related thing: > There are many places which need to get the csr issue from the original issue. We should provide a common method to solve this common problem. So I filed [SKARA-1256](https://bugs.openjdk.java.net/browse/SKARA-1256) to solve it. I needed to think about this for a bit, but I think you are right. I was instinctively trying to keep the PR bot from having to query JBS for CSR status, because we currently have a label which made checking the CSR state very cheap and obvious. But on the other hand, we are fetching the issue from JBS anyway during every CheckRun, so adding this extra step isn't that expensive. ------------- PR: https://git.openjdk.java.net/skara/pull/1246 From gli at openjdk.java.net Mon Nov 29 18:08:24 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Mon, 29 Nov 2021 18:08:24 GMT Subject: Integrated: 1071: auto-set `/csr` flag from JBS state In-Reply-To: References: Message-ID: On Wed, 24 Nov 2021 15:57:55 GMT, Guoxiong Li wrote: > Hi all, > > Currently, the author of the PR or a reviewer could type `/csr` in the comment to direct the need of the CSR. > It is good for the bot to automatically scan the `scr for` link and set the `csr` label for the PR. > > This patch adds the automatically scanning feature. And the corresponding tests are added. > > Thanks for taking the time to review. > > Best Regards, > -- Guoxiong This pull request has now been integrated. Changeset: eeb588f1 Author: Guoxiong Li Committer: Erik Joelsson URL: https://git.openjdk.java.net/skara/commit/eeb588f1b9d6e4d81973a0a3a2d7df0301ef2fcf Stats: 173 lines in 4 files changed: 141 ins; 13 del; 19 mod 1071: auto-set `/csr` flag from JBS state Reviewed-by: erikj ------------- PR: https://git.openjdk.java.net/skara/pull/1245 From gli at openjdk.java.net Tue Nov 30 11:46:37 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Tue, 30 Nov 2021 11:46:37 GMT Subject: RFR: 1236: Add jcheck option to check for large binary files Message-ID: Hi all, This patch adds the large binary file check to the jcheck. The corresponding configuration is like the following code. Each key/value in the `[checks "binary"]` is a mapper. The `key` means the file pattern and the `value` means the limited file size. For example, `.*\.bin=1b` means the file which ends with `.bin` should not exceed 200 Bytes. [checks] error = binary [checks "binary"] .*.bin=200B .*.o=1k The limited file size can use one of these several units: b(Byte), kb(KiloByte), mb(MegaByte), gb(GigaByte). The units is case insensitive, which means the `Kb`, `kB` and `KB` are equals to `kb(KiloByte)`. If the unit is not provided, it defauts to `b(Byte)`. And these is no a unit called `bit`. The corresponding test cases are added. Best Regards, -- Guoxiong ------------- Commit messages: - Cann't assert the file size directly. - Fix NPE. - 1236: Add jcheck option to check for large binary files Changes: https://git.openjdk.java.net/skara/pull/1247/files Webrev: https://webrevs.openjdk.java.net/?repo=skara&pr=1247&range=00 Issue: https://bugs.openjdk.java.net/browse/SKARA-1236 Stats: 420 lines in 13 files changed: 338 ins; 44 del; 38 mod Patch: https://git.openjdk.java.net/skara/pull/1247.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1247/head:pull/1247 PR: https://git.openjdk.java.net/skara/pull/1247 From kcr at openjdk.java.net Tue Nov 30 13:11:52 2021 From: kcr at openjdk.java.net (Kevin Rushforth) Date: Tue, 30 Nov 2021 13:11:52 GMT Subject: RFR: 1236: Add jcheck option to check for large binary files In-Reply-To: References: Message-ID: On Tue, 30 Nov 2021 11:42:56 GMT, Guoxiong Li wrote: > Hi all, > > This patch adds the large binary file check to the jcheck. > > The corresponding configuration is like the following code. Each key/value in the `[checks "binary"]` is a mapper. The `key` means the file pattern and the `value` means the limited file size. For example, `.*\.bin=1b` means the file which ends with `.bin` should not exceed 200 Bytes. > > > [checks] > error = binary > > [checks "binary"] > .*.bin=200B > .*.o=1k > > > The limited file size can use one of these several units: b(Byte), kb(KiloByte), mb(MegaByte), gb(GigaByte). The units is case insensitive, which means the `Kb`, `kB` and `KB` are equals to `kb(KiloByte)`. If the unit is not provided, it defauts to `b(Byte)`. And these is no a unit called `bit`. > > The corresponding test cases are added. > > Best Regards, > -- Guoxiong I would rather see two separate parameters, a size and a list of files (with regex support, like we have for the whitespace check), so that we don't have to repeat the size. We don't need the flexibility to set the limit per-extension. ------------- PR: https://git.openjdk.java.net/skara/pull/1247 From gli at openjdk.java.net Tue Nov 30 13:29:41 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Tue, 30 Nov 2021 13:29:41 GMT Subject: RFR: 1256: Provide a common method to get the corresponding csr issue Message-ID: Hi all, This patch adds the common methods `Issue#linksWithRelationships`, `Issue#csrLink` and `Issue#csrIssue` and refactors the code to reduce the loop nested statements by using these common methods. All the existing tests passed. Best Regards, -- Guoxiong ------------- Commit messages: - 1256: Provide a common method to get the corresponding csr issue Changes: https://git.openjdk.java.net/skara/pull/1248/files Webrev: https://webrevs.openjdk.java.net/?repo=skara&pr=1248&range=00 Issue: https://bugs.openjdk.java.net/browse/SKARA-1256 Stats: 265 lines in 8 files changed: 140 ins; 69 del; 56 mod Patch: https://git.openjdk.java.net/skara/pull/1248.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1248/head:pull/1248 PR: https://git.openjdk.java.net/skara/pull/1248 From kcr at openjdk.java.net Tue Nov 30 13:41:05 2021 From: kcr at openjdk.java.net (Kevin Rushforth) Date: Tue, 30 Nov 2021 13:41:05 GMT Subject: RFR: 1236: Add jcheck option to check for large binary files In-Reply-To: References: Message-ID: On Tue, 30 Nov 2021 11:42:56 GMT, Guoxiong Li wrote: > Hi all, > > This patch adds the large binary file check to the jcheck. > > The corresponding configuration is like the following code. Each key/value in the `[checks "binary"]` is a mapper. The `key` means the file pattern and the `value` means the limited file size. For example, `.*\.bin=1b` means the file which ends with `.bin` should not exceed 200 Bytes. > > > [checks] > error = binary > > [checks "binary"] > .*.bin=200B > .*.o=1k > > > The limited file size can use one of these several units: b(Byte), kb(KiloByte), mb(MegaByte), gb(GigaByte). The units is case insensitive, which means the `Kb`, `kB` and `KB` are equals to `kb(KiloByte)`. If the unit is not provided, it defauts to `b(Byte)`. And these is no a unit called `bit`. > > The corresponding test cases are added. > > Best Regards, > -- Guoxiong Oops. I added the `/csr` label by mistake (although I think it's a no-op for this repo). ------------- PR: https://git.openjdk.java.net/skara/pull/1247 From gli at openjdk.java.net Tue Nov 30 13:59:51 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Tue, 30 Nov 2021 13:59:51 GMT Subject: RFR: 1236: Add jcheck option to check for large binary files In-Reply-To: References: Message-ID: On Tue, 30 Nov 2021 13:09:17 GMT, Kevin Rushforth wrote: > I would rather see two separate parameters, a size and a list of files (with regex support, like we have for the whitespace check), so that we don't have to repeat the size. We don't need the flexibility to set the limit per-extension. This binary file check is not much like the whitespace check. The different file types have different basic sizes. The image type may be 500B-4kB and the audio type may be 2kB-32kB. So we can set the config as the following: [checks] error = binary [checks "binary"] ; the image type .*.jpg|.*.png|.*.gif=5k ; the audio type .*.wav|.*.mp3=40k If we have the only limited size as 40k, it is too large for the image type. If we have the only limited size as 5k, it is too small for the audio type. The demo above only consider two file types. The other types, such as video type and so on, have the same issue we need to solve. So I think the configuration in this patch is more flexible than the whitespache check and can meet the requirements of our repositories. ------------- PR: https://git.openjdk.java.net/skara/pull/1247 From erikj at openjdk.java.net Tue Nov 30 14:52:07 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Tue, 30 Nov 2021 14:52:07 GMT Subject: RFR: 1256: Provide a common method to get the corresponding csr issue In-Reply-To: References: Message-ID: <9rZCBZyPbcZELHz-wrPa8Wi51WU_YdSa1tWVMI0c2MQ=.6dc83a7b-cb6a-4bdc-b49c-93174024ecde@github.com> On Tue, 30 Nov 2021 13:26:12 GMT, Guoxiong Li wrote: > Hi all, > > This patch adds the common methods `Issue#linksWithRelationships`, `Issue#csrLink` and `Issue#csrIssue` and refactors the code to reduce the loop nested statements by using these common methods. > > All the existing tests passed. > > Best Regards, > -- Guoxiong I'm not sure about this change. The Issue interface seems over used and already contains a bunch of methods that do not apply to several implementors. I don't like the idea of adding even more such methods. I think we need to try to extract a sub interface from Issue, which is specialized for bugtrackers or Jira or something. Not sure what to name it at this point though. All the links methods should be moved there, and methods that definitely can't return a pull request, like IssueProject::issue should return the new interface instead. This is part of what I meant with this being hard to solve properly. issuetracker/src/main/java/org/openjdk/skara/issuetracker/Issue.java line 196: > 194: * @return the related links > 195: */ > 196: default List linksWithRelationships(List relationships) { I'm not sure there will ever be a need to filter links with multiple different relationships. Do you know of any such case that you are planning to convert? The rest of this method could be converted to streams like this: return links().stream() .filter(l -> link.relationship().isPresent() && relationships.contains(link.relationship().get()) .toList(); issuetracker/src/main/java/org/openjdk/skara/issuetracker/Issue.java line 215: > 213: default Optional csrLink() { > 214: var links = linksWithRelationships(List.of("csr for")); > 215: if (links != null && !links.isEmpty()) { >From what I can tell, `links` can never be null here. I think this method could be expressed a bit more elegantly with stream usage, like this: return links.stream().findAny(); issuetracker/src/main/java/org/openjdk/skara/issuetracker/Issue.java line 228: > 226: default Optional csrIssue() { > 227: var csrLink = csrLink(); > 228: var csrIssue = Optional.empty(); This could be simplified to: return csrLink().map(Link::issue); ------------- PR: https://git.openjdk.java.net/skara/pull/1248 From gli at openjdk.java.net Tue Nov 30 15:21:45 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Tue, 30 Nov 2021 15:21:45 GMT Subject: RFR: 1256: Provide a common method to get the corresponding csr issue In-Reply-To: <9rZCBZyPbcZELHz-wrPa8Wi51WU_YdSa1tWVMI0c2MQ=.6dc83a7b-cb6a-4bdc-b49c-93174024ecde@github.com> References: <9rZCBZyPbcZELHz-wrPa8Wi51WU_YdSa1tWVMI0c2MQ=.6dc83a7b-cb6a-4bdc-b49c-93174024ecde@github.com> Message-ID: On Tue, 30 Nov 2021 14:49:27 GMT, Erik Joelsson wrote: >> Hi all, >> >> This patch adds the common methods `Issue#linksWithRelationships`, `Issue#csrLink` and `Issue#csrIssue` and refactors the code to reduce the loop nested statements by using these common methods. >> >> All the existing tests passed. >> >> Best Regards, >> -- Guoxiong > > I'm not sure about this change. The Issue interface seems over used and already contains a bunch of methods that do not apply to several implementors. I don't like the idea of adding even more such methods. > > I think we need to try to extract a sub interface from Issue, which is specialized for bugtrackers or Jira or something. Not sure what to name it at this point though. All the links methods should be moved there, and methods that definitely can't return a pull request, like IssueProject::issue should return the new interface instead. This is part of what I meant with this being hard to solve properly. @erikj79 Thanks for the comment. >From your suggestion in the code, I find that we don't need these 3 method to write the clean code. We can only use the stream api to simply the nest loop statement, which is more flexible. It seems we need a method named `linksWithRelationships`, which contains a loop statement, to find the needed links. But actually, if we use the stream api, we only need a simple invoking statement. I would like remove these three method and use the stream api to refactor the code. And this issue title may change to `Use stream api to simplify the csr issue lookup`. ------------- PR: https://git.openjdk.java.net/skara/pull/1248 From gli at openjdk.java.net Tue Nov 30 15:36:07 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Tue, 30 Nov 2021 15:36:07 GMT Subject: RFR: 1256: Provide a common method to get the corresponding csr issue In-Reply-To: References: Message-ID: <_y_PdkHzVDOHVCjo8lQDzWSBVvF9C6n-youb5N2_5Mk=.fd8262e0-f58a-473a-9da8-84aa2e7886e8@github.com> On Tue, 30 Nov 2021 13:26:12 GMT, Guoxiong Li wrote: > Hi all, > > This patch adds the common methods `Issue#linksWithRelationships`, `Issue#csrLink` and `Issue#csrIssue` and refactors the code to reduce the loop nested statements by using these common methods. > > All the existing tests passed. > > Best Regards, > -- Guoxiong > I'm not sure there will ever be a need to filter links with multiple different relationships. Do you know of any such case that you are planning to convert? It can be used in the method `Backports#findMainIssue`: // method Backports#findMainIssue var links = issue.linksWithRelationships(List.of("backported by", "backport of")); But If we use the stream api, it is not need now. ------------- PR: https://git.openjdk.java.net/skara/pull/1248 From gli at openjdk.java.net Tue Nov 30 16:07:10 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Tue, 30 Nov 2021 16:07:10 GMT Subject: RFR: 1256: Use stream api to simplify the csr issue lookup [v2] In-Reply-To: References: Message-ID: > Hi all, > > This patch adds the common methods `Issue#linksWithRelationships`, `Issue#csrLink` and `Issue#csrIssue` and refactors the code to reduce the loop nested statements by using these common methods. > > All the existing tests passed. > > Best Regards, > -- Guoxiong Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: Use stream api instead of the encapsulated method. ------------- Changes: - all: https://git.openjdk.java.net/skara/pull/1248/files - new: https://git.openjdk.java.net/skara/pull/1248/files/1118933c..2f640bd7 Webrevs: - full: https://webrevs.openjdk.java.net/?repo=skara&pr=1248&range=01 - incr: https://webrevs.openjdk.java.net/?repo=skara&pr=1248&range=00-01 Stats: 112 lines in 8 files changed: 8 ins; 89 del; 15 mod Patch: https://git.openjdk.java.net/skara/pull/1248.diff Fetch: git fetch https://git.openjdk.java.net/skara pull/1248/head:pull/1248 PR: https://git.openjdk.java.net/skara/pull/1248 From gli at openjdk.java.net Tue Nov 30 16:07:11 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Tue, 30 Nov 2021 16:07:11 GMT Subject: RFR: 1256: Use stream api to simplify the csr issue lookup [v2] In-Reply-To: <9rZCBZyPbcZELHz-wrPa8Wi51WU_YdSa1tWVMI0c2MQ=.6dc83a7b-cb6a-4bdc-b49c-93174024ecde@github.com> References: <9rZCBZyPbcZELHz-wrPa8Wi51WU_YdSa1tWVMI0c2MQ=.6dc83a7b-cb6a-4bdc-b49c-93174024ecde@github.com> Message-ID: On Tue, 30 Nov 2021 14:49:27 GMT, Erik Joelsson wrote: >> Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: >> >> Use stream api instead of the encapsulated method. > > I'm not sure about this change. The Issue interface seems over used and already contains a bunch of methods that do not apply to several implementors. I don't like the idea of adding even more such methods. > > I think we need to try to extract a sub interface from Issue, which is specialized for bugtrackers or Jira or something. Not sure what to name it at this point though. All the links methods should be moved there, and methods that definitely can't return a pull request, like IssueProject::issue should return the new interface instead. This is part of what I meant with this being hard to solve properly. @erikj79 I updated the code by using the stream api just now. ------------- PR: https://git.openjdk.java.net/skara/pull/1248 From gli at openjdk.java.net Tue Nov 30 17:14:59 2021 From: gli at openjdk.java.net (Guoxiong Li) Date: Tue, 30 Nov 2021 17:14:59 GMT Subject: RFR: 1254: Add a checkbox for CSR requirement In-Reply-To: <1QtouCXVFGFNj1lrGb0036EbPmVOgrtH8iJJ1_cpjYI=.fb32f6af-cc0f-4939-b9f0-f22ed91e70c9@github.com> References: <1QtouCXVFGFNj1lrGb0036EbPmVOgrtH8iJJ1_cpjYI=.fb32f6af-cc0f-4939-b9f0-f22ed91e70c9@github.com> Message-ID: On Mon, 29 Nov 2021 18:03:05 GMT, Erik Joelsson wrote: >> @erikj79 The three states you mentioned above is clear. From your comment, I conclude the following things: >> >> 1. No CSR needed: the PR doesn't have `csr` and `csr-approved` labels. >> 2. CSR needed and not yet approved: the PR has `csr` label and doesn't have `csr-approved` label. >> 3. CSR needed and approved: the PR has `csr-approved` label and doesn't have `csr` label. >> >> And the `csr` label and `csr-approved` label can't appear at the same time. >> >> But currently, the CSRBot and CSRCommand have the following logic: >> >> 1. No CSR needed: the PR doesn't have `csr` label and the csr issue doesn't exist or has been withdrawn. >> 2. CSR needed and not yet approved: the PR has `csr` label. >> 3. CSR needed and approved: the PR doesn't have `csr` label and the csr issue has been Approved. >> >> If we obey the new logic and create the new label `csr-approved`, some checks can be achieved easily. But the logic change may cause the unexpected regression. As you can see the discussion in the [PR-1245](https://github.com/openjdk/skara/pull/1245) of the SKARA-1071, both the authors of the patch and the reviewers need to be very careful to avoid the misunderstanding and avoid making a mistake. >> >> So I would like to obey the origin logic. In this patch, I can check the csr link and issue to identify the state 1 and state 3 which is like the CSRBot and CSRCommand. So we don't need to add another label such as `csr-approved` to solve this problem. What is your opinion about this? >> >> --- >> And a related thing: >> There are many places which need to get the csr issue from the original issue. We should provide a common method to solve this common problem. So I filed [SKARA-1256](https://bugs.openjdk.java.net/browse/SKARA-1256) to solve it. > > I needed to think about this for a bit, but I think you are right. > > I was instinctively trying to keep the PR bot from having to query JBS for CSR status, because we currently have a label which made checking the CSR state very cheap and obvious. But on the other hand, we are fetching the issue from JBS anyway during every CheckRun, so adding this extra step isn't that expensive. @erikj79 I re-think about this. Even though we decide to use the new logic and add the new label `csr-approved` at the end, we shouldn't implement the feature at this patch. Because the goal of this patch is only to add a checkbox for CSR requirement. So I advice to file a new issue to continue the discussion. The new issue title can be `Investigating to add a label 'csr-approved' to mark the CSR is approved`. Back to this patch, I think it is good to use the old logic to implement the enhancement so that the users (OpenJDK developers) can take advantage of this patch as soon as possible. ------------- PR: https://git.openjdk.java.net/skara/pull/1246 From erikj at openjdk.java.net Tue Nov 30 22:06:50 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Tue, 30 Nov 2021 22:06:50 GMT Subject: RFR: 1254: Add a checkbox for CSR requirement In-Reply-To: References: <1QtouCXVFGFNj1lrGb0036EbPmVOgrtH8iJJ1_cpjYI=.fb32f6af-cc0f-4939-b9f0-f22ed91e70c9@github.com> Message-ID: On Tue, 30 Nov 2021 17:12:26 GMT, Guoxiong Li wrote: >> I needed to think about this for a bit, but I think you are right. >> >> I was instinctively trying to keep the PR bot from having to query JBS for CSR status, because we currently have a label which made checking the CSR state very cheap and obvious. But on the other hand, we are fetching the issue from JBS anyway during every CheckRun, so adding this extra step isn't that expensive. > > @erikj79 I re-think about this. Even though we decide to use the new logic and add the new label `csr-approved` at the end, we shouldn't implement the feature at this patch. Because the goal of this patch is only to add a checkbox for CSR requirement. > > So I advice to file a new issue to continue the discussion. The new issue title can be `Investigating to add a label 'csr-approved' to mark the CSR is approved`. > > Back to this patch, I think it is good to use the old logic to implement the enhancement so that the users (OpenJDK developers) can take advantage of this patch as soon as possible. I don't think we need a new label. Your suggestion to tell state 1 and 3 apart by checking if a CSR issue exists seems good enough to me. ------------- PR: https://git.openjdk.java.net/skara/pull/1246 From erikj at openjdk.java.net Tue Nov 30 22:59:33 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Tue, 30 Nov 2021 22:59:33 GMT Subject: RFR: 1236: Add jcheck option to check for large binary files In-Reply-To: References: Message-ID: <0yXi1sLLIzWeSEP1FA5jPF_pfHB4JjNoOS-VD_E_MFM=.8783e2c8-82e7-401a-9b9c-cc1004df2a63@github.com> On Tue, 30 Nov 2021 11:42:56 GMT, Guoxiong Li wrote: > Hi all, > > This patch adds the large binary file check to the jcheck. > > The corresponding configuration is like the following code. Each key/value in the `[checks "binary"]` is a mapper. The `key` means the file pattern and the `value` means the limited file size. For example, `.*\.bin=200B` means the file which ends with `.bin` should not exceed 200 Bytes. > > > [checks] > error = binary > > [checks "binary"] > .*.bin=200B > .*.o=1k > > > The limited file size can use one of these several units: b(Byte), kb(KiloByte), mb(MegaByte), gb(GigaByte). The units is case insensitive, which means the `Kb`, `kB` and `KB` are equals to `kb(KiloByte)`. If the unit is not provided, it defauts to `b(Byte)`. And these is no a unit called `bit`. > > The corresponding test cases are added. > > Best Regards, > -- Guoxiong First, thank you for taking on this issue! I agree with Kevin, I don't think we have any need for configuring different file types having different size requirements. I think that it's neat to support it, but we just wouldn't use it for any OpenJDK repo that I know of. If we remove that requirement, then there is no need to list file patterns at all, since the check only applies to binary files anyway, and Git tells us which files are binary already. It looks like you have taken the existing "binary" check and changed it to be a size check. The existing check wasn't used in the JDK repos, but I suspect someone is using it to forbid any binary files. That functionality seems to be lost with this patch. We can't change existing behavior as that would cause incompatibility with existing .jcheck/conf files. I propose the following extension to the existing "binary" check: [checks] error = binary [checks "binary"] max-size=1M The max-size parameter is optional. If not set, then the binary check works like today, triggering on any binary file, with a reasonable error message that isn't mentioning the size limit, or being too large. ------------- PR: https://git.openjdk.java.net/skara/pull/1247 From erikj at openjdk.java.net Tue Nov 30 23:06:34 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Tue, 30 Nov 2021 23:06:34 GMT Subject: RFR: 1256: Use stream api to simplify the csr issue lookup In-Reply-To: <_y_PdkHzVDOHVCjo8lQDzWSBVvF9C6n-youb5N2_5Mk=.fd8262e0-f58a-473a-9da8-84aa2e7886e8@github.com> References: <_y_PdkHzVDOHVCjo8lQDzWSBVvF9C6n-youb5N2_5Mk=.fd8262e0-f58a-473a-9da8-84aa2e7886e8@github.com> Message-ID: On Tue, 30 Nov 2021 15:33:29 GMT, Guoxiong Li wrote: > > I'm not sure there will ever be a need to filter links with multiple different relationships. Do you know of any such case that you are planning to convert? > > It can be used in the method `Backports#findMainIssue`: > > ``` > // method Backports#findMainIssue > var links = issue.linksWithRelationships(List.of("backported by", "backport of")); > ``` > > But If we use the stream api, it is not needed now. Ah, right good point. I forgot about the two variants for every link type in JBS. ------------- PR: https://git.openjdk.java.net/skara/pull/1248 From erikj at openjdk.java.net Tue Nov 30 23:24:52 2021 From: erikj at openjdk.java.net (Erik Joelsson) Date: Tue, 30 Nov 2021 23:24:52 GMT Subject: RFR: 1256: Use stream api to simplify the csr issue lookup [v2] In-Reply-To: References: Message-ID: <8OpTN3tBiODIDDN32eKNw7W7VieYJDZUJBiT0yEN7p0=.5b6906b2-67aa-4f7a-b5f1-f80277be3da0@github.com> On Tue, 30 Nov 2021 16:07:10 GMT, Guoxiong Li wrote: >> Hi all, >> >> This patch adds the common methods `Issue#linksWithRelationships`, `Issue#csrLink` and `Issue#csrIssue` and refactors the code to reduce the loop nested statements by using these common methods. >> >> All the existing tests passed. >> >> Best Regards, >> -- Guoxiong > > Guoxiong Li has updated the pull request incrementally with one additional commit since the last revision: > > Use stream api instead of the encapsulated method. I think this kind of refactoring is good enough for now. I still think the Issue interface should get refactored along the lines I described at some point, so that concepts like different types of links can be handled by a single appropriate class/interface. The clash with the other "Issue" class which represents something completely different is very unfortunate as well. bots/pr/src/main/java/org/openjdk/skara/bots/pr/CSRCommand.java line 165: > 163: } > 164: > 165: var csr = jbsIssue.get().links().stream() This particular pattern now occurs twice in this file. Perhaps worth moving to a private method at least, to reduce some duplication. bots/pr/src/main/java/org/openjdk/skara/bots/pr/CheckRun.java line 142: > 140: .filter(link -> link.relationship().isPresent() && "csr for".equals(link.relationship().get())) > 141: .findAny().flatMap(Link::issue).orElse(null); > 142: if (csr == null) { I just noticed this pattern being used a lot. Instead of .orElse(null), I would prefer if you let `csr` be an optional and used `csr.isPresent()` in the if statement. You will then need to use `csr.get()` to actually get the value, but this is safe as it's protected by the condition on isPresent(). If the variable in question is used a lot, you can choose resolve it with .get() into a new variable at the top of the if/else block. This applies to several places where the same pattern is used. ------------- PR: https://git.openjdk.java.net/skara/pull/1248