sagemath / sage_trac_plugin

Trac plugin used to support Sage development at trac.sagemath.org
5 stars 6 forks source link

Log error but don't raise exception when gitolite-admin can't be cloned #17

Open embray opened 8 years ago

embray commented 8 years ago

In v0.3.3 of the plugin, I implemented a fix that was meant to reduce errors that could occur when the sanity of the gitolite-admin repository is checked in the SshKeys plugin during environment startup.

However, one of the sanitizing steps is to fetch from upstream to make sure the repository is up-to-date, but this step fails if starting the environment up as a user who does not have access to the gitolite-admin repo. This can happen, for example, when running the trac-admin command--it initializes an instance of the Trac environment.

I think it's still good to have these checks at environment startup, but it should at most log an error, not raise an exception. Furthermore, if the sanity checks fail the SshKeys plugin could disable itself and e-mail an administrator about it. With the fixes I've already made this normally shouldn't happen anymore, but it's not impossible. It could also happen if the gitolite-admin repository is messed with manually such the the user that Trac runs under can no longer access the repository. That would require manual intervention.