Graylog2 / graylog2-server

Free and open log management
https://www.graylog.org
Other
7.4k stars 1.07k forks source link

Avoid compilation of graylog2-server for web plugins #11866

Open c8y3 opened 2 years ago

c8y3 commented 2 years ago

The package.json of all web plugins contains a devDependency to "graylog-web-plugin" as a relative path. Because of this, in order to compile a web plugin, one must first clone graylog2-server and compile it. This makes the process of compiling a plugin a little bit complex, and uses time and resources during continuous integration. Would it be possible to rather define this devDependency as any other npm dependency (or, as an alternative as an URL pointing to a tarball from a graylog2-server github release)? Thank you.

Expected Behavior

Ideally, the process of building a graylog web plugin would simply amount to cloning the repository with the plugin and run "mvn package".

Current Behavior

Currently, to build a web plugin, one must:

Possible Solution

From a plugin developer's point of view, the easiest solution would be to declare the devDependency to graylog-web-plugin as any other regular npm package. As an alternative, the dependence could be expressed as an URL pointing to a tarball. This tarball could be published, for instance, in the gitub releases of graylog2-server (one for each release).

Context

I am currently doing some maintenance work for several graylog plugins (https://github.com/airbus-cyber/graylog-plugin-alert-wizard, https://github.com/airbus-cyber/graylog-plugin-correlation-count, https://github.com/airbus-cyber/graylog-plugin-aggregation-count, https://github.com/airbus-cyber/graylog-plugin-logging-alert). This issue has affected me in two ways:

Your Environment

dennisoelkers commented 2 years ago

Hey @c8y3,

thanks for reporting this! We are aware of this shortcoming and will improve it in the future. For now, depending on the server checkout was very comfortable for core developers, because it allowed picking up changes in core and plugins immediately during development. I do understand that for a plugin developer this is rather uncomfortable. We will change the dependency structure soon and most probably publish a package for consumption that can be used from a plugin, so a complete server checkout is not needed anymore.

c8y3 commented 2 years ago

Thank you for the follow-up.