-
Notifications
You must be signed in to change notification settings - Fork 490
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
NAS-131083 / 25.04 / service.stop
return values are swapped
#14463
Conversation
service.stop
return values are swappedservice.stop
return values are swapped
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.
Should we do this or fix the docs? The latter is less likely to cause a regression unless you're absolutely certain it won't break anything.
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.
If we're going to change the behavior then I'd suggest a CI run run as a prerequisite of the PR.
Amazingly I only see one place in middleware where the return value is used and it's in a test, but I'm definitely not certain about anywhere else yet. |
Our codebase is rarely that simple. It's a trap. |
If you go down the path of changing the return value, you should also first socialize change with the QE team as they may be explicitly testing this. |
Definitely, I'm just gauging opinion for now to see if this would be worth changing. To me a return value of |
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.
I checked the UI code, they are using this method's return value too.
My vote would be to update the docstrings to indicate what is returned. |
I hate this (anti)-pattern. It has plagued us since freeBSD days 🙂. Why would we keep this behavior? Is there any logical reason (other than the apprehension to change)? I'm not going to die on this hill but I find it weird to keep something like this in code that is (and has) caused lots of confusion over the years. |
I'm not going to defend it. I find 44 usages of |
We assert |
I'm not defending it, we just need to make sure that all stakeholders are aware (in addition to making sure we don't break our own CI :) ) |
Passing our CI tests: http://jenkins.eng.ixsystems.net:8080/job/tests/job/api_tests/630/ |
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.
This looks good to me. Just make sure UI team is aware of the behavioral change (they might not care). You also need to make sure the TC team is aware of the change too.
This PR has been merged and conversations have been locked. |
The API documentation states: 'Will return
true
if service successfully stopped' but the opposite is true.Return
True
on successful stop, or raise aCallError
if the service is still running.Tests: http://jenkins.eng.ixsystems.net:8080/job/tests/job/api_tests/630/