Commit graph

58 commits

Author SHA1 Message Date
github-actions[bot]
b1773f8c02
force ruby-maven-libs constraint to >= 3.9.6.1 (#16130) (#16131)
(cherry picked from commit 973c2ba3aa)

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2024-05-02 21:50:23 +01:00
João Duarte
59bd376360
upgrade ruby-maven-libs to 3.8.9 (#15894)
Given that JRuby comes with ruby-maven-libs 3.3.9 this commit upgrades the gem to 3.8.9 and ensures files from 3.3.9 are not included in the distribution.
2024-03-18 14:30:13 +01:00
Pavel Zorin
2c83a52380
[CI] Send Java and ruby tests to sonarqube simultaneously (#15810)
* Ruby code coverage with SimpleCov json formatter

* [CI] Send Java and ruby tests to sonarqube simultaneously

* Enabled COVERAGE for ruby tests

* Enabled COVERAGE for ruby tests

* Enabled COVERAGE for ruby tests

* Enabled COVERAGE for ruby tests

* Enabled COVERAGE for ruby tests

* Added compiled classes to artifacts

* Test change

* Removed test changes

* Returned back ENABLE_SONARQUBE condition

* Removed debug line

* Diable Ruby coverage if ENABLE_SONARQUBE is not true

* Run sonar scan on pull requests and onn push to main

* Run sonar can on release branches
2024-01-17 19:04:37 +00:00
João Duarte
6046402a35
Remove pinning of psych 5.1.0 (#15474)
https://github.com/ruby/psych/issues/655 has been fixed with the release of 5.1.1.1
2023-10-18 16:02:37 +01:00
João Duarte
401d166a89
pin psych 5.1.0 due to ruby/psych#655 (#15433)
The new psych 5.1.1 gem seems to not work when installed in JRuby 9.4 (used in main).

This change pins the version back to 5.1.0 until ruby/psych#655 is sorted.
2023-10-11 14:58:42 +01:00
github-actions[bot]
537f1b942d
Add bigdecimal > 3.1 dependency. (#15377) (#15384)
(cherry picked from commit 9680bbd82a)

Co-authored-by: Mashhur <99575341+mashhurs@users.noreply.github.com>
2023-10-09 14:54:28 +01:00
Andrea Selva
58e23fbdc3
Fix the update of Puma (#15271)
Revert PR #15267 which updated Puma in Gemfile.template and correctly place it in logstash-core.gemspec, beeing a dependency of Logstash core.
2023-08-22 12:32:50 +02:00
Andrea Selva
afc50eb676
Update Puma (#15267)
Update Puma dependency
2023-08-21 14:11:31 +02:00
João Duarte
04fd0840fe
bump rake 13 for jruby 9.4 compatibility (#15256) 2023-08-15 22:45:45 +01:00
Andres Rodriguez
6154a69c15
Add basic ruby linter (#15168)
Adds rubocop as a linter for ruby.:
 - Adds .rubocop.yml which defines specific config on top of default
 - Adds Gradle task 'lint' task
 - Adds 'lint:report' rake task to report Lint Cops.
 - Adds 'lint:format' rake task to automatically format the code.
2023-07-13 17:18:10 -04:00
Andrea Selva
26d1c7ccdb
Update to JRuby 9.4 (#14861)
Set of changes to make Logstash compatible to JRuby 9.4.
Bundle JRuby 9.4.3.0

- Redefine space token in `LSCL`  and `grammar` treetop from `_` which would generated methods in the form `def _0` (deprecated since `2.7`) to `sc`.
- `I18n.t` method doesn't accept hash as second argument
- `URI.encode` has been replaced with same functionality with `URI::Parser.new.escape`
- `YAML.load` needs explicit `fallback: false` to return false when the yaml string is empty (or contains only comments)
- JRuby's  `JavaClass` has been removed, now it can use `java.lang.Class` directly
- explicitly require gem `thwait` to satisfy `require "thwait"` (In `Gemfile.template` and `logstash-core/logstash-core.gemspec`)
- fix not args `clone` to be `def clone(*args)`
- fix `Enumeration.each_slice` which from `Ruby 3.1` is [chainable](https://rubyreferences.github.io/rubychanges/3.1.html#enumerableeach_cons-and-each_slice-return-a-receiver) and doesn't return `nil`. JRuby fixed in https://github.com/jruby/jruby/issues/7015
- Expanded `Down.download` arguments map ca16bbed3c302006967413eb9d3862f2da81f7ae
- Avoid to pass `nil` in the list of couples used in `Hash[ <list of couples> ]` which from Ruby `3.0` generates an `ArgumentError`
- Removed space not allowed between method name and parentheses `initialize (` is forbidden. 29b607dcdef98f81a73ad171639fd13aaa65e243
- With [Ruby 2.7 the `Kernel#open`](https://rubyreferences.github.io/rubychanges/2.7.html#network-and-web) doesn't fallback to `URI#open`, fixed test code that used that to verify open port. e5b70de54c5301f51a767da67294092af0cfafdc
- Avoid to drop `rdoc/` folder from vendored JRuby else `bin/logstash -i irb` would crash, commit b71f73e9c6edb81a7b7ae1305047e506f61c6e8c

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2023-06-28 13:05:43 +02:00
Edmo Vamerlatti Costa
e76e582086
Add missing Elasticsearch SSL settings and replace deprecated options (xpack.monitoring and xpack.management) (#15045)
This commit adds missing Elasticsearch SSL settings and replaces deprecated options being used on `xpack.monitoring.*` and `xpack.management.*` settings:

Changes:
- Updated deprecated monitoring and management Elasticsearch's SSL settings so no warnings are logged.
- Added monitoring settings support for file-based certificates and for the cipher suites: `xpack.monitoring.elasticsearch.ssl.certificate`, `xpack.monitoring.elasticsearch.ssl.key`, and `xpack.monitoring.elasticsearch.ssl.cipher_suites`.
- Added management settings support for file-based certificates and for the cipher suites: `xpack.management.elasticsearch.ssl.certificate`, `xpack.management.elasticsearch.ssl.key`, and `xpack.management.elasticsearch.ssl.cipher_suites`.
2023-05-15 11:54:38 +02:00
Andrea Selva
01876d2ca7
Pins murmurhash3 to last version with java library (#14832)
Pins murmurhash3 to last version with java library
2023-01-10 11:32:53 +01:00
Rob Bavey
0578ddbbd3
Upgrade jruby to 9.3.8.0 (#14524)
Also remove the explicit CSV import added in #14507, jruby-9.3.8.0 includes
the correct version by default
2022-09-13 17:36:40 -04:00
Rob Bavey
8d41b85498
Manually import CSV gem to work around thread leak (#14507)
* Manually import CSV gem to work around thread leak

The version of CSV included in jruby distributions >= `9.3.0.0` and
< `9.3.8.0` include a bug that triggers a thread leak when calling
`parse_line` in CSV files.

This commit updates the version of the CSV gem to the latest version,
which includes fixes, and remains compatible with ruby 2.6

Relates: https://github.com/jruby/jruby/issues/7346

* Add CSV license info
2022-09-07 14:45:37 -04:00
João Duarte
4cb900ce7e
update flores dependency to at least 0.0.8 (#14437) 2022-08-17 09:56:45 +01:00
kaisecheng
5b69f65797
Pin jar-dependencies 0.4.1 (#14421)
* pin jar-dependencies to 0.4.1
CI red with `Gem::LoadError: You have already activated jar-dependencies 0.4.1, but your Gemfile requires jar-dependencies 0.4.2`

* add comment
2022-08-04 11:13:30 -07:00
Andrea Selva
430d3af7dc
Update dependencies (#14348) 2022-07-13 09:06:18 +02:00
Ry Biesemeyer
7757908c34
Add ca_trusted_fingerprint to core features (monitoring/central-management) (#14155)
* add `ca_trusted_fingerprint` to core features (monitoring/central-management)

* Rely on released ES output

* fix: ensure commented-out examples in logstash.yml are functionally correct

* add admonition for how to get a trusted CA's fingerprint
2022-06-28 17:07:59 -07:00
Karol Bucek
433b341f0f
Refactor: avoid loading polyglot (#14175)
* Refactor: require treetop/runtime - avoids loading polyglot
* Build: instruct Bundler not to auto-load polyglot/treetop

+ Build: these deps are properly required as needed
all of them only used in one place (outside of normal bootstrap)
2022-06-07 08:28:56 +02:00
Karol Bucek
c08be755b1
Deps: lock faraday to 1.x due elasticsearch-transport (#14185) 2022-05-30 15:50:38 +02:00
João Duarte
09fbf5acb8
Relax fpm version constraint after bug fix fpm#1856 (#13402) 2021-11-11 12:01:27 +00:00
Karol Bucek
eb92c1d04e
Build: lock fpm to 1.13.x to avoid dep packaging issues using 1.14.0 (#13400) 2021-11-10 15:40:01 +01:00
Karol Bucek
fe9f16e948
Deps: drop old and unused gem dependencies (#13157)
* Deps: drop (unused) atomic gem
not used in LS or any of the plugins

* Deps: drop unused (XML) builder gem
2021-09-02 11:13:14 +02:00
João Duarte
7390b64a93
update fpm to allow pkg creation on jdk11+jruby 9.2 (#13005)
* fpm to 1.13.0 which allows building packages with java 11 + jruby 9.2
* childprocess to 4.x + remove monkey patches
* clamp to 1.x to unlock fpm 1.13.0
2021-06-21 14:39:27 +01:00
João Duarte
0b08838d2a
bump devutils dependency to 2.x (#12857)
* update filter_spec to not use insist
* fix ruby tests adding rspec/wait require
2021-06-08 12:31:55 +01:00
João Duarte
bac5e89dd6
Remove json ~>1 pinning (#12851)
This pinning made sense when logstash-mixin-aws would depend on aws-sdk-v1 which forced json ~> 1.
The aws mixin v5.0.0 only depends on v2 now, so we can remove this.
2021-04-28 11:51:38 +01:00
Colin Surprenant
1dc88cc586 depend on the elasticsearch output plugin >= 10.4.2
Fixes #11830
2020-04-23 17:59:11 +00:00
Joao Duarte
d65f78728b stop installing rake and json on every bootstrap
Fixes #11102
2019-12-02 14:59:43 +00:00
João Duarte
15fb30823f
Cleanup gradle tasks and dependency installation (#10942)
- have `bootstrap` task do as little as possible: install gems in Gemfile.template that don't belong to groups
- have test tasks depend on the `installTestGems` task instead of `bootstrap`
- logstash es output is now a dependency because of license checking
- fix out of memory problem in SharedHelpers.trap

Also use release lockfile during installDefaultGems

The release lockfile is only copied to Gemfile.lock if
it doesn't exist. During the `installDefaultGems` task other
plugin installation tasks already occurred, generating a lock file.

This commit removes it before running the plugin installation.
2019-07-12 09:11:07 +01:00
Joao Duarte
0e115d31a6 cleanup many rakelib tasks that aren't used anymore
* simplify the plugins-metadata.json file
* sort and update the plugin list in the rakelib/plugins-metadata.json
* remove dependency on twitter input for testing
* sorted Gemfile.template (grouped by group)
* remove default plugins from Gemfile.template

Fixes #10509
2019-03-15 16:26:58 +00:00
João Duarte
5223b5cde4
pin childprocess to 0.9 (#10410) 2019-02-07 15:42:30 +00:00
Joao Duarte
2910faa57f fix building of deb and rpm
fpm requires json 1.x but the artifact rake tasks
will activate the default gem json 2

This PR ensures json 1 is activated early and is present right after
jruby is bootstrapped.

Also downgrades fpm to 1.3 as 1.11.0 wasn't building correctly

Downgrades .ruby-version to a version we have available in CI

Fixes #10396
2019-02-06 09:39:55 +00:00
João Duarte
8d19e6cef9
Cleanup dependencies (#10171)
* cleanup Gemfile.template dependencies
* cleanup logstash-core gem dependencies
2019-02-05 16:38:49 +00:00
Ry Biesemeyer
583ec6b625
Java 11 support (#10279)
* bump jruby to 9.2

* don't rely on logstash-base docker image

* work around webmock ruby 2.5 support

* ensure data folder exists in docker

* change fixnum and bignum to integer

* FileUtils.rmdir to rm_rf

this is because from 2.3 to 2.5 FileUtils.rmdir will throw an exception
if the directory isn't empty. On 2.3 the operation will just not delete
the directory silently.

* bump jruby to 9.2.5.0 and fix test

* make rake default task since prepare pack needs it

* Resolve compiler warnings (#10247)

There are 3 types of compiler warnings that are either resolved or suppressed:

1. Rawtypes: In JRuby 9.2, `RubyArray` is a generic, so references throughout
   our codebase to the now "raw" type trigger warnings. In most cases we cannot
   actually resolve the issue, since the JRuby-provided methods for creating
   `RubyArray`s still return the raw type, so these have been suppressed.

2. Deprecations:
   - `RubyString#intern19()` -> `RubyString#intern()`
   - `RubyString#downcase19(ThreadContext)` -> `RubyString#downcase(ThreadContext)`
   - `NativeException`: remove import & reference directly; suppress usage
     warnings
   - `RaiseException()`: migrate to equivalent non-deprecated methods wherever
     possible; in some cases where we are using this in conjunction with the
     also-deprecated `NativeException` to preserve java stacktraces, there
     seems to be no non-deprecated path forward, so these cases have been
     suppressed.

3. Redundant Casts
   - Resolved

* JRuby 9.2 bundler shenanigans (#10266)

* Revert "Revert "remove forced dependency on old bundler (#9395)""

This reverts commit bef984143d.

* plugin management: update internal bundler to 1.17.x APIs

* deps: update dev dependency webmock to version compatible with JRuby 9.2

* spec: update Pack fixture to include manticore version that doesn't conflict

* build: update gradle to version that has Java 11 support

* java11: resolve or suppress deprecation warnings

* Remove superfluous flag opting into ParNew GC implementation

When opting into CMS garbage collector with `XX:+UseConcMarkSweepGC`, the
young generation collector ParNew has been the default since Java 8, making
the `XX:+UseParNew` flag redundant; the flag was removed in Java 9, and
should no longer be specified to work with modern Javas.

https://bugs.openjdk.java.net/browse/JDK-8006478
https://openjdk.java.net/jeps/214

* spec: set thread name to example description for easier debugging

* spec: prevent errors in testing specs by checking against skip list before using

* no-op: remove use of `HashMap#computeIfAbsent` on single-threaded code

> This method will, on a best-effort basis, throw a `ConcurrentModificationException`
> if it is detected that the mapping function modifies this map during computation.
>
> -- https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/HashMap.html#computeIfAbsent(K,java.util.function.Function)

* qa: by default, run integration against Elastic Stack 6.5.x

To support development on Logstash on top of Java 11, default to testing
against an Elastic Stack that is capable of running on Java 11.

* qa: ignore deprecation warnings when comparing offline pack output

* qa: add Java 9+ support to ChildProcess dev dependency

this can safely be removed when the childprocess gem supports Java9+
https://github.com/enkessler/childprocess/pull/141

* qa: allow connections to localhost in webmock

* bump jrjackson version

* fix filebeat integration tests

* spec: ensure license compliance spec runs first

The license compliance spec that validates the licenses of bundled
plugins appears to not be compatible with the hooks that we inject
into bundler for plugin management, and will fail in obscure ways
when run after those hooks have been added. Since those hooks are
not necessary for validating licenses, the easiest solution was to
ensure that those specs run first, before the VM has been poluted.

Since the gradle/junit/rspec bridge that is currently in place
runs all specs in the same JVM, we also need to make sure that the
rspec "world" is reset before a run, to ensure that it doesn't
retain spec definitions from previous runs.

Also updates the rake invocation, although I'm not sure it is used
any more.
2019-02-04 16:36:11 -08:00
João Duarte
e0638e25a9 add http and memcached filters to default set of plugins (#10213) 2018-12-18 14:47:17 +00:00
Joao Duarte
1ed4f018a1 rename appsearch to elastic_app_search
Fixes #10130
2018-11-08 16:37:16 +00:00
Joao Duarte
7e1ffd3d35
add snmp input to default plugins 2018-10-24 13:17:10 +01:00
Joao Duarte
dc41033545 add appsearch output to default plugin list
Fixes #10062
2018-10-24 12:14:00 +00:00
Jake Landis
e22457252f Introduction of the Azure module (experimental)
This module leverages the Azure Event Hub to read events from the activity log and sql diagnostics.  Please note this module is considered experimental till otherwise noted.

This change also introduces logstash-input-azure_event_hubs as a default plugin

Fixes #9729
2018-07-02 16:34:49 +00:00
Armin
b8bd364f27 BUILD: lock rake at 12.2.x
Fixes #9685
2018-05-30 09:53:57 +00:00
Andrew Cholakian
26f5923e2d Add test deps that x-pack will use
When we merge x-pack in we will axe its gemspec, which isn't used anyway.
It does need a couple more test deps, which we add in here

Fixes #9224
2018-03-09 22:55:53 +00:00
Andrew Cholakian
cbbfcd42c2 Pin atomic gem per #9194
Fixes #9204
2018-03-02 04:37:11 +00:00
Guy Boertje
33b151707a
add jdbc_static (#8933)
* add jdbc_static

* sort logstash-* gems and add jdbc_static to plugins-metadata.json
2018-01-15 17:26:37 +00:00
Jake Landis
590e47fced Pin webrick to compatible version
Fixes #8845

Fixes #8846
2017-12-16 15:35:06 +00:00
Armin
c5fa78c7fa #8280 remove simplecov
Fixes #8536
2017-10-26 12:15:12 +00:00
Armin
012a432009 MINOR: Remove unused docker-api as development dependency
Fixes #8533
2017-10-26 08:32:09 +00:00
Armin
54611c3699 MINOR: Upgrade to newest devutils
Fixes #8487
2017-10-13 06:49:19 +00:00
Joao Duarte
fbd1db1a12 add missing default plugins to Gemfile template
Fixes #8431
2017-10-06 14:19:02 +00:00
Pier-Hugues Pellerin
4dc2fd3ddd Remove unecessary dependency file-dependencies
To understand why we can now remove this gem we have to go back at the
history of LS 1.5 and the choice we made back them. In the begining
plugins depending on external files like the `user-agent` or the `filter-geoip`
were not bundling theses files in the gem.

The `file-dependencies` was providing a new hook when plugins were
installed to trigger the file download.

In the context of making the plugins work in an offline environment we
need to make sure that every plugins external resources are present in
the gem.

We have currently a few plugins that require external files and they all
bundle it. So I think its safe to remove that feature, also the hook was
not triggered correctly. So it was a NOOP.

Fixes #8298
2017-09-18 18:56:58 +00:00