1

Is it possible to notify a Trac installation about new revisions by calling a URL?

I have that GitLab server that allows me to trigger WebHooks when new revisions were pushed. Is there an interface on my Trac server that I could call in order to notify about the new revisions?

eckes
  • 64,417
  • 29
  • 168
  • 201
  • You could try using the [trac-github plugin](https://github.com/trac-hacks/trac-github). It might need some modifications to work with GitLab web hooks, but should be close to what you are looking for. Feel free to open a ticket for trac-github if you create a patch to make it work with GitLab, or have some specific questions. I also spotted [gitlab-trac-integration](https://github.com/georgethomasuk/gitlab-trac-integration) when searching GitHub. – RjOllos Feb 07 '17 at 16:28

2 Answers2

0

I just found a workaround for this.

  1. set up the git mirror in the trac repository, per instruction in trac-github plugin

  2. Instead of setting up a webhook in gitlab, you could set up a crontab job in the trac server such that, for every 10 minutes (or whatever frequency you find comportable), update the mirror repository in trac server, and trigger the corresponding post-receive hooks. This stackoverflow post contains a fully functional script.

This is not ideal, but actually works for any git mirrors in Trac, even if you don't have the web hook access.

Walty Yeung
  • 3,396
  • 32
  • 33
-1

I agree with RjOllos that the trac-github plugin is the best way to accomplish the integration that you want. One of the main features of the plugin is that it supports "direct changeset TracLinks to GitHub's repository browser." Per the Trac site, TracLinks are a fundamental feature of Trac, because they allow easy hyperlinking between the various entities in the system — such as changesets and commit messages. This sounds like the feature you are looking for to provide links from Trac to revisions in Git.

In version 2.3 of the plugin, it states that they have added "Support webhook signature verification for post commit hooks."

They also provide some nice setup steps which can sometime be lacking with other Trac plugins.

Josh Laase
  • 326
  • 1
  • 13