This is an automated email from the ASF dual-hosted git repository.
roryqi pushed a commit to branch branch-1.1
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/branch-1.1 by this push:
new bbebc98854 [#10035] fix(mcp-server): Use a concrete version of
`fastmcp` to avoid CI error as 3.0.x makes breaking changes(cherry-pick)
(#10038)
bbebc98854 is described below
commit bbebc9885438bb1ae12c9a4c49ffb9bccdd8dc73
Author: Qi Yu <[email protected]>
AuthorDate: Thu Feb 26 15:09:38 2026 +0800
[#10035] fix(mcp-server): Use a concrete version of `fastmcp` to avoid CI
error as 3.0.x makes breaking changes(cherry-pick) (#10038)
### What changes were proposed in this pull request?
This pull request makes a small but important update to the
`mcp-server/pyproject.toml` dependency configuration. The change
temporarily pins the `fastmcp` package to version `2.14.5` due to
incompatible changes in the newer `3.0.x` releases.
* Dependency management: Temporarily pinned `fastmcp` to version
`2.14.5` to avoid incompatibilities introduced in `3.0.x`, with plans to
upgrade in the future.
### Why are the changes needed?
To fix bugs
Fix: #10035
### Does this PR introduce _any_ user-facing change?
N/A
### How was this patch tested?
The CI can cover this change.
---
.../gravitino/integration/test/util/ITUtils.java | 16 +++++++-
.../integration/test/util/TestITUtils.java | 46 ++++++++++++++++++++++
mcp-server/pyproject.toml | 4 +-
3 files changed, 63 insertions(+), 3 deletions(-)
diff --git
a/integration-test-common/src/test/java/org/apache/gravitino/integration/test/util/ITUtils.java
b/integration-test-common/src/test/java/org/apache/gravitino/integration/test/util/ITUtils.java
index e9dbe940da..70862e4de8 100644
---
a/integration-test-common/src/test/java/org/apache/gravitino/integration/test/util/ITUtils.java
+++
b/integration-test-common/src/test/java/org/apache/gravitino/integration/test/util/ITUtils.java
@@ -51,6 +51,8 @@ import org.slf4j.LoggerFactory;
public class ITUtils {
private static final Logger LOG = LoggerFactory.getLogger(ITUtils.class);
+ private static final String CI_ENV = "CI";
+ private static final String GITHUB_ACTIONS_ENV = "GITHUB_ACTIONS";
public static final String TEST_MODE = "testMode";
public static final String EMBEDDED_TEST_MODE = "embedded";
@@ -210,6 +212,10 @@ public class ITUtils {
}
public static void cleanDisk() {
+ if (!isCiEnvironment(System.getenv())) {
+ LOG.info("Skip disk cleanup because current environment is not CI.");
+ return;
+ }
Object output =
CommandExecutor.executeCommandLocalHost(
@@ -220,8 +226,9 @@ public class ITUtils {
"free -m", false, ProcessData.TypesOfData.STREAMS_MERGED,
Map.of());
LOG.info("Before clean: Command free -m output:\n{}", output);
- // Execute docker system prune -af to free up space before starting the
OceanBase container
- ProcessBuilder processBuilder = new ProcessBuilder("/bin/bash", "-c",
"docker system prune -f");
+ // Execute docker container prune -f to clean only stopped containers in
CI.
+ ProcessBuilder processBuilder =
+ new ProcessBuilder("/bin/bash", "-c", "docker container prune -f");
try {
Process process = processBuilder.start();
int exitCode = process.waitFor();
@@ -245,5 +252,10 @@ public class ITUtils {
LOG.info("After clean: Command free -m output:\n{}", output);
}
+ static boolean isCiEnvironment(Map<String, String> env) {
+ return "true".equalsIgnoreCase(env.get(CI_ENV))
+ || "true".equalsIgnoreCase(env.get(GITHUB_ACTIONS_ENV));
+ }
+
private ITUtils() {}
}
diff --git
a/integration-test-common/src/test/java/org/apache/gravitino/integration/test/util/TestITUtils.java
b/integration-test-common/src/test/java/org/apache/gravitino/integration/test/util/TestITUtils.java
new file mode 100644
index 0000000000..cb07597989
--- /dev/null
+++
b/integration-test-common/src/test/java/org/apache/gravitino/integration/test/util/TestITUtils.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.gravitino.integration.test.util;
+
+import java.util.Map;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+
+public class TestITUtils {
+ @Test
+ public void testIsCiEnvironmentByCI() {
+ Assertions.assertTrue(ITUtils.isCiEnvironment(Map.of("CI", "true")));
+ }
+
+ @Test
+ public void testIsCiEnvironmentByGitHubActions() {
+ Assertions.assertTrue(ITUtils.isCiEnvironment(Map.of("GITHUB_ACTIONS",
"true")));
+ }
+
+ @Test
+ public void testIsCiEnvironmentCaseInsensitive() {
+ Assertions.assertTrue(ITUtils.isCiEnvironment(Map.of("CI", "TRUE")));
+ }
+
+ @Test
+ public void testIsCiEnvironmentFalse() {
+ Assertions.assertFalse(ITUtils.isCiEnvironment(Map.of()));
+ Assertions.assertFalse(ITUtils.isCiEnvironment(Map.of("CI", "false")));
+ }
+}
diff --git a/mcp-server/pyproject.toml b/mcp-server/pyproject.toml
index 560773fc1f..8ce3d09426 100644
--- a/mcp-server/pyproject.toml
+++ b/mcp-server/pyproject.toml
@@ -22,7 +22,9 @@ description = "Gravitino MCP server"
readme = "README.md"
requires-python = ">=3.10"
dependencies = [
- "fastmcp>=2.10.6",
+ # fastmcp has been release 3.0.x, which makes some incompatible changes,
so we temporarily pin
+ # it to 2.14.5 to avoid breaking changes.
+ "fastmcp==2.14.5",
"parameterized>=0.9.0",
"pytest>=8.4.1",
"pylint>=2.20.0",