-
Notifications
You must be signed in to change notification settings - Fork 117
[bugfix] Fix pipeline hook override #2048
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
Conversation
victorusu
left a comment
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.
@jjotero, I think we need a unit test for this PR.
This behavior should be guaranteed to not break.
What do you think about adding your example as a unit test?
And also another unit test that re-attaches the hook?
vkarak
left a comment
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 have some minor comments + I agree with @victorusu to provide a unit test.
Codecov Report
@@ Coverage Diff @@
## master #2048 +/- ##
==========================================
- Coverage 87.53% 87.51% -0.02%
==========================================
Files 50 50
Lines 8889 8891 +2
==========================================
Hits 7781 7781
- Misses 1108 1110 +2
Continue to review full report at Codecov.
|
vkarak
left a comment
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.
Lgtm, just a very minor comment.
victorusu
left a comment
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.
lgtm
This PR fixes a hook attachment leak occurring when a given hook from a base class is overridden by a derived class.
When overriding a pipeline hook, the method in the derived class would still get attached to the pipeline despite that it is not decorated to do so. See the example below:
Running this gives:
The method
Derived.hhstill gets attached to thepost_setupstage, despite that this method has not even been decorated with anyrun_beforeorrun _afterdecorators.