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

Alex Macdonald aptmac at openjdk.org
Mon Feb 12 16:54:23 UTC 2024


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

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

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

Changes: https://git.openjdk.org/jmc/pull/552/files
 Webrev: https://webrevs.openjdk.org/?repo=jmc&pr=552&range=00
  Issue: https://bugs.openjdk.org/browse/JMC-8174
  Stats: 5 lines in 1 file changed: 4 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jmc/pull/552.diff
  Fetch: git fetch https://git.openjdk.org/jmc.git pull/552/head:pull/552

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


More information about the jmc-dev mailing list