Skip to content

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

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yaauie
Copy link
Member

@yaauie yaauie commented May 2, 2025

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

  • My code follows the style guidelines of this project
  • 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/

Copy link

mergify bot commented May 2, 2025

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

Moves the logic to compile-time by placing a resource with the intended base
URL for the build type, whose version component is:

 - snapshot builds on unreleased minors (patch is "0"):
   - major == 9 => `master`
   - else `${major}.x`
 - else `${major}.${minor}`

Removes prior implementation which was unaware of the build type
and thus could not differentiate between a snapshot and a staging build.
@yaauie yaauie force-pushed the healthreport-url-per-branch branch from f37f304 to 0a2ae1f Compare May 5, 2025 17:35
Copy link

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

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@yaauie yaauie requested a review from mashhurs May 6, 2025 14:45
@mashhurs mashhurs added the backport-9.0 Automated backport to the 9.0 branch with mergify label May 6, 2025
Copy link
Contributor

@mashhurs mashhurs 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 added backport-active-all Automated backport with mergify to all the active branches and removed backport-9.0 Automated backport to the 9.0 branch with mergify labels May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-active-all Automated backport with mergify to all the active branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants