Fixes #38410 - Add mechanism for deprecating displayed fields#395
Merged
ofedoren merged 1 commit intotheforeman:masterfrom May 14, 2025
Merged
Fixes #38410 - Add mechanism for deprecating displayed fields#395ofedoren merged 1 commit intotheforeman:masterfrom
ofedoren merged 1 commit intotheforeman:masterfrom
Conversation
ofedoren
reviewed
May 12, 2025
Member
ofedoren
left a comment
There was a problem hiding this comment.
Thanks, @qcjames53 ! This is really a great addition :)
Some nitpicks though:
- Please, use
Fixesinstead ofRefsin this case. - For deprecated commands and options we also suggest the new command/option to be used instead of deprecated one. Currently the deprecation message for fields is hardcoded with means for removal. Should we also allow a message stating that a deprecated field is being replaced with the new one already, something like we do in
- Could you please add some tests for this feature?
Contributor
Author
|
@ofedoren Thank you for the review! I have added your requested changes and fixed the commit name. |
ofedoren
approved these changes
May 14, 2025
Member
ofedoren
left a comment
There was a problem hiding this comment.
Thanks, @qcjames53 ! We could probably generalize warning message/options instead of hardcoding 2 messages, but that can be dealt with in the future. As of now it seems and works quite nicely.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, hammer has no way to deprecate old fields our developers wish to remove. This PR adds an option for deprecating a field with
:deprecated => true. When a deprecated field is displayed, a stderr warning message is shown indicating it will be removed in the future. Updateddoc/creating_commands.mdto show how to deprecate a field.How to test:
--fields, etc). Ensure output is always sent to stderr.