sford/yet-another-commit-checker — pull request #16 by bbaetz (2014-07-15 14:27:05+00:00)
Title: Validate tag committer/messages

Tags are a bit different to regular commits. For lightweight tags, the commit id is the same as the commit that they point to, and there is no content to validate.

For annotated tags however, the new ref id is a special 'tag' object, and Stash's APIs won't find the difference, since its not a 'change' to appear in a Changeset. (If the tag is being moved, the fromHash and the newHash don't have any connection to each other, which also confuses things). See STASH-4993.

Since this code is already using jgit, just use that to parse the tagger.

While in this code, I changed the use of the commit service to use a paged iterator so that commits beyond the most recent 100 are validated. (While MAX_PAGE_LIMIT is > 100k, that's just a request - there's a page.max.commits property that limits it to 100).

There aren't any test cases for this method, so I manually tested it with tags (not the JIRA integration though). Try 'git tag -a -m test test; git push --tags' with a username that doesn't match.

(the pom.xml changes made things easier to develop)