oracle / opengrok

OpenGrok is a fast and usable source code search and cross reference engine, written in Java
http://oracle.github.io/opengrok/
Other
4.33k stars 746 forks source link

projects lost when merging per-project setting in read-only configuration with active configuration #2147

Open vladak opened 6 years ago

vladak commented 6 years ago

https://github.com/oracle/opengrok/wiki/Per-project-configuration advises to put per-project configuration into read-only configuration file. However when merged with a configuration retrieved from webapp that already contains some projects via:

/opengrok/dist/bin/projadm.py -b /opengrok -R /opengrok/etc/readonly_configuration.xml -r

the resulting configuration.xml will only have the projects specified in read-only configuration.

vladak commented 6 years ago

One way how to deal with this would be to change the workflow - augment the Project Message to be able to set per-project properties and then retrieve the configuration so that it is persistent.

vladak commented 6 years ago

I think this is a fall-out of how XML serialization is done. As a result, merge is not really a merge.

vladak commented 6 years ago

Possibly as a fix the configuration merge needs to be more intelligent.

tulinkry commented 6 years ago

I think some customizations in this code https://github.com/oracle/opengrok/blob/master/src/org/opensolaris/opengrok/index/Indexer.java#L903-L920 would do the trick

vladak commented 6 years ago

This has a workaround so stripping the stopper tag for now.

vladak commented 5 years ago

Thel workaround needs a tweak for full global (not per project) indexing - I believe the per-project setting in read-only configuration is applied after the projects are discovered however once the initial index is done, the per-project settings have to be removed from read-only configuration and set in the webapp.