ChiliProject is not maintained anymore.
Please be advised that there will be no more updates.
We do not recommend that you setup new ChiliProject instances and
we urge all existing users to migrate their data to a maintained
system, e.g. Redmine. We will
provide a migration script later. In the meantime, you can use the
instructions by
Christian Daehn.
Forums » Discuss »
What is the best way to setup git such that a push can only be completed if every commit points to a valid ticket number?
Added by Shoan Motwani at 2012-02-06 02:44 pm
I would like to mandate more history tracking by forcing developers to only commit against a valid ticket. Is there a hook for this? I remember there used to be such a feature in Trac for SVN.
Thanks in advance.
Thanks for advice. How do I go about determining if the ticket is valid? All my projects are private. Is there an API that invoke from the hook to validate the ticket?
There's an API for tickets, you'd have to create a user that has access to all those projects though.
Another way would be to use a "ChiliProject script", i.e. a ruby script executed in the ChiliProject context. Your ChiliProject installation has a script/runner
script you can use to execute ad hoc ruby code or even as a shebang, see it's help for more info.
(Quick usage example:
script/runner 'begin; status = 0 if Issue.find(123).present?; rescue ActiveRecord::RecordNotFound; status = 1; end; exit status'
This exits with status 0 if an issue with the ID 123 is present, 1 if not.)