RFR: 827: Copyright year differences can be regarded as a clean backport [v2]

Erik Joelsson erikj at openjdk.org
Tue Sep 12 17:22:02 UTC 2023

On Thu, 7 Sep 2023 21:29:49 GMT, Zhao Song <zsong at openjdk.org> wrote:

>> As many users requested, when determining whether a backport is clean, our bot should ignore copyright year difference.
> Zhao Song has updated the pull request incrementally with one additional commit since the last revision:
>   update

I'm not sure about changing this code without having some kind of unit level testing for it. I'm quite surprised that we don't have any. I think we need to add basic coverage either before or with this change.

You could extract some patches from real backported commits to use for these tests.

vcs/src/main/java/org/openjdk/skara/vcs/DiffComparator.java line 70:

> 68:                 -(.)*Copyright \\(c\\) (?:\\d|\\s|,)* Oracle and/or its affiliates\\. All rights reserved\\.
> 69:                 \\+(.)*Copyright \\(c\\) (?:\\d|\\s|,)* Oracle and/or its affiliates\\. All rights reserved\\.
> 70:                 """);

This pattern should be compiled in a static variable to avoid recompiling it.


PR Review: https://git.openjdk.org/skara/pull/1556#pullrequestreview-1622754919
PR Review Comment: https://git.openjdk.org/skara/pull/1556#discussion_r1323344339

More information about the skara-dev mailing list