Skip to content

Update to Hub v0.8.25#100

Merged
pbrassel merged 33 commits intomainfrom
hub-0.8.25
Feb 10, 2026
Merged

Update to Hub v0.8.25#100
pbrassel merged 33 commits intomainfrom
hub-0.8.25

Conversation

@pbrassel
Copy link
Member

@pbrassel pbrassel commented Feb 10, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Client credentials authentication flow for service-to-service integration
    • Client management API with full CRUD operations
    • Enhanced analysis status tracking with real-time progress indicators
    • Improved log handling with service and channel metadata support
  • Deprecations

    • RobotAuth authentication method deprecated in favor of ClientAuth
  • Documentation

    • Updated testing and deployment setup instructions

…aseClient` method

This is now possible through the implementation of the `expected_code` keyword argument and the fact that the Hub's response now contains the log resource.
@coderabbitai
Copy link

coderabbitai bot commented Feb 10, 2026

📝 Walkthrough

Walkthrough

This PR introduces a new ClientAuth authentication mechanism, adds Client resource management with full CRUD operations, refactors status fields using unified ProcessStatus typing, restructures bucket and file models with enhanced metadata tracking, updates Node and Analysis models with additional fields, and deprecates RobotAuth in favor of ClientAuth.

Changes

Cohort / File(s) Summary
Configuration & Documentation
.env.test, README.md, docs/testing.rst
Updated Hub version to 0.8.25; updated JSON example with client_id field and null robot_id; revised testing documentation for hub-deployment repository setup and pytest configuration with improved clarity on environment setup steps.
Deprecation & Initialization
flame_hub/__init__.py
Added warnings module import and enabled deprecation warnings by default via warnings.simplefilter.
Authentication Flows & New ClientAuth
flame_hub/_auth_flows.py
Introduced new ClientAuth class implementing client_credentials authentication flow with token caching; added deprecation warning to RobotAuth indicating migration to ClientAuth.
Client Resource Management
flame_hub/_auth_client.py
Added new Client-related data models (CreateClient, Client, UpdateClient); implemented full CRUD operations for clients (create, get, get_clients, find_clients, update, delete); refactored User model inheritance from CreateUser; updated CreateUser email field type to EmailStr with optional default.
Base HTTP Infrastructure
flame_hub/_base_client.py
Introduced configurable expected_code parameter to resource operation methods (_get_all_resources, _find_all_resources, _create_resource, _get_single_resource, _update_resource, _delete_resource) for flexible status code validation; added read timeout configuration to internal HTTP client.
Core Models & ProcessStatus Typing
flame_hub/_core_client.py
Added ProcessStatus unified literal type for status fields; restructured Node model (robot_id now optional, added client_id); enhanced MasterImage with build_status and build_progress; refactored Analysis status fields to use ProcessStatus; updated AnalysisCommand literals; renamed AnalysisNode.run_status to execution_status with progress tracking; restructured AnalysisBucket and AnalysisBucketFile models with new identifiers and relationships; updated create_analysis_node_log to return Log object; added LogChannel literal for log routing.
Storage Client Models
flame_hub/_storage_client.py
Made Bucket actor_id and actor_type optional; added realm_id field to BucketFile model.
Public API Exports
flame_hub/models.py, flame_hub/auth.py, flame_hub/types.py
Updated public exports to include ClientAuth, CreateClient, Client, UpdateClient, CreateAnalysisBucket, ProcessStatus, and LogChannel; removed deprecated exports for AnalysisRunStatus, AnalysisBuildStatus, AnalysisNodeApprovalStatus, AnalysisNodeRunStatus.
Test Infrastructure
tests/conftest.py, tests/helpers.py
Removed hub_version parameter from nginx fixture; updated nginx.conf fetch URL to hub-deployment repository; added next_random_number helper function for generating random integers and floats.
Test Coverage & Auth
tests/test_auth.py, tests/test_flow.py
Added Client fixture definitions and comprehensive test cases for Client CRUD operations; introduced ClientAuth tests and deprecated RobotAuth tests with DeprecationWarning context; verified new authentication flows.
Core Tests
tests/test_core.py
Updated imports to use ProcessStatus and AnalysisBucketType; refactored analysis and bucket tests to reflect new model structures; updated analysis node tests to use execution_status instead of run_status; added comprehensive bucket and bucket file lifecycle tests; enhanced log creation and retrieval test coverage.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~55 minutes

Poem

🐰 A ClientAuth hops into the fold,
With credentials bright and tokens of gold,
RobotAuth takes a final bow,
While ProcessStatus guides us now,
Buckets and nodes in new form arise—
A refactor feast before our eyes! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.94% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Update to Hub v0.8.25' directly aligns with the primary objective of the PR, which is a version update. However, the changeset encompasses significantly more than just a version bump—it includes major API changes (new Client authentication, ProcessStatus refactoring, bucket model restructuring), deprecations, and model updates across multiple modules. The title captures the triggering event but omits the substantial architectural changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch hub-0.8.25

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
flame_hub/_storage_client.py (1)

60-63: ⚠️ Potential issue | 🟠 Major

apply_upload_file_defaults overwrites user-specified content_type values.

UploadFile is a TypedDict (runtime dict), and hasattr(uf, "content_type") checks for object attributes, not dict keys. This returns False even when the key exists in the dict, causing user-provided values to be replaced. Use "content_type" not in uf instead to check for key presence.

Suggested fix
-    if not hasattr(uf, "content_type") or uf["content_type"] is None:
+    if "content_type" not in uf or uf["content_type"] is None:
         uf["content_type"] = "application/octet-stream"
🤖 Fix all issues with AI agents
In @.env.test:
- Line 10: Dotenv-linter complains about key ordering for PYTEST_HUB_VERSION;
fix it by moving the PYTEST_HUB_VERSION entry so it appears above the
PYTEST_STORAGE_BASE_URL entry in the env file, preserving the exact key/value
and ensuring the rest of the key order remains unchanged.

In `@tests/conftest.py`:
- Around line 302-308: The nginx fixture in function nginx currently fetches
nginx.conf from a moving branch ref ("refs/heads/master"); change the httpx.get
call to use a pinned ref by reading an environment variable (e.g.,
NGINX_CONF_REF) with a sensible default set to a stable tag or commit hash, and
update the URL construction in the nginx function so it interpolates that ref
instead of hardcoding "refs/heads/master"; ensure the env var is documented or
set in tests so CI uses the stable ref while allowing overrides for local
testing.

In `@tests/helpers.py`:
- Around line 38-42: The function next_random_number calls random.randint when
is_integer=True but accepts float bounds, causing TypeError; modify
next_random_number to coerce/validate bounds before calling random.randint by
converting lower to math.ceil(lower) and upper to math.floor(upper) (import
math) and then ensure lower_int <= upper_int else raise ValueError; keep the
rest of the logic intact and reference next_random_number and random.randint
when making the change.
🧹 Nitpick comments (2)
flame_hub/__init__.py (1)

27-28: Scope DeprecationWarning filter to this library only.

Line 27-28 changes the global warnings behavior for all modules, which can be noisy for host applications. Consider scoping the filter to flame_hub instead.

🔧 Suggested adjustment
-warnings.simplefilter("default", DeprecationWarning)
+warnings.filterwarnings(
+    "default",
+    category=DeprecationWarning,
+    module=r"^flame_hub(\.|$)",
+)
flame_hub/_auth_flows.py (1)

66-69: Add stacklevel so the deprecation warning points to caller.

Line 66-69 will currently point to internal code. Adding stacklevel=2 makes the warning actionable for users.

🔧 Suggested tweak
 warnings.warn(
     "'RobotAuth' is deprecated and will be removed in a future version. Please use 'ClientAuth' instead.",
     category=DeprecationWarning,
+    stacklevel=2,
 )

PYTEST_ASYNC_MAX_RETRIES=5
PYTEST_ASYNC_RETRY_DELAY_MILLIS=500
PYTEST_HUB_VERSION=0.8.21
PYTEST_HUB_VERSION=0.8.25
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix dotenv-linter key order warning.

Line 10 is flagged by dotenv-linter for key ordering. Move PYTEST_HUB_VERSION above PYTEST_STORAGE_BASE_URL.

🔧 Suggested reorder
 PYTEST_CORE_BASE_URL=http://localhost:3000/core/
 PYTEST_AUTH_BASE_URL=http://localhost:3000/auth/
-PYTEST_STORAGE_BASE_URL=http://localhost:3000/storage/
+PYTEST_HUB_VERSION=0.8.25
+PYTEST_STORAGE_BASE_URL=http://localhost:3000/storage/
 PYTEST_ADMIN_USERNAME=admin
 PYTEST_ADMIN_PASSWORD=start123
 PYTEST_DEFAULT_MASTER_IMAGE=python/base
 PYTEST_ASYNC_MAX_RETRIES=5
 PYTEST_ASYNC_RETRY_DELAY_MILLIS=500
-PYTEST_HUB_VERSION=0.8.25
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
PYTEST_HUB_VERSION=0.8.25
PYTEST_CORE_BASE_URL=http://localhost:3000/core/
PYTEST_AUTH_BASE_URL=http://localhost:3000/auth/
PYTEST_HUB_VERSION=0.8.25
PYTEST_STORAGE_BASE_URL=http://localhost:3000/storage/
PYTEST_ADMIN_USERNAME=admin
PYTEST_ADMIN_PASSWORD=start123
PYTEST_DEFAULT_MASTER_IMAGE=python/base
PYTEST_ASYNC_MAX_RETRIES=5
PYTEST_ASYNC_RETRY_DELAY_MILLIS=500
🧰 Tools
🪛 dotenv-linter (4.0.0)

[warning] 10-10: [UnorderedKey] The PYTEST_HUB_VERSION key should go before the PYTEST_STORAGE_BASE_URL key

(UnorderedKey)

🤖 Prompt for AI Agents
In @.env.test at line 10, Dotenv-linter complains about key ordering for
PYTEST_HUB_VERSION; fix it by moving the PYTEST_HUB_VERSION entry so it appears
above the PYTEST_STORAGE_BASE_URL entry in the env file, preserving the exact
key/value and ensuring the rest of the key order remains unchanged.

@pbrassel
Copy link
Member Author

closes #72, #80 and #81

@pbrassel pbrassel merged commit b812c14 into main Feb 10, 2026
6 checks passed
@pbrassel pbrassel deleted the hub-0.8.25 branch February 10, 2026 14:31
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.

1 participant