Skip to content

fix(api-diff): strip class tags in type normalization to avoid false-positive diffs#23

Merged
EspenAlbert merged 3 commits into
mainfrom
type-normalizing-fixes
Feb 25, 2026
Merged

fix(api-diff): strip class tags in type normalization to avoid false-positive diffs#23
EspenAlbert merged 3 commits into
mainfrom
type-normalizing-fixes

Conversation

@EspenAlbert

@EspenAlbert EspenAlbert commented Feb 25, 2026

Copy link
Copy Markdown
Owner

Summary

Fix false-positive type-change diffs caused by <class '...'> tags in type annotations.

Some Python introspection paths produce type strings wrapped in <class 'module.Name'> (e.g., from repr() of type objects). These were not normalized before comparison, causing normalize_type to report spurious PARAM_TYPE_CHANGED diffs when comparing baseline and dev API dumps.

The fix strips <class '...'> tags before applying qualified-name normalization, so <class 'ask_shell._internal.models.ShellRun'> correctly matches ShellRun.

@codecov-commenter

codecov-commenter commented Feb 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.11765% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.99%. Comparing base (a6fcde9) to head (3395795).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
pkg_ext/_internal/api_diff.py 93.75% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #23      +/-   ##
==========================================
+ Coverage   79.87%   79.99%   +0.11%     
==========================================
  Files          80       80              
  Lines        4990     5033      +43     
==========================================
+ Hits         3986     4026      +40     
- Misses       1004     1007       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@EspenAlbert EspenAlbert changed the title todo update me with the PR title for branch type-normalizing-fixes fix(api-diff): strip class tags in type normalization to avoid false-positive diffs Feb 25, 2026
@EspenAlbert EspenAlbert marked this pull request as ready for review February 25, 2026 18:43
@EspenAlbert EspenAlbert merged commit 431a3b6 into main Feb 25, 2026
16 checks passed
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.

2 participants