TCL-4373: Fix linting issues in workflows and docs#13
TCL-4373: Fix linting issues in workflows and docs#13jplimack-ai wants to merge 14 commits intomasterfrom
Conversation
Remove unnecessary quoted strings in GitHub Actions workflow YAML files, bump action versions (checkout@v4, codeql@v3), upgrade runner images to ubuntu-24.04, fix trailing whitespace in markdown, resolve duplicate top-level headings (MD025), and add trunk + actionlint configuration. TCL-4373
|
Thanks for your PR,
To skip the vendors CIs, Maintainers can use one of:
|
setup-envtest needs a version to download etcd/kube-apiserver binaries. Without it, KUBEBUILDER_ASSETS resolves to empty and tests fail with "etcd: executable file not found in $PATH".
- Migrate .golangci.yml to v2 format with linters grouped by domain - Upgrade golangci-lint from v1.55.2 to v2.10.1 in Makefile and CI - Add ENVTEST_K8S_VERSION to fix envtest etcd resolution - Add lint-fix make target, set GOOS=linux for lint - Fix all staticcheck issues: QF1001 (De Morgan's law), QF1003 (tagged switch), QF1008 (embedded field selectors), QF1012 (Fprintf), S1009 (nil check before len), SA1006 (printf format string), SA1019 (deprecated APIs: wait.PollImmediate, pointer.Int64Ptr), SA6005 (strings.EqualFold) - Replace deprecated k8s.io/utils/pointer with k8s.io/utils/ptr - Replace deprecated wait.PollImmediate with wait.PollUntilContextCancel - Add .vscode/settings.json and trunk config for GOOS=linux
Remove .vscode/* from .gitignore so IDE settings (GOOS=linux) are shared. Update go.mod version from 1.22.4 to 1.22.12.
Pull Request Test Coverage Report for Build 22705733528Details
💛 - Coveralls |
Add t.Parallel() to safe standard Go tests across 4 packages and add -count=1 -parallel=4 to Makefile test targets. Switch all CI jobs from ubuntu-24.04-4core (unavailable) to ubuntu-latest.
Ginkgo suites reject go test's -parallel flag and fail immediately. The t.Parallel() calls still provide parallelism for standard tests using the default GOMAXPROCS concurrency.
The test assumed node1 always drains before node2, but with MaxConcurrentReconciles=50 whichever goroutine grabs the mutex first wins. Use expectNumberOfDrainingNodes to detect which node drained, then drive the rest of the test from that result.
Actionlint rejects constant false conditions. Use vars.ENABLE_E2E so the jobs are skipped by default but can be enabled by setting the repo variable.
Pure Go E2E test that validates operator deployment and reconciliation in a real Kind cluster without SR-IOV hardware. Uses Kind SDK, Docker SDK, and Helm SDK as Go libraries. Adds CI job on ubuntu-24.04-4core. TCL-4378
This reverts commit ca770ca.
|
|
||
| // examine DeletionTimestamp to determine if object is under deletion | ||
| if instance.ObjectMeta.DeletionTimestamp.IsZero() { | ||
| if instance.DeletionTimestamp.IsZero() { |
There was a problem hiding this comment.
Is this a linter issue fix or a logic change?
There was a problem hiding this comment.
lint, ObjectMeta is embedded and doesnt need to be used to reach its fields
| UpdateFunc: dn.operatorConfigChangeHandler, | ||
| }) | ||
|
|
||
| rand.Seed(time.Now().UnixNano()) |
| ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) | ||
| defer cancel() | ||
| err = wait.PollUntilContextCancel(ctx, time.Second, true, func(ctx context.Context) (bool, error) { |
There was a problem hiding this comment.
this one also doesn't seem like a linting issue in a workflow or doc
not that I'm opposed to it but it's really hard to review PRs like this when meaningful changes are sprinkled into a sea of linter changes.
There was a problem hiding this comment.
my small human brain is feeble
There was a problem hiding this comment.
There was a problem hiding this comment.
I get it, but it's hard to have confidence that I'm giving you a good review when different logical changes are mixed together, and the difficulty scales superlinarly with PR size.
| } | ||
| err := cs.Pods(namespace).DeleteCollection(context.Background(), metav1.DeleteOptions{ | ||
| GracePeriodSeconds: pointer.Int64Ptr(0), | ||
| GracePeriodSeconds: ptr.To[int64](0), |
There was a problem hiding this comment.
Should we update the linter/ai rules/etc to prefer new over ptr.To?
There was a problem hiding this comment.
this isnt go 1.26, but i should probably do a larger review and see if we can pull in upstream before making changes
|
This is a fork, are we sure we want to do all this? |
good question, ill do another review and see if we can pull in latest upstream first and where that lands us, as well as turning our changes into a git-patch |

Cleans up GitHub Actions workflows, markdown docs, and Go source to pass all linting with golangci-lint v2 and trunk. This is a prep step for the larger dependency upgrade.
Workflow changes:
name:values,branches:arrays,github-token:expressions,prow-commandsconverted to>-block scalaractions/checkoutv3→v4,actions/setup-gov2→v5,github/codeql-actionv2→v3,golangci-lint-actionv3→v6,upload-artifactv3→v4ubuntu-20.04/ubuntu-22.04→ubuntu-24.04-4corefor image build jobs.github/workflows/Linting & tooling:
.golangci.ymlto v2 format, bumped version in Makefile and CI from v1.55.2 to v2.10.1, all linters grouped by domain with inline commentssetup-envtestfailing to download etcd/kube-apiserver binariesmake lint-fixtarget added — runs golangci-lint with--fix.vscode/settings.json, and trunk config for correct cross-compilation analysis on macOS.trunk/trunk.yamlwith markdownlint, yamllint, actionlint, shellcheck, hadolint, and golangci-lint2 configuredStaticcheck fixes (32 issues):
instance.ObjectMeta.Finalizers→instance.Finalizers)WriteString(fmt.Sprintf(...))withfmt.Fprintflen()(nil slices return 0)wait.PollImmediate→wait.PollUntilContextCancel,wait.ErrWaitTimeout→wait.Interrupted(),k8s.io/utils/pointer→k8s.io/utils/ptrstrings.ToLowercomparison withstrings.EqualFoldDoc changes:
title:from YAML front matter in 4 design docsparallel-node-config.md,software-bridge-management.mdTicket: TCL-4373