Skip to content

[#10705] improvement(build): add switch to enable web-ui in configuration and gradlew build parameter#10706

Open
yuqi1129 wants to merge 3 commits intomainfrom
fix-10705-skip-web-war
Open

[#10705] improvement(build): add switch to enable web-ui in configuration and gradlew build parameter#10706
yuqi1129 wants to merge 3 commits intomainfrom
fix-10705-skip-web-war

Conversation

@yuqi1129
Copy link
Copy Markdown
Contributor

@yuqi1129 yuqi1129 commented Apr 8, 2026

What changes were proposed in this pull request?

  • Add -PskipWebWar=true support to skip web/web-v2 war build and packaging.
  • Add gravitino.server.webui.enable (default true) and make GravitinoServer respect it, so deploy mode can start without war when web is skipped.
  • Update integration-test build scripts to make web build dependency optional under skipWebWar.
  • Update non-frontend GitHub workflows to pass -PskipWebWar=true.
  • Add server test to verify startup with web UI disabled.

Why are the changes needed?

In many non-frontend scenarios (especially integration tests), building web war is unnecessary and slows CI. This change avoids that cost while keeping server startup valid.

Fix: #10705

Does this PR introduce any user-facing change?

  • New config: gravitino.server.webui.enable (default true).
  • New build property: -PskipWebWar=true.

How was this patch tested?

  • ./gradlew --no-daemon :server:test -PskipITs
  • ./gradlew --no-daemon compileDistribution -PskipWebWar=true -x test
  • Local sanity check for CI arg compatibility: ./gradlew help -PskipWebWar=true -q

Add a skipWebWar Gradle property to bypass web/web-v2 war build and packaging for non-frontend scenarios. Introduce gravitino.server.webui.enable to allow server startup without web war in deploy mode, and wire CI workflows to use -PskipWebWar=true except frontend jobs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 8, 2026 02:35
@yuqi1129 yuqi1129 changed the title [#10705] fix(build): support skipping web war packaging [#10705] improvement(build): support skipping web war packaging Apr 8, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a Gradle property to optionally skip building/packaging the Web UI WARs and introduces a server configuration flag to allow starting Gravitino without the Web UI when those WARs are omitted (useful for faster CI/integration-test scenarios).

Changes:

  • Add -PskipWebWar=true support to avoid building/copying web and web-v2 WARs during distribution packaging and some integration-test setups.
  • Introduce gravitino.server.webui.enable (default true) and wire it into server startup so Jetty can run without WARs when UI is disabled.
  • Update multiple non-frontend GitHub workflows to pass -PskipWebWar=true.

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
build.gradle.kts Makes compileDistribution optionally skip Web WAR build/copy; attempts to flip the packaged config when skipping.
core/src/main/java/org/apache/gravitino/Configs.java Adds Configs.SERVER_UI_ENABLED config entry.
conf/gravitino.conf.template Documents and defaults gravitino.server.webui.enable=true.
server/src/main/java/org/apache/gravitino/server/GravitinoServer.java Passes UI-enable flag into Jetty initialization; removes Web UI filter registration.
server/src/test/java/org/apache/gravitino/server/TestGravitinoServer.java Adds a startup test intended to cover “UI disabled” mode.
web/integration-test/build.gradle.kts Makes web build dependency optional under skipWebWar.
web-v2/integration-test/build.gradle.kts Makes web-v2 build dependency optional under skipWebWar.
.github/workflows/*.yml Propagates -PskipWebWar=true to non-frontend workflows to reduce CI cost.

Comment on lines +103 to +120
@Test
public void testStartAndStopWithWebUiDisabled() throws Exception {
ServerConfig config = new ServerConfig();
config.loadFromMap(
ImmutableMap.of(
GravitinoServer.WEBSERVER_CONF_PREFIX + JettyServerConfig.WEBSERVER_HTTP_PORT.getKey(),
String.valueOf(RESTUtils.findAvailablePort(5000, 6000)),
Configs.SERVER_UI_ENABLED.getKey(),
"false",
AuxiliaryServiceManager.GRAVITINO_AUX_SERVICE_PREFIX
+ AuxiliaryServiceManager.AUX_SERVICE_NAMES,
""),
t -> true);
GravitinoServer localServer = new GravitinoServer(config, GravitinoEnv.getInstance());
localServer.initialize();
localServer.start();
localServer.stop();
}
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new test likely doesn’t validate the intended behavior because unit tests run with GRAVITINO_TEST set (see server/build.gradle.kts), and JettyServer already tolerates missing WARs in that mode even when UI is enabled. As a result, the test would still pass if Configs.SERVER_UI_ENABLED were ignored. Consider strengthening it by asserting that UI is actually disabled (e.g., verify JettyServer.initialize is called with shouldEnableUI=false, or assert the server uses the basic ServletContextHandler instead of WebAppContext, or run a forked test without GRAVITINO_TEST).

Copilot generated this review using guidance from repository custom instructions.
Re-add WebUIFilter registrations guarded by gravitino.server.webui.enable. This keeps historical UI redirect behavior for enabled UI while preserving no-web startup when disabled.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

Code Coverage Report

Overall Project 65.18% +0.11% 🟢
Files changed 86.63% 🟢

Module Coverage
aliyun 1.73% 🔴
api 47.14% 🟢
authorization-common 85.96% 🟢
aws 1.1% 🔴
azure 2.6% 🔴
catalog-common 10.2% 🔴
catalog-fileset 80.02% 🟢
catalog-hive 80.98% 🟢
catalog-jdbc-clickhouse 79.06% 🟢
catalog-jdbc-common 42.89% 🟢
catalog-jdbc-doris 80.28% 🟢
catalog-jdbc-hologres 54.03% 🟢
catalog-jdbc-mysql 79.23% 🟢
catalog-jdbc-oceanbase 78.38% 🟢
catalog-jdbc-postgresql 82.05% 🟢
catalog-jdbc-starrocks 78.27% 🟢
catalog-kafka 77.01% 🟢
catalog-lakehouse-generic 45.07% 🟢
catalog-lakehouse-hudi 79.1% 🟢
catalog-lakehouse-iceberg 87.27% 🟢
catalog-lakehouse-paimon 77.71% 🟢
catalog-model 77.72% 🟢
cli 44.51% 🟢
client-java 77.63% 🟢
common 49.35% 🟢
core 81.42% +0.2% 🟢
filesystem-hadoop3 76.97% 🟢
flink 40.55% 🟢
flink-runtime 0.0% 🔴
gcp 14.2% 🔴
hadoop-common 10.39% 🔴
hive-metastore-common 45.82% 🟢
iceberg-common 50.73% 🟢
iceberg-rest-server 65.82% 🟢
integration-test-common 0.0% 🔴
jobs 66.17% 🟢
lance-common 23.88% 🔴
lance-rest-server 57.84% 🟢
lineage 53.02% 🟢
optimizer 82.95% 🟢
optimizer-api 21.95% 🔴
server 85.9% -1.16% 🟢
server-common 70.3% 🟢
spark 32.79% 🔴
spark-common 39.09% 🔴
trino-connector 33.83% 🔴
Files
Module File Coverage
core Configs.java 98.86% 🟢
server GravitinoServer.java 60.8% 🟢

@yuqi1129 yuqi1129 requested review from LauraXia123 and diqiu50 April 8, 2026 10:05

// Frontend tests depend on the web page, so we need to build the web module first.
dependsOn(":web-v2:web:build")
if (!skipWebWar) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not skip the entire web module? The comment above says the frontend tests depend on the web build, but you only removed the build step.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not introduce a skipWeb option to skip everything related to the web module?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix

dependsOn(":catalogs:catalog-kafka:jar", ":catalogs:catalog-kafka:runtimeJars")

// Frontend tests depend on the web page, so we need to build the web module first.
dependsOn(":web:web:build")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issues

build.gradle.kts Outdated
from(projectDir.dir("bin")) { into("package/bin") }
from(projectDir.dir("web/web/build/libs/${rootProject.name}-web-$version.war")) { into("package/web") }
from(projectDir.dir("web-v2/web/build/libs/${rootProject.name}-web-$version.war")) { into("package/web-v2") }
if (!skipWebWar) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we check whether this condition is really necessary? If the web module has no build artifacts, copying it shouldn’t have any effect anyway, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@yuqi1129
Copy link
Copy Markdown
Contributor Author

Addressed the review suggestions for #10705 in commit 557dae8:

  • Introduced -PskipWeb=true at root build level, and treat it as a stronger switch than skipWebWar (skipFrontend = skipWeb || skipWebWar).
  • When skipWeb=true, disable tasks in :web:web, :web-v2:web, :web:integration-test, and :web-v2:integration-test so frontend-related module tasks do not run.
  • Kept frontend IT modules compatible by making their web build dependency conditional on !skipFrontend.
  • Updated non-frontend CI workflows to use -PskipWeb=true so they skip frontend work by default.

Validation done locally:

  • ./gradlew --no-daemon :server:test -PskipITs
  • ./gradlew --no-daemon compileDistribution -PskipWeb=true -x test

Also, the earlier WebUIFilter conditional registration fix has already been included in this PR.

@yuqi1129 yuqi1129 requested a review from diqiu50 April 10, 2026 09:06
@diqiu50
Copy link
Copy Markdown
Contributor

diqiu50 commented Apr 10, 2026

Please update the pr description

@yuqi1129 yuqi1129 changed the title [#10705] improvement(build): support skipping web war packaging [#10705] improvement(build): add switch to enable web-ui in configuration and gradlew build parameter Apr 10, 2026
@jerryshao
Copy link
Copy Markdown
Contributor

My initial feeling is that this makes the thing too complex. I need to take a deep look.


val skipWeb: Boolean = (project.findProperty("skipWeb") as? String)?.toBoolean() ?: false
val skipWebWar: Boolean = (project.findProperty("skipWebWar") as? String)?.toBoolean() ?: false
val skipFrontend: Boolean = skipWeb || skipWebWar
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add three different properties makes things so complicated, do we have a simple solution?


tasks.test {
val skipWeb = (rootProject.findProperty("skipWeb") as? String)?.toBoolean() ?: false
val skipWebWar = (rootProject.findProperty("skipWebWar") as? String)?.toBoolean() ?: false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the skipWebWar need to be removed?
if you remove it, the skipFrontend will not be useful

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.

[Improvement] Add switch to package web UI

4 participants