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: refactor ScaledJob to be used with scale_handler #4707

Merged
merged 21 commits into from
Jul 12, 2023

Conversation

yoongon
Copy link
Contributor

@yoongon yoongon commented Jun 18, 2023

Provide a description of what has been changed
Currently, ScaledJob is left at scalers_cache.go. Move this one into the scale_handler.go for consistent with ScaledObject.

FYI.

// TODO needs refactor - move ScaledJob related methods to scale_handler, the similar way ScaledObject methods are

Checklist

Fixes #4781

@yoongon yoongon requested a review from a team as a code owner June 18, 2023 12:29
@github-actions
Copy link

Thank you for your contribution! 🙏 We will review your PR as soon as possible.

While you are waiting, make sure to:

Learn more about:

@yoongon yoongon force-pushed the feature/refactor-handler2 branch 6 times, most recently from dfeea1b to e1eba2c Compare June 18, 2023 13:58
Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this, my ambition behind this is not just move these functions but also revise & clenup the code. Also some additional tests would be nice.

pkg/scaling/scale_handler.go Outdated Show resolved Hide resolved
pkg/scaling/scale_handler.go Outdated Show resolved Hide resolved
pkg/scaling/scale_handler.go Outdated Show resolved Hide resolved
@yoongon yoongon requested a review from zroubalik June 19, 2023 22:57
@yoongon yoongon force-pushed the feature/refactor-handler2 branch 4 times, most recently from 2b36c23 to b057f22 Compare June 20, 2023 23:06
@yoongon
Copy link
Contributor Author

yoongon commented Jun 26, 2023

@zroubalik
Could you check my comment again? Thanks.

Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

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

@yoongon first of all, sorry for the delay, I have been busy with other stuff. Great job, could you please address the rest of the minor concerns? Thanks!

pkg/scaling/scale_handler.go Outdated Show resolved Hide resolved
pkg/scaling/scale_handler.go Outdated Show resolved Hide resolved
pkg/scaling/scale_handler.go Outdated Show resolved Hide resolved
pkg/scaling/scale_handler.go Outdated Show resolved Hide resolved
pkg/scaling/utils/metrics.go Outdated Show resolved Hide resolved
pkg/scaling/utils/metrics.go Outdated Show resolved Hide resolved
pkg/scaling/utils/metrics.go Outdated Show resolved Hide resolved
@zroubalik
Copy link
Member

zroubalik commented Jul 7, 2023

/run-e2e
Update: You can check the progress here

Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

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

@yoongon could you please also create an issue for this effort and link it in the Changelog? (Other section)

@yoongon yoongon force-pushed the feature/refactor-handler2 branch 2 times, most recently from f7c5ce1 to 25ff08f Compare July 8, 2023 05:53
@yoongon yoongon force-pushed the feature/refactor-handler2 branch 2 times, most recently from 428b5a6 to ef3f726 Compare July 8, 2023 07:05
@yoongon
Copy link
Contributor Author

yoongon commented Jul 8, 2023

@zroubalik
Thanks for the detail check. I've updated code based on your review and update changelog as well.
Please check and let me know if there is anything I can contribute more :)

BTW, one test hasn't passed, but I don't think it's related with this change.

@yoongon yoongon requested a review from zroubalik July 8, 2023 12:25
Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

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

Thanks, there are some leftovers, sorry for being so pedantic about this 😄

pkg/scaling/scaledjob/metrics.go Outdated Show resolved Hide resolved
pkg/scaling/scaledjob/metrics.go Outdated Show resolved Hide resolved
pkg/scaling/scaledjob/metrics.go Show resolved Hide resolved
pkg/scaling/scaledjob/metrics.go Outdated Show resolved Hide resolved
pkg/scaling/scaledjob/metrics.go Show resolved Hide resolved
pkg/scaling/scale_handler.go Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@yoongon yoongon force-pushed the feature/refactor-handler2 branch 3 times, most recently from 7720f5d to da6cd84 Compare July 12, 2023 13:42
@zroubalik
Copy link
Member

zroubalik commented Jul 12, 2023

/run-e2e
Update: You can check the progress here

Signed-off-by: Yoon Park <yoongon.park@gmail.com>
Signed-off-by: Yoon Park <yoongon.park@gmail.com>
Signed-off-by: Yoon Park <yoongon.park@gmail.com>
Signed-off-by: Yoon Park <yoongon.park@gmail.com>
Signed-off-by: Yoon Park <yoongon.park@gmail.com>
Signed-off-by: Yoon Park <yoongon.park@gmail.com>
Signed-off-by: Yoon Park <yoongon.park@gmail.com>
Signed-off-by: Yoon Park <yoongon.park@gmail.com>
Signed-off-by: Yoon Park <yoongon.park@gmail.com>
Signed-off-by: Yoon Park <yoongon.park@gmail.com>
Signed-off-by: Yoon Park <yoongon.park@gmail.com>
Signed-off-by: Yoon Park <yoongon.park@gmail.com>
Signed-off-by: Yoon Park <yoongon.park@gmail.com>
Signed-off-by: Yoon Park <yoongon.park@gmail.com>
Signed-off-by: Yoon Park <yoongon.park@gmail.com>
Signed-off-by: Yoon Park <yoongon.park@gmail.com>
Signed-off-by: Yoon Park <yoongon.park@gmail.com>
Signed-off-by: Yoon Park <yoongon.park@gmail.com>
Signed-off-by: Yoon Park <yoongon.park@gmail.com>
Signed-off-by: Yoon Park <yoongon.park@gmail.com>
Signed-off-by: Yoon Park <yoongon.park@gmail.com>
@zroubalik
Copy link
Member

zroubalik commented Jul 12, 2023

/run-e2e
Update: You can check the progress here

Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks for the effort! Really appreciate this :)

@zroubalik zroubalik enabled auto-merge (squash) July 12, 2023 16:21
@zroubalik zroubalik merged commit 2a3d9f1 into kedacore:main Jul 12, 2023
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move ScaledJob logic under scale_handler.go
2 participants