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

Add KEDAScalersInfo to display important information #6330

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rickbrouwer
Copy link
Contributor

Adding a new event (KEDAScalersInfo) so that important information is shown in e.g. Argo CD.
Added the deprecation info message by the cpu_memory_scaler and ibmmq_scaler.

Checklist

Fixes #6328

@rickbrouwer rickbrouwer requested a review from a team as a code owner November 12, 2024 16:32
@rickbrouwer rickbrouwer marked this pull request as draft November 12, 2024 16:32
@rickbrouwer rickbrouwer force-pushed the scalerinfo branch 5 times, most recently from ee11028 to 0fef06b Compare November 12, 2024 17:12
@rickbrouwer rickbrouwer marked this pull request as ready for review November 12, 2024 17:29
Copy link
Member

@wozniakjan wozniakjan left a comment

Choose a reason for hiding this comment

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

would it be possible to include these events in the TypedConfig deprecated logic?

I can imagine we may want to add something like "DeprecatedEvent" parameter to model this behaviour, because iirc the "Deprecated" parameter present there will error the scaler parsing. Or maybe we change the current behaviour to not fail and throw event instead?

pkg/scalers/cpu_memory_scaler.go Show resolved Hide resolved
@rickbrouwer rickbrouwer marked this pull request as draft November 14, 2024 15:35
@rickbrouwer rickbrouwer force-pushed the scalerinfo branch 7 times, most recently from be3da81 to a9b15b9 Compare November 15, 2024 12:08
@rickbrouwer
Copy link
Contributor Author

rickbrouwer commented Nov 15, 2024

Thank you for the good feedback. In retrospect, it is indeed much better to handle this through TypedConfig. I’ve restructured it accordingly. I created a new parameter called deprecatedAnnounce. This will issue both, an info message (to maintain the 'old' behavior), and an event. This means I’ve removed the info message directly from the scaler, and it now also runs through TypedConfig, so the message only needs to be specified once.

I believe the other 'deprecated' parameter should remain in place. It makes the flow more logical.
First, there will be an announcement, typically for two releases.
After that, it can be converted to deprecated status, triggering an error. This is important because it provides the reason for the scaler's failure if the parameter is still in use.

Perhaps it would be good to set a standard, once something is truly deprecated and causes an error, we keep showing it for two releases and then remove the parameter to keep the code clean.
So in summary:

show 2 releases: deprecatedAnnounce: parameter x is deprecated and will be removed in release x
then remove the deprecatedAnnounce, then;
show 2 releases: deprecated: parameter x is deprecated, use parameter x instead
then remove deprecated tag

What are your thoughts?

@rickbrouwer rickbrouwer marked this pull request as ready for review November 15, 2024 12:54
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.

Thank you for the good feedback. In retrospect, it is indeed much better to handle this through TypedConfig. I’ve restructured it accordingly. I created a new parameter called deprecatedAnnounce. This will issue both, an info message (to maintain the 'old' behavior), and an event. This means I’ve removed the info message directly from the scaler, and it now also runs through TypedConfig, so the message only needs to be specified once.

I believe the other 'deprecated' parameter should remain in place. It makes the flow more logical. First, there will be an announcement, typically for two releases. After that, it can be converted to deprecated status, triggering an error. This is important because it provides the reason for the scaler's failure if the parameter is still in use.

Perhaps it would be good to set a standard, once something is truly deprecated and causes an error, we keep showing it for two releases and then remove the parameter to keep the code clean. So in summary:

show 2 releases: deprecatedAnnounce: parameter x is deprecated and will be removed in release x then remove the deprecatedAnnounce, then; show 2 releases: deprecated: parameter x is deprecated, use parameter x instead then remove deprecated tag

What are your thoughts?

I like this :)

We should document this here: https://github.com/kedacore/governance/blob/main/DEPRECATIONS.md

Copy link
Member

@wozniakjan wozniakjan left a comment

Choose a reason for hiding this comment

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

What are your thoughts?

this is very well thought through from all angles, lgtm

@wozniakjan
Copy link
Member

wozniakjan commented Nov 19, 2024

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

@rickbrouwer
Copy link
Contributor Author

rickbrouwer commented Nov 19, 2024

I like this :)

We should document this here: https://github.com/kedacore/governance/blob/main/DEPRECATIONS.md

That seems like a good plan to me. I will document this there and offer it via a PR.

PR: kedacore/governance#121

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.

New eventreason KEDAScalersInfo to display important information
3 participants