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

refactor deprecation log event_api.tags.illegal #16545

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

kaisecheng
Copy link
Contributor

@kaisecheng kaisecheng commented Oct 11, 2024

Release notes

[rn:skip]

What does this PR do?

Use obsoleted_version to replace deprecated_msg to form a consistent warning message

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

Make the warning consistent with other flags

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

Related issues

@kaisecheng
Copy link
Contributor Author

@mashhur I did a little refactor on deprecation message. Hope to get your view. Thank you.

@kaisecheng kaisecheng changed the base branch from main to 8.x October 11, 2024 16:50
@kaisecheng kaisecheng changed the base branch from 8.x to main October 11, 2024 16:50
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

@@ -267,7 +267,7 @@ class LogStash::Runner < Clamp::StrictCommand
I18n.t("logstash.runner.flag.event_api.tags.illegal"),
:default => LogStash::SETTINGS.get_default("event_api.tags.illegal"),
:attribute_name => "event_api.tags.illegal", :passthrough => true,
:deprecated_msg => I18n.t("logstash.runner.tags-illegal-deprecated")
:obsoleted_version => "9"
Copy link
Contributor

Choose a reason for hiding this comment

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

The reason for the refactoring is, came with an idea to widely use obsoleted_version with other deprecation params (such as http.*). Change LGTM!

One thing I would like to clarify: merging against 8.x would make sense since event_api.tags.illegal will be removed from main (with this PR), how do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I need this PR to merge to main because the way of handling deprecation warning in clamp.rb is benefit for the future deprecation not limit to 8.x

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!

@kaisecheng kaisecheng merged commit 8cd0fa8 into elastic:main Oct 11, 2024
6 checks passed
@kaisecheng
Copy link
Contributor Author

@logstashmachine backport 8.x

github-actions bot pushed a commit that referenced this pull request Oct 11, 2024
- add `obsoleted_version` and remove `deprecated_msg` from `deprecated_option` for consistent warning message

(cherry picked from commit 8cd0fa8)
kaisecheng added a commit that referenced this pull request Oct 11, 2024
- add `obsoleted_version` and remove `deprecated_msg` from `deprecated_option` for consistent warning message

(cherry picked from commit 8cd0fa8)

Co-authored-by: kaisecheng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants