fix(tools): migrate legacy community config files on startup - #2740
Open
HandSonic wants to merge 1 commit into
Open
fix(tools): migrate legacy community config files on startup#2740HandSonic wants to merge 1 commit into
HandSonic wants to merge 1 commit into
Conversation
Upgrades from releases that stored the runtime config as
enterprise_config_{env}.json and the client id as enterprise_client_uuid
silently reset systemUuid, network status, and latest startup version and
minted a new client id, because ConfigUtils only looked for the current
runtime_config_{env}.json / client_uuid names. The legacy files are now
copied once to the current names (legacy files kept as backup), with the
legacy names overridable via ProductRuntimeIdentity for other runtimes.
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.
Related issue
N/A — regression found by reviewing the #2732 runtime-identity split; described below.
Summary
Upgrades from 4.0.0 silently reset the runtime config (systemUuid, networkStatus, latestStartupSuccessVersion) and minted a fresh client UUID: ConfigUtils only looks for the current runtime_config_{env}.json / client_uuid names, while 4.0.0 wrote enterprise_config_{env}.json / enterprise_client_uuid in the same directory, and nothing referenced the old names anymore. The client localStorage keys got the same treatment deliberately in a2333f5 — the server-side files were left orphaned.
Fix: one-time legacy migration where the files are resolved — when the current file is absent, a legacy sibling is copied to the current name (legacy files kept untouched as backup; copy via java.nio with logged, non-fatal error handling). Legacy names come from new default methods on ProductRuntimeIdentity (legacyRuntimeConfigFileName/legacyClientIdFileName) so other runtimes can override. No behavior change when the current file exists or neither exists.
Affected surfaces
Verification
Risk and compatibility
Reviewer map
Contributor declaration
AI assistance: substantial — fix and tests drafted with AI assistance, verified locally.