feat!: hub v0.13.0 - #130
Conversation
authup wraps every single-record entity response in a data/meta envelope since 1.0.0-beta.57 (authup/authup@00f2f4c3a, "feat: query-capability discovery via meta.schema + entity record response envelope", #3332). getOne, create, update and delete of all entity controllers now respond with {"data": ..., "meta": ...} instead of the entity itself, mirroring the envelope that collection responses have always used. meta carries response-scoped extras such as the queryable schema of the endpoint. The OAuth2 protocol surface (token, introspect, revoke, ...) stays flat, so _auth_flows is unaffected. Add the _unwrap_single_resource hook to BaseClient, which returns the response body unchanged, and call it in _create_resource, _get_single_resource and _update_resource. AuthClient overrides the hook to return the data property and raises a ValueError naming the required authup version if the property is absent. The FLAME Hub core and storage services keep responding with the bare entity, so CoreClient and StorageClient are untouched. Collection responses were already validated as an envelope by ResourceList. BREAKING CHANGE: AuthClient requires authup 1.0.0-beta.57 or newer.
The Hub v0.13.0 API expects camel case attribute names and envelopes most of its responses like `{"data": ..., "meta": ...}`.
BREAKING CHANGE: Models are serialized with camel case attribute names.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe client now centralizes Pydantic camelCase configuration, supports wrapped single-resource responses with optional metadata, updates client return types, parses response data consistently, and aligns tests, fixtures, examples, and documentation with the Hub API. ChangesHub response and model handling
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant ClientCaller
participant BaseClient
participant HubAPI
ClientCaller->>BaseClient: request single resource
BaseClient->>HubAPI: send camelCase query parameters
HubAPI-->>BaseClient: return data/meta envelope or direct resource
BaseClient-->>ClientCaller: return resource or resource/metadata tuple
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
.env.test (1)
10-11: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReorder the new keys to satisfy
dotenv-linter.
dotenv-linterreportsUnorderedKeybecause both keys appear afterPYTEST_STORAGE_BASE_URL. Move them before that key to avoid lint warnings.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.env.test around lines 10 - 11, Move PYTEST_HUB_VERSION and PYTEST_RESPONSE_TIMEOUT before PYTEST_STORAGE_BASE_URL in the environment configuration, preserving their values and ensuring the keys follow dotenv-linter’s expected ordering.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/conftest.py`:
- Around line 347-358: Update the auth_client, core_client, and storage_client
fixtures to retain each created client, yield the corresponding wrapper, and
close the injected HTTP client in a finally block after yield. Apply identical
teardown handling to all three session-scoped fixtures.
---
Nitpick comments:
In @.env.test:
- Around line 10-11: Move PYTEST_HUB_VERSION and PYTEST_RESPONSE_TIMEOUT before
PYTEST_STORAGE_BASE_URL in the environment configuration, preserving their
values and ensuring the keys follow dotenv-linter’s expected ordering.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 5ada573b-69c5-4fb3-aea4-182f4a5a8c9d
📒 Files selected for processing (13)
.env.testREADME.mddocs/clients_api.rstdocs/user_guide.rstflame_hub/_auth_client.pyflame_hub/_base_client.pyflame_hub/_core_client.pyflame_hub/_storage_client.pyflame_hub/models.pyflame_hub/types.pytests/conftest.pytests/test_auth.pytests/test_core.py
Summary by CodeRabbit
New Features
Documentation
Chores