Repository navigation
Reduce cached token restore complexity to fix CI - #6535
Merged
Merged
Conversation
Extract migration persistence to bring cached token restoration below the cyclomatic complexity limit and unblock main CI without changing behavior. Signed-off-by: Radoslav Dimitrov <radoslav@stacklok.com>
rdimitrov
requested review from
ChrisJBurns,
JAORMX,
jhrozek and
tgrunnagle
as code owners
September 8, 2026 09:51
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6535 +/- ##
==========================================
+ Coverage 78.67% 78.71% +0.04%
==========================================
Files 777 777
Lines 76686 76687 +1
==========================================
+ Hits 60334 60367 +33
+ Misses 16347 16315 -32
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jhrozek
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Latest main (
c4f6cb4a3) fails Go linting becausetryRestoreFromCachedTokenshas cyclomatic complexity 18, exceeding the limit of 15. Extract legacy token migration persistence into a private helper, reducing the function's complexity to 14 while preserving token verification order, authorization-server binding, fallback values, and error handling.Type of change
Test plan
task test) — running locallytask test-e2e)task lint-fix) — passed with CI's golangci-lint v2.13.2Existing cached-token migration tests exercise the extracted path and verify the persisted issuer and token endpoint binding. Code review confirmed this is a behavior-preserving extraction.
Does this introduce a user-facing change?
No.