Skip to content

Bump go 1.24.0 and fix 'usetesting' linter - #7783

Merged
cert-manager-prow[bot] merged 4 commits into
cert-manager:masterfrom
inteon:fix_usetesting_linter
Jun 6, 2025
Merged

cert-manager-prow[bot] merged 4 commits into
cert-manager:masterfrom
inteon:fix_usetesting_linter

Conversation

@inteon

@inteon inteon commented Jun 5, 2025

Copy link
Copy Markdown
Member

Bumps the minimum go version to 1.24 (in preparation for a kubernetes library upgrade).

This allows us to use t.Context(). The 'usetesting' linter finds that we do not use this context everywhere possible.

Kind

/kind cleanup

Release Note

NONE

@cert-manager-prow cert-manager-prow Bot 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. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. labels Jun 5, 2025
@inteon
inteon requested a review from erikgb June 5, 2025 19:27
@cert-manager-prow cert-manager-prow Bot added area/acme Indicates a PR directly modifies the ACME Issuer code area/acme/dns01 Indicates a PR modifies ACME DNS01 provider code area/acme/http01 Indicates a PR modifies ACME HTTP01 provider code area/testing Issues relating to testing area/vault Indicates a PR directly modifies the Vault Issuer code size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 5, 2025

@erikgb erikgb 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
/approve

@cert-manager-prow cert-manager-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 5, 2025
@cert-manager-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: erikgb

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

@cert-manager-prow cert-manager-prow Bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed lgtm Indicates that a PR is ready to be merged. labels Jun 5, 2025
@inteon
inteon force-pushed the fix_usetesting_linter branch 2 times, most recently from 9e68baa to 9c68a88 Compare June 5, 2025 20:13
@inteon
inteon force-pushed the fix_usetesting_linter branch 2 times, most recently from 638bad5 to 6aff79b Compare June 6, 2025 07:43
@cert-manager-prow cert-manager-prow Bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 6, 2025
@inteon
inteon force-pushed the fix_usetesting_linter branch 4 times, most recently from e081d53 to 0413a5f Compare June 6, 2025 08:52
@inteon
inteon force-pushed the fix_usetesting_linter branch from 0413a5f to c5559e0 Compare June 6, 2025 09:39
@inteon

inteon commented Jun 6, 2025

Copy link
Copy Markdown
Member Author

/retest

Comment thread pkg/server/tls/dynamic_source_test.go Resolved
@inteon
inteon force-pushed the fix_usetesting_linter branch from c5559e0 to 9ede3c9 Compare June 6, 2025 13:15
@inteon
inteon requested a review from erikgb June 6, 2025 13:22
@inteon

inteon commented Jun 6, 2025

Copy link
Copy Markdown
Member Author

/retest

@erikgb erikgb 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.

Thanks @inteon! A lot of changes in the PR, but most of them are "boring". 😆 This is nice improvement to test code, and if we discover any test issues after merge, I presume they should be fixable.

/lgtm
/hold

Feel free to unhold. I was just surprised to see so much complexity in one of the tests.

}()
defer func() {
shutdownCtx, cancel := context.WithTimeout(context.Background(), time.Second*5)
shutdownCtx, cancel := context.WithTimeout(context.WithoutCancel(t.Context()), time.Second*5)

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.

The code in this area appears very complex. Lots of cleanup and defers. Any possibility to simplify? Eventually in a follow-up PR?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This code makes sense, shutdown contexts should always use context.WithTimeout(context.WithoutCancel(ctx), [timeout]) since the context (in this case t.Context()) might have been canceled already.

@cert-manager-prow cert-manager-prow Bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. labels Jun 6, 2025
@inteon

inteon commented Jun 6, 2025

Copy link
Copy Markdown
Member Author

/unhold

@cert-manager-prow cert-manager-prow Bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 6, 2025
@cert-manager-prow
cert-manager-prow Bot merged commit d9e543f into cert-manager:master Jun 6, 2025
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. area/acme/dns01 Indicates a PR modifies ACME DNS01 provider code area/acme/http01 Indicates a PR modifies ACME HTTP01 provider code area/acme Indicates a PR directly modifies the ACME Issuer code area/testing Issues relating to testing area/vault Indicates a PR directly modifies the Vault Issuer code dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants