RFR: 1365: Draft PRs do not get extra time before auto closing
erikj at openjdk.java.net
Wed Mar 2 17:53:37 UTC 2022
On Wed, 2 Mar 2022 17:18:50 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:
> The PullRequestPrunerBot automatically closes PRs that have been inactive for too long. The maxAge is configurable, and we have it set to 28 days for most repos on Github. [SKARA-831](https://bugs.openjdk.java.net/browse/SKARA-831) tried to give draft PRs double the time before being auto closed. Unfortunately, that fix wasn't enough, as it only affects the printed message and not the actual age check.
> I tried to add a unit test for this, but in the end I could find no reliable way to do this. I don't want to rely on timings. And the only other thing I could think of checking was the message printed -- but that was already "correct" so it would not verify this bug anyway.
If you really want to test this, you would have to modify the bot to use an explicit Clock object to get timestamps. Then the test can inject a different Clock implementation which can be made to output customized timestamps. I've done this before to test more complicated scheduling behavior in a different project, but I'm not sure it's worth it here.
Marked as reviewed by erikj (Lead).
More information about the skara-dev