-
Notifications
You must be signed in to change notification settings - Fork 76
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
Allow version validation to ignore NiFi or Registry when checking for parameter support #304
Allow version validation to ignore NiFi or Registry when checking for parameter support #304
Conversation
… parameter support
Args: | ||
verify_nifi (bool): If True, check NiFi meets the min version | ||
verify_registry (bool): If True, check Registry meets the min version | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you change the if else structure to match the rest of the code?
if X
do
else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Is there a way to add a test for this? |
Not that I could see easily because the methods it's calling actually throw an error if the versions don't match and I couldn't see a way of changing the service version as part of a test either (and writing integration tests that need people to change the versions of nifi/registry they're running against part way through just seemed silly) I'm not convinced the existing method's approach of throwing an Error is correct either (the warning message on this validate method would presumably never be reached because the error would be raised)... but changing that existing behaviour didn't seem sensible as part of this PR, that should be considered as a separate Issue if someone with more knowledge of the existing logic agreed (in my opinion) |
Thanks for the fix Chris, and the review Otto. I'll try and get this tested
and merged by Monday
…On Sat, May 7, 2022, 6:43 AM Chris Sampson ***@***.***> wrote:
Reopened #304 <#304>.
—
Reply to this email directly, view it on GitHub
<#304 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACZAZOBFJ5NTKQDGTQTGQKTVIX7HRANCNFSM5VC7L3TQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I think modifying utils.check_version to not raise an error, but simply assume registry version 0.2.0 if it cannot retrieve the swagger.json is the safer option. Throwing an error is overkill and my implementation was heavy handed - the user can have the option to proceed or halt if they cannot do the check using your true/false option. I think check_version like this should work, if you care to examine it against your requirements:
|
@Chaffelson I think that looks OK I think my 2nd paragraph above about Errors was more aimed at the Your change to Do we want that change as part of this MR or a separate one? |
I've got the function here, and I'm going to make some minor fixes as part of the next release, so I'll merge this and apply the updated function myself. |
… parameter support (Chaffelson#304) * Allow version validation to ignore NiFi or Registry when checking for parameter support * Refactor if-else statement format
Closes #301