fix(ui): prevent overriding existing console configuration on upgrades#6240
fix(ui): prevent overriding existing console configuration on upgrades#6240bluestreak01 merged 5 commits intomasterfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughAdds a guarded overwrite behavior during site extraction: introduces CONSOLE_CONFIG_PATH and updates extractSite0 to avoid overwriting assets/console-configuration.json if it already exists, while continuing to force overwrite other site files. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Process as Process (startup/upgrade)
participant Bootstrap as Bootstrap.extractSite0
participant Zip as Site ZIP
participant FS as Filesystem
Process->>Bootstrap: extractSite0(siteZip, targetDir)
Bootstrap->>Zip: iterate entries
loop For each entry
Bootstrap->>Bootstrap: isConsoleConfig = (entry.name == CONSOLE_CONFIG_PATH)
alt entry is console config
note right of Bootstrap: Do not force overwrite
Bootstrap->>FS: extract(entry, force=false)
else other entries
note right of Bootstrap: Force overwrite
Bootstrap->>FS: extract(entry, force=true)
end
end
Bootstrap-->>Process: extraction complete
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@jerrinot this would be dead-easy to regress, we startup servermain routinely from tests, it should be easy to add unit test |
|
@bluestreak01 I'll check that. I know we start ServerMain from tests, but the procedure to overwrite public assets is guarded by a version check - it won't overwrite anything unless it's upgrading to a newer version. |
test could fudge the version check, e.g. delete/modify version file to cause server to overwrite |
|
@bluestreak01 done |
|
hm, our tests do not use the build-web-console profile. I tried to add it, but chances are it will make ServerMain tests run longer. let's see. |
|
a macos build failed with: that's odd. |
[PR Coverage check]😍 pass : 2 / 2 (100.00%) file detail
|
This is meant to prevent overriding custom console configs on upgrades.
There is a potential downside: If we ever change the default console config file, then these changes won't propagate during upgrade. So the console must be able to deal with older files.
Data point: The last config file change happened 5+ years ago.cc @emrberk edit: in fact, there was a config change recently.