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

Deprecation cleanup for 2.12 release #4806

Merged
merged 5 commits into from
Aug 23, 2023

Conversation

dttung2905
Copy link
Contributor

@dttung2905 dttung2905 commented Jul 17, 2023

Hi team,

I did a cleanup for 2.12 which is going to be released somewhere in Sept 2023. 🙏 . Its still a WIP and I will update the keda-docs repo later

Checklist

Fixes: #4899

@dttung2905 dttung2905 requested a review from a team as a code owner July 17, 2023 14:03
@github-actions
Copy link

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

🏖️ Over the summer, the response time will be longer than usual due to maintainers taking time off so please bear with us.

While you are waiting, make sure to:

Learn more about:

.github/workflows/release-build.yml Outdated Show resolved Hide resolved
pkg/scalers/azure_blob_scaler.go Show resolved Hide resolved
pkg/scalers/azure_log_analytics_scaler.go Show resolved Hide resolved
pkg/scalers/cassandra_scaler.go Show resolved Hide resolved
pkg/scalers/couchdb_scaler.go Show resolved Hide resolved
pkg/scalers/mongo_scaler.go Show resolved Hide resolved
pkg/scalers/mssql_scaler.go Show resolved Hide resolved
pkg/scalers/postgresql_scaler.go Show resolved Hide resolved
pkg/scalers/prometheus_scaler.go Show resolved Hide resolved
pkg/scalers/rabbitmq_scaler.go Show resolved Hide resolved
@dttung2905
Copy link
Contributor Author

@JorTurFer I will take a look at the failed CI test. https://github.com/kedacore/keda/actions/runs/5600564910/jobs/10243134785?pr=4806. Seems like the removal of the CI breaks something 😆

Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

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

Looking good, just an small nit inline.
Could you update changelog adding this breaking change?
We should review docs as well to remove the parameter from both places at once

meta.MetricName = kedautil.NormalizeString(fmt.Sprintf("azure-blob-%s", meta.BlobContainerName))
}

meta.MetricName = kedautil.NormalizeString(fmt.Sprintf("azure-blob-%s", meta.BlobContainerName))
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to generate this here? I mean, if we have only one option for MetricName and it's used once, maybe we could remove the object variable and generate the name wherever is used. WDYT? (If you agree, this also applies to other scalers)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. I just did another round of refactoring to remove this metricName object var. Added a few test cases. Please help me review it 🙏

@JorTurFer
Copy link
Member

Could you resolve the conflicts with .github/workflows/release-build.yml? 🙏

@dttung2905
Copy link
Contributor Author

Thanks @JorTurFer 😄. I will resolve the conflct in .github/workflows/release-build.yml later tonight when I try to fix the rest of the unit test for other scalers too

@JorTurFer
Copy link
Member

Sure, no rush at all 😄
I have just reviewed some PRs xD

@dttung2905 dttung2905 force-pushed the clean-up-2-12-deprecation branch 2 times, most recently from fa09231 to 6611c38 Compare August 5, 2023 03:22
@JorTurFer
Copy link
Member

we should update this comment too:

if kedacontrollerutil.Contains(externalMetricNames, externalMetricName) {
return nil, fmt.Errorf("metricName %s defined multiple times in ScaledObject %s, please refer the documentation how to define metricName manually", externalMetricName, scaledObject.Name)
}

@dttung2905
Copy link
Contributor Author

we should update this comment too:

if kedacontrollerutil.Contains(externalMetricNames, externalMetricName) {
return nil, fmt.Errorf("metricName %s defined multiple times in ScaledObject %s, please refer the documentation how to define metricName manually", externalMetricName, scaledObject.Name)
}

@JorTurFer wdyt about this ?

return nil, fmt.Errorf("metricName %s defined multiple times in ScaledObject %s. metricName is deprecated except for some few particular scalers. Please refer to the documentation whether metricName is required ", externalMetricName, scaledObject.Name)

@JorTurFer
Copy link
Member

we should update this comment too:

if kedacontrollerutil.Contains(externalMetricNames, externalMetricName) {
return nil, fmt.Errorf("metricName %s defined multiple times in ScaledObject %s, please refer the documentation how to define metricName manually", externalMetricName, scaledObject.Name)
}

@JorTurFer wdyt about this ?

return nil, fmt.Errorf("metricName %s defined multiple times in ScaledObject %s. metricName is deprecated except for some few particular scalers. Please refer to the documentation whether metricName is required ", externalMetricName, scaledObject.Name)

I'd just say something like:

return nil, fmt.Errorf("metricName %s defined multiple times in ScaledObject %s", externalMetricName, scaledObject.Name)

It's something that never should happen thanks to the index in the prefix, and if it happens, we should review them in the code, so opening an issue is worth

{map[string]string{"metricName": "testName", "tenantIdFromEnv": "d248da64-0e1e-4f79-b8c6-72ab7aa055eb", "clientIdFromEnv": "41826dd4-9e0a-4357-a5bd-a88ad771ea7d", "clientSecretFromEnv": "U6DtAX5r6RPZxd~l12Ri3X8J9urt5Q-xs", "workspaceIdFromEnv": "074dd9f8-c368-4220-9400-acb6e80fc325", "query": query, "threshold": "1900000000"}, 1, "azure-log-analytics-testName"},
}

func TestLogAnalyticsParseMetadataMetricName(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I remove this chunk because it is testing against an object variable metricName which we don't use

@@ -251,7 +239,7 @@ func (s *prometheusScaler) Close(context.Context) error {
}

func (s *prometheusScaler) GetMetricSpecForScaling(context.Context) []v2.MetricSpec {
metricName := kedautil.NormalizeString(fmt.Sprintf("prometheus-%s", s.metadata.metricName))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JorTurFer Do you have any context why we have another extra prometheus prefix here . I will just remove it. wdyt?

@dttung2905 dttung2905 changed the title WIP: Deprecation cleanup for 2.12 release Deprecation cleanup for 2.12 release Aug 23, 2023
@JorTurFer JorTurFer reopened this Aug 23, 2023
Copy link
Member

@JorTurFer JorTurFer 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 this contribution! 💪

@JorTurFer JorTurFer enabled auto-merge (squash) August 23, 2023 14:57
@JorTurFer
Copy link
Member

JorTurFer commented Aug 23, 2023

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

@JorTurFer JorTurFer merged commit 1f4a685 into kedacore:main Aug 23, 2023
29 checks passed
yoongon pushed a commit to yoongon/keda that referenced this pull request Aug 26, 2023
novicr pushed a commit to novicr/keda that referenced this pull request Aug 26, 2023
Adarsh-verma-14 pushed a commit to Adarsh-verma-14/keda that referenced this pull request Sep 4, 2023
toniiiik pushed a commit to toniiiik/keda that referenced this pull request Jan 15, 2024
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.

Deprecation cleanup for 2.12 release
2 participants