Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade snakeyaml dependency. #89

Merged
merged 1 commit into from Sep 19, 2023

Conversation

mashhurs
Copy link
Contributor

@mashhurs mashhurs commented Sep 19, 2023

What does this PR change?

Upgrades snakeyaml to 2.0.

How to test locally?

  • build jar with ./gradlew clean vendor
    • creates logstash-filter-useragent-3.3.5.jar
  • define a config to use the plugin
input {
  stdin {}
}
filter {
  useragent {
    source => 'message'
  }
}
output {
 stdout {}
}
  • run Logstash and check if plugin is parsing the user agent info
Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405
{
          "host" => {
        "hostname" => "Mashhurs-MacBook-Pro.local"
    },
      "@version" => "1",
    "@timestamp" => 2023-09-19T03:44:35.218216Z,
    "user_agent" => {
            "os" => {
               "full" => "iOS 3.2.1",
            "version" => "3.2.1",
               "name" => "iOS"
        },
          "name" => "Mobile Safari UI/WKWebView",
        "device" => {
            "name" => "iPad"
        }
    },
       "message" => "Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405",
         "event" => {
        "original" => "Mozilla/5.0 (iPad; U; CPU OS 3_2_1 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Mobile/7B405"
    }
}

@mashhurs mashhurs self-assigned this Sep 19, 2023
@mashhurs mashhurs marked this pull request as ready for review September 19, 2023 03:24
@mashhurs mashhurs changed the title Upgrade dependency. Upgrade snakeyaml dependency. Sep 19, 2023
Copy link
Contributor

@andsel andsel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a doubt on the fact to restrict LS version compatibility.

@@ -94,7 +94,7 @@ task verifyYaml(type: Verify, dependsOn: [patchYaml, processResources]) {

dependencies {
implementation group: 'org.apache.commons', name: 'commons-collections4', version: '4.1'
implementation group: 'org.yaml', name: 'snakeyaml', version: '1.33'
implementation group: 'org.yaml', name: 'snakeyaml', version: '2.0'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Snakeyaml was updated on Logstash core with elastic/logstash#15125, shipped with v8.9.0. Should we constraint this version of the plugin to that LS versions ? (add a dependency on LS 8.9.0+ in gemspec)

Copy link
Contributor Author

@mashhurs mashhurs Sep 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change, we see with the CIs that it is compatible with the current latest 8.x and 7.x version. We should investigate the case where LS core has a lower version than plugin but for now, pessimistic locking without clarification would block some users after release.

Copy link
Contributor

@andsel andsel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mashhurs mashhurs merged commit b55bb5e into logstash-plugins:main Sep 19, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade snakeyaml dependency.
2 participants