Skip to content

KTI-2626: Enable cache redirector for Yarn & NPM#3188

Merged
fzhinkin merged 3 commits into
devfrom
fzhinkin/kc-dev-js-cache-redirector
May 18, 2026
Merged

KTI-2626: Enable cache redirector for Yarn & NPM#3188
fzhinkin merged 3 commits into
devfrom
fzhinkin/kc-dev-js-cache-redirector

Conversation

@fzhinkin
Copy link
Copy Markdown
Contributor

kotlinx-serialization builds executed as part of the Kotlin aggregate build are failing intermittently due networking errors on the Yarn/Npm side. This PR sets up cache redirector.

Ideally, there would be a way to configure it for all projects maintained by the libraries team (such as coroutines, datetime, benchmarks, atomicfu, collections immutable) in a single place, but it seems to be tricky to implement. The main reason for that is reliance on APIs provided by KGP, those APIs depend on a particular KGP version and our libraries use different versions. Which may require slightly different approaches to configure redirection. So for now, it seems like the easiest fix would be making the proposed change.

^KTI-2626

Comment thread buildSrc/src/main/kotlin/cacheRedirector.kt Outdated
Comment thread buildSrc/src/main/kotlin/cacheRedirector.kt Outdated
@fzhinkin fzhinkin requested a review from sandwwraith May 5, 2026 14:04
@sandwwraith
Copy link
Copy Markdown
Member

Looks like we need to re-generate the lock file because hashes are different now (why though?)

@fzhinkin
Copy link
Copy Markdown
Contributor Author

fzhinkin commented May 5, 2026

@sandwwraith, that's because urls are now pointing to cache redirector.

@fzhinkin
Copy link
Copy Markdown
Contributor Author

fzhinkin commented May 6, 2026

Discussed it elsewhere and agreed on setting up the redirector in the main branch, not only for kotlin-community/dev.

@fzhinkin fzhinkin requested a review from sandwwraith May 7, 2026 15:34
@fzhinkin
Copy link
Copy Markdown
Contributor Author

fzhinkin commented May 7, 2026

@sandwwraith, before rebasing it all onto dev I decided to explore "make js cache redirector switchable":

  • turning it off and on no longer require updating the lock file (the part I like)
  • lock file patching become even more complicated (the part I don't like)

WDYT? We can still start with unconditional cache redirection and see if there will be any complaints, and only then consider this approach.

@sandwwraith
Copy link
Copy Markdown
Member

I don't remember many complaints about cache-redirector in 'big' Kotlin (although it does have a switch). IMO we can start without one

@fzhinkin fzhinkin force-pushed the fzhinkin/kc-dev-js-cache-redirector branch from 7167672 to e74251e Compare May 11, 2026 16:52
@fzhinkin fzhinkin changed the base branch from kotlin-community/dev to dev May 11, 2026 16:53
@fzhinkin
Copy link
Copy Markdown
Contributor Author

@sandwwraith, okay, I dropped the flag switching the redirector and rebased the branch onto dev.

@fzhinkin fzhinkin merged commit c23a20e into dev May 18, 2026
4 checks passed
@fzhinkin fzhinkin deleted the fzhinkin/kc-dev-js-cache-redirector branch May 18, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants