Skip to content

Release 2.24.3#155

Merged
btoron merged 8 commits intomasterfrom
release/2.24.3
Mar 5, 2026
Merged

Release 2.24.3#155
btoron merged 8 commits intomasterfrom
release/2.24.3

Conversation

@btoron
Copy link
Owner

@btoron btoron commented Mar 5, 2026

Release 2.24.3

Changes

  • Refactor: Extract shared AsyncClientBase to eliminate cross-module duplication (Closes Extract shared AsyncClientBase to eliminate cross-module duplication #148)
    • New ofsc/async_client/_base.py with shared error handling and auth headers
    • All async modules inherit from AsyncClientBase (~400 duplicated lines removed)
    • Shared Protocol in ofsc/async_client/_protocols.py
  • Refactor: Add generic HTTP helpers to AsyncClientBase and refactor metadata.py (Closes Refactor async metadata.py to reduce code duplication with helper methods #116)
    • 8 new helper methods (_get_paginated_list, _get_single_item, _get_all_items, _put_item, _post_item, _patch_item, _delete_item, _clean_response)
    • ~65 of 91 async metadata methods refactored to delegates (~674 lines removed, ~22% reduction)
    • Fixes missing quote_plus URL encoding in get_property, get_workzone, create_or_replace_property, update_property
    • Fixes inconsistent links removal across 55 methods, now unified via _clean_response()
    • 32 new unit tests in tests/async/test_async_base_helpers.py
  • Test: Add extra fields preservation tests for ResourceCreate and UserCreate
  • Chore: Bump version to 2.24.3, add docs/patterns to .gitignore

Checklist

  • Review changelog
  • Verify version bump is correct
  • Merge when ready to publish

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@btoron btoron added the release:patch Triggers patch version tag on merge label Mar 5, 2026
btoron and others added 7 commits March 5, 2026 12:06
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…on (#148)

Create ofsc/async_client/_base.py with AsyncClientBase and
ofsc/async_client/_protocols.py with shared _CoreBaseProtocol.

All 5 async modules now inherit from AsyncClientBase, removing ~400
lines of duplicated __init__, config, baseUrl, headers,
_parse_error_response, and _handle_http_error boilerplate.

core/resources.py and core/users.py import _CoreBaseProtocol from
the shared _protocols.py instead of defining it locally.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tadata.py (#116)

Add 8 generic helper methods to AsyncClientBase (_clean_response,
_get_paginated_list, _get_single_item, _get_all_items, _put_item,
_post_item, _patch_item, _delete_item) and refactor ~65 of 91 methods
in async metadata.py to delegate to them, reducing the file by ~674
lines (~22%).

Also fixes two bugs:
- Missing quote_plus URL encoding in get_property, get_workzone,
  create_or_replace_property, update_property
- Inconsistent 'links' removal across 55 methods, now unified via
  _clean_response()

Adds 32 new unit tests in tests/async/test_async_base_helpers.py.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add HELPER_METHOD_MAP and a second detection pass in scan_file_for_endpoints()
to recognize calls to AsyncClientBase helpers (_get_paginated_list, _get_single_item,
_put_item, etc.). This restores correct endpoint detection after the #116 refactor
that replaced urljoin() calls with helper delegation — async metadata now shows 85
endpoints instead of 22.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@btoron btoron marked this pull request as ready for review March 5, 2026 20:28
@btoron btoron merged commit 231069d into master Mar 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:patch Triggers patch version tag on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extract shared AsyncClientBase to eliminate cross-module duplication Refactor async metadata.py to reduce code duplication with helper methods

1 participant