RFR: 2137: Add integrity check to integrate and sponsor commands

Erik Duveblad ehelin at openjdk.org
Wed Jan 10 09:17:24 UTC 2024


Hi all,

please review this patch that adds that makes it possible to enable an "integrity check" for the `/integrate` and `/sponsor` commands. The integrity check will be run before a commit is pushed and ensures that the most recent commit on the target branch was integrated by the bots.

The integrity check is implemented by utilizing an additional repository that for each repository and branch combination for a forge stores the two most recent commits pushed by the bots. This is information is stored in a text file called `heads.txt`, the first list line being the full hash of the most recent commit and the second line being the full hash of the next to most recent commit. The hashes of the two most recent commits are needed for the scenario when a bot throws an exception _after_ the file `heads.txt` in the integrity repo has been updated but _before_ the actual commit has been pushed to the target branch of the pull request. The `IntegrityVerifier` will recognize this case the next time a commit is verified (via a call to `verifyBranch`) and automatically correct the data in the integrity repository.

I also added a couple of new unit tests as well as two larger unit tests for the `/integrate` and `/sponsor` commands.

Thanks,
Erik

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

Commit messages:
 - 2137

Changes: https://git.openjdk.org/skara/pull/1596/files
 Webrev: https://webrevs.openjdk.org/?repo=skara&pr=1596&range=00
  Issue: https://bugs.openjdk.org/browse/SKARA-2137
  Stats: 564 lines in 11 files changed: 562 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/skara/pull/1596.diff
  Fetch: git fetch https://git.openjdk.org/skara.git pull/1596/head:pull/1596

PR: https://git.openjdk.org/skara/pull/1596


More information about the skara-dev mailing list