Skip to content

Replace duplicate intMax helpers with builtin max - #16665

Merged
knative-prow[bot] merged 2 commits into
knative:mainfrom
jahnavigajjala-3:cleanup/replace-intmax-with-max
Jul 29, 2026
Merged

knative-prow[bot] merged 2 commits into
knative:mainfrom
jahnavigajjala-3:cleanup/replace-intmax-with-max

Conversation

@jahnavigajjala-3

Copy link
Copy Markdown
Contributor

Fixes #16664

Proposed Changes

  • Replace the duplicated intMax helpers in the KPA and HPA reconcilers with Go's built-in max() function.
  • Remove the now-unused intMax helper implementations from both packages.
  • Rename the local max variable in kpa/scaler.go to maxScale to avoid shadowing the built-in max() function.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 18, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: jahnavigajjala-3 / name: jahnavigajjala3-commits (c1256e3)

@knative-prow

knative-prow Bot commented Jul 18, 2026

Copy link
Copy Markdown

Welcome @jahnavigajjala-3! It looks like this is your first PR to knative/serving 🎉

@knative-prow knative-prow Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 18, 2026
@knative-prow

knative-prow Bot commented Jul 18, 2026

Copy link
Copy Markdown

Hi @jahnavigajjala-3. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@linkvt linkvt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm
/ok-to-test

min could be renamed to minScale to avoid also shadowing the builtin min but this is preexisting.

@knative-prow knative-prow Bot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Jul 18, 2026
@knative-prow knative-prow Bot added lgtm Indicates that a PR is ready to be merged. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 18, 2026
@codecov

codecov Bot commented Jul 18, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.34%. Comparing base (333e58c) to head (a2aa379).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
pkg/reconciler/autoscaling/hpa/hpa.go 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16665      +/-   ##
==========================================
+ Coverage   80.30%   80.34%   +0.04%     
==========================================
  Files         217      217              
  Lines       13568    13560       -8     
==========================================
- Hits        10896    10895       -1     
+ Misses       2308     2302       -6     
+ Partials      364      363       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@knative-prow knative-prow Bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 18, 2026
@linkvt

linkvt commented Jul 18, 2026

Copy link
Copy Markdown
Member

/lgtm

@knative-prow knative-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 18, 2026
@linkvt

linkvt commented Jul 18, 2026

Copy link
Copy Markdown
Member

/retest

@dsimansk

Copy link
Copy Markdown
Contributor

@jahnavigajjala-3 could you to rebase this PR pls? There's was a fix merged to GH action setup.

@jahnavigajjala-3
jahnavigajjala-3 force-pushed the cleanup/replace-intmax-with-max branch from 09397af to a2aa379 Compare July 28, 2026 12:54
@knative-prow knative-prow Bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 28, 2026
@jahnavigajjala-3

Copy link
Copy Markdown
Contributor Author

@dsimansk ,Done, thanks!

@dsimansk

Copy link
Copy Markdown
Contributor

/approve
/lgtm

@knative-prow knative-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 28, 2026
@knative-prow

knative-prow Bot commented Jul 28, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dsimansk, jahnavigajjala-3

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 28, 2026
@dsimansk

Copy link
Copy Markdown
Contributor

/test istio-latest-no-mesh

@dsimansk

Copy link
Copy Markdown
Contributor

/retest

@knative-prow
knative-prow Bot merged commit 7ed4aa2 into knative:main Jul 29, 2026
109 of 110 checks passed
@jahnavigajjala-3
jahnavigajjala-3 deleted the cleanup/replace-intmax-with-max branch August 12, 2026 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consolidate duplicate intMax helper in KPA and HPA reconcilers

3 participants