Integrated: 8174: Check license year script may check files not changed by a PR

Alex Macdonald aptmac at openjdk.org
Mon Feb 26 15:42:51 UTC 2024


On Mon, 12 Feb 2024 16:49:56 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

This pull request has now been integrated.

Changeset: 110de067
Author:    Alex Macdonald <aptmac at openjdk.org>
URL:       https://git.openjdk.org/jmc/commit/110de0673ad794db78ad163962f33747aa20dc20
Stats:     5 lines in 1 file changed: 4 ins; 0 del; 1 mod

8174: Check license year script may check files not changed by a PR

Reviewed-by: clanger, bdutheil

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

PR: https://git.openjdk.org/jmc/pull/552


More information about the jmc-dev mailing list