RFR: 8174: Check license year script may check files not changed by a PR [v2]

Brice Dutheil bdutheil at openjdk.org
Mon Feb 26 10:19:58 UTC 2024


On Mon, 12 Feb 2024 17:13:12 GMT, Alex Macdonald <aptmac at openjdk.org> wrote:

>> This short PR addresses JMC-8174 [[0]](https://bugs.openjdk.org/browse/JMC-8174), in which the check license year script may fail when checking files not modified by the PR it's running against.
>> 
>> The issue is that I originally had `origin/master` as the branch the PR would be checked against, forgetting that these checks are run on our own forks and not openjdk/jmc. As a result, if the PR owner's `origin/master` is out of date, then the check license script may incorrectly error even if the PR is okay against `upstream/master`. To amend this I've added a line that greps the result of `git remote -v` and looks for `upstream`, and if it doesn't exist then it adds a new remote and fetches it. Now we can compare the PR commits against `upstream/master`
>> 
>> [0] https://bugs.openjdk.org/browse/JMC-8174
>> 
>> Examples:
>> 
>> Current (checks out own fork of jmc): https://github.com/aptmac/jmc/actions/runs/7904023625/job/21573338057#step:2:463
>> 
>> 8174 (checks out openjdk/jmc): https://github.com/aptmac/jmc/actions/runs/7875363437/job/21487103607#step:3:5
>
> Alex Macdonald has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains one commit:
> 
>   8174: Check license year script may check files not changed by a PR

Marked as reviewed by bdutheil (Committer).

Looks good to me as well. Thanks for this !

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

PR Review: https://git.openjdk.org/jmc/pull/552#pullrequestreview-1900466610
PR Comment: https://git.openjdk.org/jmc/pull/552#issuecomment-1963766091


More information about the jmc-dev mailing list