Many customers have expressed their requirement to perform certain actions prior to developers checking-in their code. For example:
- Validate certain commit messages, such as a Trac or other ticket system ID
- Validate that the files added follow a specific file naming convention
Based on these validations, we can setup rules to accept or reject these commits. We’ve now made this possible for all customers with pre-commit web hooks. Here’s how it works:
1) Log into your Codesion account and choose the “Services” tab, then “Subversion – Commit Hooks”
2) Select “Pre-Commit Web Hook” and enter your script URL, for example: https://yourserver.com/pre_commit_hook
- this is the HTTP(s) URL that you want to send the commit information to
3) Select the Timeout between 5 seconds and 5 minutes
- this determines how long we wait for a response from your HTTP script
4) Select the Default Action to deny or allow the commit
- if we did not get a response from your script, in other words, it timed out, then the default action determines whether to deny or allow commit
5) Once a user performs a commit to the SVN repository, Codesion will send the commit information to your URL
6) The commit will either be denied or allowed based on your custom pre-commit script