I sent this by email to FC support, and it was requested that I post the request here :-)
I'm working on a HipChat bot to do some basic tasks to make things easier. We've automated a lot of our deployment, but currently we still perform some manual steps when we want to deploy tip:
- Check whether any changesets between the Stage tag and the tip tag are missing code reviews.
- Check whether any changesets between the Stage tag and the tip tag have code reviews that have not been approved (eg. rejected or outstanding)
hg stage+hg push
This then kicks off our CI build, which compiles, runs tests, FTPs to the staging server, etc.
I would like to make this a single command, however using the Kiln API I believe I'd currently have to:
- Use the History API to fetch the first 100 changesets from the Stage tag (it's possible I'd need to look up the revision ID first, unless revOldest can be a tag)
- If there are 100 changesets, send the latest ID as the revOldest again to the History API
- (repeat until we have all changesets since the Stage tag)
- Enumerate the changesets checking whether there are review IDs against them (if not, abort deployment)
- Fetch all of the reviews we've collected IDs for, and check whether they've been approved (if not, abort deployment)
This is a little clumsy, and potentially requires a lot of requests. It could be made really simple if there was a way of filtering the History/Changesets based on review status:
- Fetch all changesets since revOldest that do not have approved reviews
If this was possible, even the 100 limit wouldn't be an issue, because if there are more than 100 changesets, it's probably acceptable to just spit them out for now!
Even a count would do, though ideally I'd like the bot to sent messages to the authors of the changesets informing them they haven't been reviewed (or the person a review is assigned to, telling them it needs completing!).