logstash icon indicating copy to clipboard operation
logstash copied to clipboard

health-report: link to major.minor-versioned help docs on 9.0+

Open yaauie opened this issue 7 months ago • 4 comments

Release notes

  • fixed an issue where a diagnosis in the health report on Logstash 9.0.0 points to future-facing documentation (master) instead of the docs that are specific to 9.0 (9.0)

What does this PR do?

  • determines the help URL base at compile-time based on a few factors:
    • snapshot builds for unreleased branches:
      • 9.x points to master
      • others point to ${majorVersion}.x
    • others point to ${majorVersion}.${minorVersion}

Why is it important/What is the impact to the user?

When running Logstash 9.0, this makes the help_url-s in diagnostics correctly point to 9.0-specific guidance, instead of pointing to forward-facing guidance from the bleeding edge of main/master.

As of the time of this writing, the two are the same; but as new things are added to main, they will eventually diverge.

Checklist

  • [x] My code follows the style guidelines of this project
  • [x] I have commented my code, particularly in hard-to-understand areas
  • ~~[ ] I have made corresponding changes to the documentation~~
  • ~~[ ] I have made corresponding change to the default configuration files (and/or docker env variables)~~
  • ~~[ ] I have added tests that prove my fix is effective or that my feature works~~

How to test this PR locally

The procedure is the same in several configurations

  1. start a pipeline that will block
    bin/logstash -e 'input { generator { } } filter { ruby { code => "sleep 1" } } output { sink { } }'
    
  2. watch the health report for ~1 minute until the status degrades:
    watch curl --silent 'localhost:9600/_health_report?pretty=true'
    

Configurations:

  • snapshots:
    • unrelased main:
      • ensure versions.yml is unmodified: git checkout -- versions.yml
      • build logstash ./gradlew installDefaultGems --info | grep HelpUrl
      • run test
      • expect url to begin with https://www.elastic.co/guide/en/logstash/master/
    • unreleased 8.19
      • emulate versions: yq -i '(.logstash, ."logstash-core") = "8.19.0"' versions.yml
      • build logstash ./gradlew installDefaultGems --info | grep HelpUrl
      • run test
      • expect url to begin with https://www.elastic.co/guide/en/logstash/8.x/
    • 9.0 branch
      • emulate versions: yq -i '(.logstash, ."logstash-core") = "9.0.1"' versions.yml
      • build logstash ./gradlew installDefaultGems --info | grep HelpUrl
      • run test
      • expect url to begin with https://www.elastic.co/guide/en/logstash/9.0/
  • releases:
    • main (suppose 9.1 release):
      • emulate versions: yq -i '(.logstash, ."logstash-core") = "9.1.0"' versions.yml
      • build logstash RELEASE=1 ./gradlew installDefaultGems --info | grep HelpUrl
      • run test
      • expect url to begin with https://www.elastic.co/guide/en/logstash/9.1/
    • unreleased 8.19
      • emulate versions: yq -i '(.logstash, ."logstash-core") = "8.19.0"' versions.yml
      • build logstash RELEASE=1 ./gradlew installDefaultGems --info | grep HelpUrl
      • run test
      • expect url to begin with https://www.elastic.co/guide/en/logstash/8.19/
    • 9.0 branch
      • emulate versions: yq -i '(.logstash, ."logstash-core") = "9.0.1"' versions.yml
      • build logstash RELEASE=1 ./gradlew installDefaultGems --info | grep HelpUrl
      • run test
      • expect url to begin with https://www.elastic.co/guide/en/logstash/9.0/

yaauie avatar May 02 '25 21:05 yaauie

This pull request does not have a backport label. Could you fix it @yaauie? 🙏 To fixup this pull request, you need to add the backport labels for the needed branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit.
  • If no backport is necessary, please add the backport-skip label

mergify[bot] avatar May 02 '25 21:05 mergify[bot]

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

elastic-sonarqube[bot] avatar May 05 '25 17:05 elastic-sonarqube[bot]

:green_heart: Build Succeeded

History

  • :broken_heart: Build #2924 failed f37f304bc3689204d937129da82409737bf9761f

elasticmachine avatar May 05 '25 18:05 elasticmachine