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

Add SNAPSHOT postfix when CI executes the 'snapshot' workflow type #16912

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

Conversation

andsel
Copy link
Contributor

@andsel andsel commented Jan 20, 2025

Release notes

[rn:skip]

What does this PR do?

Updates the gemspec processing for logstash-core to include -SNAPSHOT when WORKFLOW_TYPE environment variable is snapshot, which happens when CI builds snapshot artifacts.

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

When running Logstash, the version stage or qualifier must be immediately visible, for example:

% bin/logstash --version
Using system java: /Users/andrea/.sdkman/candidates/java/current/bin/java
logstash 9.0.0-SNAPSHOT

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

Author's Checklist

  • [ ]

How to test this PR locally

Export WORKFLOW_TYPE to snapshot and verify that the started Logstash print the version with the -SNAPSHOT postfix.

export $WORFLOW_TYPE=snapshot
./gradlew clean installDefaultGems
bin/logstash --version

Related issues

@andsel andsel self-assigned this Jan 20, 2025
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

cc @andsel

@andsel andsel marked this pull request as ready for review January 20, 2025 09:45
@dliappis
Copy link
Contributor

@andsel I kicked off a build of the exhaustive test suite using this PR just to be on the safe side: https://buildkite.com/elastic/logstash-exhaustive-tests-pipeline/builds/1144

@donoghuc
Copy link
Member

Copy link
Member

@jsvd jsvd left a comment

Choose a reason for hiding this comment

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

There are several use cases that need to be tested but some don't seem to work:

  1. tarball name contains SNAPSHOT twice 🔴
  2. snapshot shows up in bin/logstash -V 🟢
  3. snapshot does not showsup in bin/logstash --debug -V, just shows 9.0.0 🔴
  4. snapshot shows up in HTTP api response 🟢 (there is a separate "snapshot" field in the response)
  5. snapshot does not show up in logging entry at startup, only 9.0.0 🔴

Also I suggest using RELEASE as the environment variable to know if the build is a release or a snapshot. WORKFLOW_TYPE is used by the ci scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants