Plugin hooks for annotating source view
Description
I have a number of source-related pages and apps and on my server, for example:
- Generated API docs, eg doxygen/sphinx/swagger
- Pages rendered from package metadata, eg setup.py/PKG-INFO
- Issue/feature trackers other than the one built into GitLab.
- Cross-reference management (Kythe)
- Perf characterization info
Right now, these kinds of pages are capable linking to GitLab, but there isn't a great way for GitLab to link back. This prevents GitLab from being the kind of authoritative resource that it could be for us.
Proposal
A new kind of webhook can be registered which queries for file/hash and can retrieve annotation data. The hook fires asynchronously with the source code page load so as not to slow it down. When the hook returns, a client side JavaScript function annotates the source view accordingly, linking function definitions, ticket references, variables and other symbols to appropriate external docs as supplied
If the hook takes too long to return, it times out and no annotation occurs.
The motivation in the end is to allow a richer class of plugins; plugins which not only respond to GitLab events and mutate its state, but also that augment its own views.