Skip to content

fix(ui): prevent overriding existing console configuration on upgrades#6240

Merged
bluestreak01 merged 5 commits intomasterfrom
jh_console_config_do_not_override
Oct 9, 2025
Merged

fix(ui): prevent overriding existing console configuration on upgrades#6240
bluestreak01 merged 5 commits intomasterfrom
jh_console_config_do_not_override

Conversation

@jerrinot
Copy link
Copy Markdown
Contributor

@jerrinot jerrinot commented Oct 7, 2025

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.

@jerrinot jerrinot added the UI Issues or changes relating to the Web Console label Oct 7, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Oct 7, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Adds 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

Cohort / File(s) Summary
Site extraction overwrite guard
core/src/main/java/io/questdb/Bootstrap.java
Added CONSOLE_CONFIG_PATH and modified extractSite0 so force overwrite is disabled for entries matching the console config path; all other entries still force overwrite. Preserves existing assets/console-configuration.json during extraction.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly summarizes the primary change by stating that the console configuration will no longer be overwritten during upgrades, which directly reflects the implementation details in the pull request.
Description Check ✅ Passed The pull request description specifically explains the intent to prevent custom console configuration from being overwritten on upgrades and notes the associated trade‐off, which directly corresponds to the code changes guarding the console configuration file. This description is clearly related to the changeset and provides meaningful context.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jerrinot
Copy link
Copy Markdown
Contributor Author

jerrinot commented Oct 7, 2025

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Oct 7, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

bluestreak01
bluestreak01 previously approved these changes Oct 7, 2025
@bluestreak01
Copy link
Copy Markdown
Member

@jerrinot this would be dead-easy to regress, we startup servermain routinely from tests, it should be easy to add unit test

@jerrinot
Copy link
Copy Markdown
Contributor Author

jerrinot commented Oct 7, 2025

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

@bluestreak01
Copy link
Copy Markdown
Member

@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

@jerrinot
Copy link
Copy Markdown
Contributor Author

jerrinot commented Oct 8, 2025

@bluestreak01 done

@jerrinot
Copy link
Copy Markdown
Contributor Author

jerrinot commented Oct 9, 2025

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.

@jerrinot
Copy link
Copy Markdown
Contributor Author

jerrinot commented Oct 9, 2025

a macos build failed with:

ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:3.0.0:single (package-web-console) on project questdb: Failed to create assembly: Error creating assembly archive web-console: Problem creating zip: Execution exception: Java heap space -> [Help 1]
[ERROR] 

that's odd.

@glasstiger
Copy link
Copy Markdown
Contributor

[PR Coverage check]

😍 pass : 2 / 2 (100.00%)

file detail

path covered line new line coverage
🔵 io/questdb/Bootstrap.java 2 2 100.00%

@bluestreak01 bluestreak01 merged commit e31351a into master Oct 9, 2025
35 checks passed
@bluestreak01 bluestreak01 deleted the jh_console_config_do_not_override branch October 9, 2025 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

UI Issues or changes relating to the Web Console

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants