ci: require deprecation marker before exported symbol removal#2072
Merged
ci: require deprecation marker before exported symbol removal#2072
Conversation
d727b3d to
067ecf2
Compare
067ecf2 to
2d69bdc
Compare
all-hands-bot
approved these changes
Feb 14, 2026
Collaborator
all-hands-bot
left a comment
There was a problem hiding this comment.
🟢 Good taste - Pragmatic solution that solves a real problem.
Core assessment: This enforces deprecation-before-removal for public API symbols using AST scanning to detect existing deprecation markers. The approach is straightforward, well-tested, and reuses existing infrastructure (@deprecated and warn_deprecated()). No over-engineering.
Data structures: Clean flow - scan AST → build set of deprecated names → check removals against set. No unnecessary transformations.
Tests: Comprehensive coverage of decorator detection, warn_deprecated() calls, dotted name handling, and integration with griffe.
✅ Worth merging - Fundamentally sound implementation.
Enforce that any symbol removed from openhands.sdk.__all__ was previously marked with @deprecated or warn_deprecated() in the prior release. The check AST-scans the old PyPI source for the SDK canonical deprecation helpers. Closes #2066 Co-authored-by: openhands <openhands@all-hands.dev>
2d69bdc to
6f52ccb
Compare
This was referenced Feb 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Enforces that any symbol removed from
openhands.sdk.__all__must have been marked deprecated in the previous release using the SDK's canonical deprecation helpers (@deprecateddecorator orwarn_deprecated()fromopenhands.sdk.utils.deprecation).Closes #2066
What changed
.github/scripts/check_sdk_api_breakage.py:_find_deprecated_symbols()— AST-scans the previous release's source for@deprecateddecorators andwarn_deprecated()calls, building a set of deprecated top-level names_get_source_root()— Derives source directory from griffe's PyPI download cache_compute_breakages()— Now returns(total_breaks, undeprecated_removals): removals without prior deprecation are a hard failure independent of version bumpsTwo independent policies
@deprecatedorwarn_deprecated()in old releaseDesign decision
Uses the existing
openhands.sdk.utils.deprecationmodule — no new deprecation mechanism needed. The same markers already enforced bycheck_deprecations.py(deadline scanner) are now also required before any__all__removal.Tests
6 new tests (15 total, all passing):
@deprecateddecorator detectionwarn_deprecated('Foo.bar')→ top-levelFoomappingAgent Server images for this PR
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdknikolaik/python-nodejs:python3.12-nodejs22golang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:6edd533-pythonRun
All tags pushed for this build
About Multi-Architecture Support
6edd533-python) is a multi-arch manifest supporting both amd64 and arm646edd533-python-amd64) are also available if needed