From 2e033c4bf0caa918466de9b4894ad64041541307 Mon Sep 17 00:00:00 2001 From: frf12 Date: Sat, 5 Dec 2026 02:06:22 +0800 Subject: [PATCH 1/2] fix(deps): avoid incompatible FastAPI telemetry dependencies --- .github/workflows/native-service.yml | 6 +++--- e2e/bub/uv.lock | 4 ++-- evaluation/uv.lock | 4 ++-- pyproject.toml | 3 ++- scripts/upgrade_release_gate.py | 2 ++ tests/release_upgrades/README.md | 5 ++++- tests/release_upgrades/compatibility-constraints.txt | 3 +++ uv.lock | 4 ++-- 8 files changed, 20 insertions(+), 11 deletions(-) create mode 100644 tests/release_upgrades/compatibility-constraints.txt diff --git a/.github/workflows/native-service.yml b/.github/workflows/native-service.yml index 2df09b2680..563c5a96a8 100644 --- a/.github/workflows/native-service.yml +++ b/.github/workflows/native-service.yml @@ -56,7 +56,7 @@ jobs: uv venv .native-venv uv pip install --python .native-venv/bin/python "powercontext[cli,server] @ file://$PWD/$wheel" pytest uv venv .native-source-venv - uv pip install --python .native-source-venv/bin/python "powercontext[cli,server] @ https://files.pythonhosted.org/packages/30/bd/463f998f8794bc7f8ff588d47157ca0e62dd03a9f3ae466e2eb34fb66045/powercontext-1.3.0-py3-none-any.whl#sha256=8da7983763f3a6ab80b413c770a4973a46c557a54e1a1fa675099e58d47305e5" + uv pip install --python .native-source-venv/bin/python "powercontext[cli,server] @ https://files.pythonhosted.org/packages/30/bd/463f998f8794bc7f8ff588d47157ca0e62dd03a9f3ae466e2eb34fb66045/powercontext-1.3.0-py3-none-any.whl#sha256=8da7983763f3a6ab80b413c770a4973a46c557a54e1a1fa675099e58d47305e5" --constraint tests/release_upgrades/compatibility-constraints.txt echo "POWERCONTEXT_NATIVE_UPGRADE_SOURCE_PYTHON=$PWD/.native-source-venv/bin/python" >> "$GITHUB_ENV" - name: Exercise the real systemd user lifecycle @@ -114,7 +114,7 @@ jobs: # runs the cold-start lifecycle under its bounded startup deadline. uv pip install --compile-bytecode --python .native-venv/bin/python "powercontext[cli,server] @ file://$PWD/$wheel" pytest uv venv .native-source-venv - uv pip install --compile-bytecode --python .native-source-venv/bin/python "powercontext[cli,server] @ https://files.pythonhosted.org/packages/30/bd/463f998f8794bc7f8ff588d47157ca0e62dd03a9f3ae466e2eb34fb66045/powercontext-1.3.0-py3-none-any.whl#sha256=8da7983763f3a6ab80b413c770a4973a46c557a54e1a1fa675099e58d47305e5" + uv pip install --compile-bytecode --python .native-source-venv/bin/python "powercontext[cli,server] @ https://files.pythonhosted.org/packages/30/bd/463f998f8794bc7f8ff588d47157ca0e62dd03a9f3ae466e2eb34fb66045/powercontext-1.3.0-py3-none-any.whl#sha256=8da7983763f3a6ab80b413c770a4973a46c557a54e1a1fa675099e58d47305e5" --constraint tests/release_upgrades/compatibility-constraints.txt echo "POWERCONTEXT_NATIVE_UPGRADE_SOURCE_PYTHON=$PWD/.native-source-venv/bin/python" >> "$GITHUB_ENV" - name: Exercise the real LaunchAgent lifecycle @@ -169,7 +169,7 @@ jobs: uv venv .native-venv uv pip install --python .native-venv\Scripts\python.exe "powercontext[cli,server] @ $wheelUri" pytest uv venv .native-source-venv - uv pip install --python .native-source-venv\Scripts\python.exe "powercontext[cli,server] @ https://files.pythonhosted.org/packages/30/bd/463f998f8794bc7f8ff588d47157ca0e62dd03a9f3ae466e2eb34fb66045/powercontext-1.3.0-py3-none-any.whl#sha256=8da7983763f3a6ab80b413c770a4973a46c557a54e1a1fa675099e58d47305e5" + uv pip install --python .native-source-venv\Scripts\python.exe "powercontext[cli,server] @ https://files.pythonhosted.org/packages/30/bd/463f998f8794bc7f8ff588d47157ca0e62dd03a9f3ae466e2eb34fb66045/powercontext-1.3.0-py3-none-any.whl#sha256=8da7983763f3a6ab80b413c770a4973a46c557a54e1a1fa675099e58d47305e5" --constraint tests/release_upgrades/compatibility-constraints.txt "POWERCONTEXT_NATIVE_UPGRADE_SOURCE_PYTHON=$PWD\.native-source-venv\Scripts\python.exe" >> $env:GITHUB_ENV - name: Verify binary cursor persistence and restart compatibility diff --git a/e2e/bub/uv.lock b/e2e/bub/uv.lock index 85cd1c7627..c4cd7e8524 100644 --- a/e2e/bub/uv.lock +++ b/e2e/bub/uv.lock @@ -1731,8 +1731,8 @@ requires-dist = [ { name = "opendal", marker = "extra == 'knowledge-base'", specifier = ">=0.46,<1" }, { name = "opentelemetry-api", marker = "extra == 'cli'", specifier = ">=1.30,<2" }, { name = "opentelemetry-api", marker = "extra == 'client'", specifier = ">=1.30,<2" }, - { name = "opentelemetry-api", marker = "extra == 'ops'", specifier = ">=1.30,<2" }, - { name = "opentelemetry-api", marker = "extra == 'server'", specifier = ">=1.30,<2" }, + { name = "opentelemetry-api", marker = "extra == 'ops'", specifier = ">=1.30,<1.46" }, + { name = "opentelemetry-api", marker = "extra == 'server'", specifier = ">=1.30,<1.46" }, { name = "opentelemetry-exporter-otlp-proto-http", marker = "extra == 'tracing-otlp'", specifier = ">=1.30,<2" }, { name = "opentelemetry-sdk", marker = "extra == 'ops'", specifier = ">=1.30,<2" }, { name = "opentelemetry-sdk", marker = "extra == 'server'", specifier = ">=1.30,<2" }, diff --git a/evaluation/uv.lock b/evaluation/uv.lock index eedd280e40..b120f1001e 100644 --- a/evaluation/uv.lock +++ b/evaluation/uv.lock @@ -1887,8 +1887,8 @@ requires-dist = [ { name = "opendal", marker = "extra == 'knowledge-base'", specifier = ">=0.46,<1" }, { name = "opentelemetry-api", marker = "extra == 'cli'", specifier = ">=1.30,<2" }, { name = "opentelemetry-api", marker = "extra == 'client'", specifier = ">=1.30,<2" }, - { name = "opentelemetry-api", marker = "extra == 'ops'", specifier = ">=1.30,<2" }, - { name = "opentelemetry-api", marker = "extra == 'server'", specifier = ">=1.30,<2" }, + { name = "opentelemetry-api", marker = "extra == 'ops'", specifier = ">=1.30,<1.46" }, + { name = "opentelemetry-api", marker = "extra == 'server'", specifier = ">=1.30,<1.46" }, { name = "opentelemetry-exporter-otlp-proto-http", marker = "extra == 'tracing-otlp'", specifier = ">=1.30,<2" }, { name = "opentelemetry-sdk", marker = "extra == 'ops'", specifier = ">=1.30,<2" }, { name = "opentelemetry-sdk", marker = "extra == 'server'", specifier = ">=1.30,<2" }, diff --git a/pyproject.toml b/pyproject.toml index c788b1c3c5..e98a70288b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -93,7 +93,8 @@ server = [ "httpx>=0.28,<1", "jinja2>=3.1.6,<4", "markdown-it-py>=4,<5", - "opentelemetry-api>=1.30,<2", + # FastAPI 0.165.1 passes logger arguments positionally; 1.46 makes them keyword-only. + "opentelemetry-api>=1.30,<1.46", "opentelemetry-sdk>=1.30,<2", "platformdirs>=4,<5", "powercontext[builtin]", diff --git a/scripts/upgrade_release_gate.py b/scripts/upgrade_release_gate.py index 62e1525c80..aabb5d9970 100644 --- a/scripts/upgrade_release_gate.py +++ b/scripts/upgrade_release_gate.py @@ -421,6 +421,8 @@ def run_case(root: Path, wheel: Path, case: dict[str, Any], output: Path) -> dic ) python = venv / ("Scripts/python.exe" if os.name == "nt" else "bin/python") install = ["uv", "pip", "install", "--python", str(python), package, *engine_requirement] + if role == "source": + install.extend(["--constraint", str(root / "tests/release_upgrades/compatibility-constraints.txt")]) if installer := environment.get("PC_CI_PYTHON_INSTALLER"): install = [sys.executable, installer, "uv-pip", *install[2:]] run_owned( diff --git a/tests/release_upgrades/README.md b/tests/release_upgrades/README.md index 51ca52979c..dbef33fbbd 100644 --- a/tests/release_upgrades/README.md +++ b/tests/release_upgrades/README.md @@ -96,7 +96,10 @@ owned-descendant cleanup remain unchanged. Wall time depends on the slowest case not the sum of twelve cases. This increases concurrent runner use and does not promise a fixed speedup. The runner creates separate source/target environments, installs the exact published source package and the built -target wheel, pins both seekDB environments to the `pylibseekdb` version in the checkout's `uv.lock`, verifies their versions, then executes the reviewed suite in an isolated working directory. Repository +target wheel. Historical source environments apply `compatibility-constraints.txt` for known upstream dependency +incompatibilities that cannot be corrected in already-published wheel metadata; the source artifact and hash remain +unchanged. The current Server wheel declares its compatible dependency range in package metadata. The runner +pins both seekDB environments to the `pylibseekdb` version in the checkout's `uv.lock`, verifies their versions, then executes the reviewed suite in an isolated working directory. Repository pytest configuration and deployment environment variables are excluded. The suite must exercise those installed processes, not import the current checkout's runtime in place of either version. Use `-I` when invoking their Python. diff --git a/tests/release_upgrades/compatibility-constraints.txt b/tests/release_upgrades/compatibility-constraints.txt new file mode 100644 index 0000000000..ddc2dd678a --- /dev/null +++ b/tests/release_upgrades/compatibility-constraints.txt @@ -0,0 +1,3 @@ +# Released wheels retain their original metadata. Keep their Server environment +# compatible with FastAPI 0.165.1, which calls the pre-1.46 logger API positionally. +opentelemetry-api<1.46 diff --git a/uv.lock b/uv.lock index 7a50cd648e..1c4a6c50c3 100644 --- a/uv.lock +++ b/uv.lock @@ -3657,8 +3657,8 @@ requires-dist = [ { name = "opendal", marker = "extra == 'knowledge-base'", specifier = ">=0.46,<1" }, { name = "opentelemetry-api", marker = "extra == 'cli'", specifier = ">=1.30,<2" }, { name = "opentelemetry-api", marker = "extra == 'client'", specifier = ">=1.30,<2" }, - { name = "opentelemetry-api", marker = "extra == 'ops'", specifier = ">=1.30,<2" }, - { name = "opentelemetry-api", marker = "extra == 'server'", specifier = ">=1.30,<2" }, + { name = "opentelemetry-api", marker = "extra == 'ops'", specifier = ">=1.30,<1.46" }, + { name = "opentelemetry-api", marker = "extra == 'server'", specifier = ">=1.30,<1.46" }, { name = "opentelemetry-exporter-otlp-proto-http", marker = "extra == 'tracing-otlp'", specifier = ">=1.30,<2" }, { name = "opentelemetry-sdk", marker = "extra == 'ops'", specifier = ">=1.30,<2" }, { name = "opentelemetry-sdk", marker = "extra == 'server'", specifier = ">=1.30,<2" }, From df5eb79bbd29e144dfbee7aa6875f09a4e9a94b3 Mon Sep 17 00:00:00 2001 From: frf12 Date: Sat, 5 Dec 2026 02:13:17 +0800 Subject: [PATCH 2/2] fix(ci): recognize release dependency constraints in license checks --- .licenserc.yaml | 1 + .../release_upgrades/compatibility-constraints.txt | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/.licenserc.yaml b/.licenserc.yaml index a207fb830b..58b4144cc9 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -89,6 +89,7 @@ header: - '**/*.mermaid' # license-eye cannot determine the comment style of uv requirements files. - 'e2e/bub/source-overrides.txt' + - 'tests/release_upgrades/compatibility-constraints.txt' - 'integrations/dify/plugin/requirements.txt' - 'integrations/dify/plugin/.difyignore' diff --git a/tests/release_upgrades/compatibility-constraints.txt b/tests/release_upgrades/compatibility-constraints.txt index ddc2dd678a..6f4d898eeb 100644 --- a/tests/release_upgrades/compatibility-constraints.txt +++ b/tests/release_upgrades/compatibility-constraints.txt @@ -1,3 +1,17 @@ +# Copyright (c) 2026 OceanBase. +# +# Licensed 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. + # Released wheels retain their original metadata. Keep their Server environment # compatible with FastAPI 0.165.1, which calls the pre-1.46 logger API positionally. opentelemetry-api<1.46