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

Fix lint issue reported by fatcontext #2485

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

alexandear
Copy link
Contributor

@alexandear alexandear commented Jun 27, 2024

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

This PR refactors queueReconcileForWorkloadsOfClusterQueue to avoid using nested contexts, as it has become unwieldy. This issue was identified by the fatcontext linter.

Special notes for your reviewer:

We don't need nested context in our case ctx = ctrl.LoggerInto(ctx, log).

Also, nested contexts may cause performance issues. See more about fat contexts here https://gabnotes.org/fat-contexts/

Does this PR introduce a user-facing change?

Fix performance issue in logging when processing LocalQueues.

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Jun 27, 2024
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 27, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @alexandear. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 27, 2024
Copy link

netlify bot commented Jun 27, 2024

Deploy Preview for kubernetes-sigs-kueue ready!

Name Link
🔨 Latest commit 97a873c
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/667d33f953902b0008dff016
😎 Deploy Preview https://deploy-preview-2485--kubernetes-sigs-kueue.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@alculquicondor alculquicondor left a comment

Choose a reason for hiding this comment

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

oh this looks very problematic

/lgtm
/approve
/ok-to-test
/cherry-pick release-0.7

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 27, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alculquicondor, alexandear

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

The pull request process is described here

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

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 27, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 0a381d28a623cd0b79ffacdab1d1664b47b66ee3

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Jun 27, 2024
@alculquicondor
Copy link
Contributor

/remove-kind cleanup
/kind bug

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. and removed kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Jun 27, 2024
@mbobrovskyi
Copy link
Contributor

/retest

@k8s-ci-robot k8s-ci-robot merged commit 53336e1 into kubernetes-sigs:main Jun 27, 2024
16 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v0.8 milestone Jun 27, 2024
@alculquicondor
Copy link
Contributor

/cherry-pick release-0.7

@k8s-infra-cherrypick-robot
Copy link
Contributor

@alculquicondor: #2485 failed to apply on top of branch "release-0.7":

Applying: Fix lint issue reported by fatcontext
Using index info to reconstruct a base tree...
M	.golangci.yaml
M	pkg/controller/core/workload_controller.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/controller/core/workload_controller.go
CONFLICT (content): Merge conflict in pkg/controller/core/workload_controller.go
Auto-merging .golangci.yaml
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Fix lint issue reported by fatcontext
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-0.7

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.

@alculquicondor
Copy link
Contributor

@alexandear could you prepare a cherry-pick?

@alexandear alexandear deleted the fix-fatcontext-lint branch June 27, 2024 16:09
@alexandear
Copy link
Contributor Author

Cherry-picked in #2492

mbobrovskyi pushed a commit to epam/kubernetes-kueue that referenced this pull request Jun 28, 2024
kannon92 pushed a commit to openshift-kannon92/kubernetes-sigs-kueue that referenced this pull request Nov 19, 2024
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", 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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants