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

Remove unused code #755

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

Conversation

panslava
Copy link
Contributor

@panslava panslava commented Aug 27, 2024

/assign @aojea

This shouldn't change any public interfaces, or any functionality, just never used code removed

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 27, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If the repository mantainers determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. sig/network Categorizes an issue or PR as relevant to SIG Network. labels Aug 27, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: panslava
Once this PR has been reviewed and has the lgtm label, please ask for approval from aojea. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@panslava
Copy link
Contributor Author

/test cloud-provider-gcp-verify-up-to-date

@aojea
Copy link
Member

aojea commented Aug 27, 2024

it fails to compile now, hence the jobs are failing, you may need to run gazelle or some of the update scripts

@panslava
Copy link
Contributor Author

oh I accidentally commited next work, that was not supposed to go in this commit, fixing

@bowei
Copy link
Member

bowei commented Aug 27, 2024

was this done using static analysis?

@panslava
Copy link
Contributor Author

@bowei yes, I used golangci-lint "unused" linter, I can add it to the repo

@@ -72,7 +72,6 @@ var (
authSyncNodeURL = pflag.String("auth-sync-node-url", "", "URL for reaching the Auth Service SyncNode API.")
hmsAuthorizeSAMappingURL = pflag.String("hms-authorize-sa-mapping-url", "", "URL for reaching the Hosted Master Service AuthorizeSAMapping API.")
hmsSyncNodeURL = pflag.String("hms-sync-node-url", "", "URL for reaching the Hosted Master Service SyncNode API.")
autopilotEnabled = pflag.Bool("autopilot", false, "Is this a GKE Autopilot cluster.")
Copy link
Member

Choose a reason for hiding this comment

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

if you remove flags, independently they maybe a noop, the manifests using this binary need to be updated or will fail to execute

@aojea
Copy link
Member

aojea commented Aug 27, 2024

I'm not much of a fun of removing code that is unused just because of that, it is not we are charged by number of lines and there is always something that may go wrong ... do we really need to take this risk?

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 27, 2024
@panslava
Copy link
Contributor Author

yeh, tbh, initially I thought that would help me for further stuff, but not really

I remade this pr and ran linter with slightly softer (or stricter lol) rules so now I removed code that should not break anything. Also added linter config

but wouldn't say it's really needed, so feel free to ignore and close

@bowei
Copy link
Member

bowei commented Aug 27, 2024

We should try to delete dead code (otherwise when we will do that?) but flags we need to mark as deprecated or whatnot and keep for a while.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 27, 2024
- Add .golangci.yaml config with only unused linter enabled
@panslava
Copy link
Contributor Author

okay then

  1. brought back removing all the code that seems to be unused
  2. Deprecated the autopilot flag, but didn't remove

linters:
# Disable all linters.
# Default: false
disable-all: true
Copy link
Member

Choose a reason for hiding this comment

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

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 14, 2024
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/network Categorizes an issue or PR as relevant to SIG Network. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants