Skip to content

New hub #43

Merged
antidodo merged 17 commits intomainfrom
new_hub
Mar 20, 2026
Merged

New hub #43
antidodo merged 17 commits intomainfrom
new_hub

Conversation

@antidodo
Copy link
Copy Markdown
Member

@antidodo antidodo commented Mar 20, 2026

Summary by CodeRabbit

  • New Features

    • Added progress tracking for analyses with real-time status and progress updates.
  • Bug Fixes

    • Improved log filtering to eliminate unnecessary diagnostic logs.
    • Fixed Nginx storage routing pattern for egress paths.
  • Chores

    • Updated project version to 0.4.0.
    • Updated flame-hub-client dependency to latest compatible version.
    • Migrated authentication from robot-based to client-based credentials for hub integration.

Nightknight3000 and others added 17 commits October 22, 2025 16:03
Co-authored-by: antidodo <albin2993@gmail.com>
# Conflicts:
#	src/api/api.py
#	src/resources/database/entity.py
#	src/resources/utils.py
#	src/utils/hub_client.py
Co-authored-by: antidodo <albin2993@gmail.com>
Co-authored-by: Nightknight3000 <alexander.roehl@uni-tuebingen.de>
…obot credentials

Co-authored-by: Nightknight3000 <alexander.roehl@uni-tuebingen.de>
# Conflicts:
#	src/resources/utils.py
#	src/utils/hub_client.py
Co-authored-by: Nightknight3000 <alexander.roehl@uni-tuebingen.de>
…g entries

Co-authored-by: Nightknight3000 <alexander.roehl@uni-tuebingen.de>
Co-authored-by: antidodo <albin2993@gmail.com>
# Conflicts:
#	poetry.lock
#	pyproject.toml
#	src/api/api.py
#	src/k8s/kubernetes.py
#	src/resources/log/entity.py
#	src/resources/utils.py
#	src/status/status.py
#	src/utils/hub_client.py
Co-authored-by: Nightknight3000 <alexander.roehl@uni-tuebingen.de>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 20, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This pull request migrates hub authentication from robot-based to client-based credentials, introduces progress tracking to analyses, updates status APIs to include progress, and adds a new Docker workflow branch trigger. It also extends database schemas with progress fields and refactors authentication helpers throughout the codebase.

Changes

Cohort / File(s) Summary
Hub Client Authentication Migration
src/utils/hub_client.py, src/utils/other.py, src/status/status.py
Replaced robot-based auth (robot_id/robot_secret) with client-based auth (client_id/client_secret). Updated helpers from init_hub_client_with_robot to init_hub_client_with_client and get_node_id_by_robot to get_node_id_by_client. Refactored environment variable reads from HUB_ROBOT_USER/HUB_ROBOT_SECRET to HUB_CLIENT_ID/HUB_CLIENT_SECRET.
API & Status Handling
src/api/api.py, src/resources/utils.py
Updated status API routes and handlers to use new client-based hub helpers and renamed handlers to get_all_status_and_progress_call and get_status_and_progress_call. Changed get_status(...) return format to include progress alongside status. Enhanced stream_logs(...) to conditionally update progress and call hub status with progress when valid.
Progress Field Addition
src/resources/analysis/entity.py, src/resources/database/db_models.py, src/resources/database/entity.py, src/resources/log/entity.py
Added new progress: int = 0 field to Analysis, CreateAnalysis, and CreateLogEntity models. Extended AnalysisDB and ArchiveDB schemas with nullable progress columns. Introduced progress-related database methods: get_analysis_progress(), progress_valid(), and update_analysis_progress(). Updated extract_analysis_body() to include progress in payload.
Infrastructure & Configuration
.github/workflows/build-push-docker.yml, pyproject.toml
Added new_hub branch trigger to Docker build workflow with custom :new-hub image tag. Bumped project version from 0.3.8 to 0.4.0 and loosened flame-hub-client dependency from exact 0.2.7 to range ^0.2.12.
Kubernetes & Log Sanitization
src/k8s/kubernetes.py
Modified Nginx storage egress routing regex from ^/storage/(final|local|intermediate)/ to ^/storage/(final|local|intermediate) (removed trailing slash requirement). Rewrote log sanitization in _get_logs() to iteratively filter printable characters and exclude lines starting with INFO: or matching health/webhook endpoint patterns.

Sequence Diagram

sequenceDiagram
    participant Client
    participant API
    participant Database
    participant Hub as Hub Client
    participant Logger

    Client->>API: Create analysis with progress
    API->>Database: create_analysis(..., progress=0)
    Database-->>API: Analysis created
    
    Logger->>API: stream_logs(log_entity)
    API->>Database: progress_valid(analysis_id, log_entity.progress)
    
    alt Progress is valid
        Database-->>API: true
        API->>Database: update_analysis_progress(analysis_id, progress)
        API->>Hub: update_hub_status(..., run_progress=progress)
    else Progress invalid or not applicable
        Database-->>API: false
        API->>Hub: update_hub_status(..., run_status only)
    end
    
    Hub-->>API: Status updated

    Client->>API: get_status_and_progress(analysis_id)
    API->>Database: Query analysis with progress
    Database-->>API: {status: ..., progress: ...}
    API-->>Client: {analysis_id: {status: ..., progress: ...}}
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • Canary #42: Modifies hub-client integration with changes to src/utils/hub_client.py and related hub client usage patterns throughout the codebase.

Poem

🐰 Hops of progress, clients now lead the way,
Progress fields hop through database clay,
From robots to clients, authentication's new song,
Status and progress together, where they belong!
Nginx routes trimmed, logs sanitized bright, 🌟

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'New hub' is vague and does not convey meaningful information about the substantial changes in the pull request. Provide a more descriptive title that captures the main changes, such as 'Switch hub authentication from robot to client credentials' or 'Add progress tracking and update hub client authentication'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch new_hub

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.

❤️ Share

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

Tip

CodeRabbit can enforce grammar and style rules using `languagetool`.

Configure the reviews.tools.languagetool setting to enable/disable rules and categories. Refer to the LanguageTool Community to learn more.

@antidodo antidodo merged commit ea76b55 into main Mar 20, 2026
1 of 2 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.

3 participants