Skip to content

gold module - add azure image service#275

Merged
rootflo-hardik merged 2 commits intodevelopfrom
CU-86d2mp1vg-Gold-add-AzureImageService
Apr 17, 2026
Merged

gold module - add azure image service#275
rootflo-hardik merged 2 commits intodevelopfrom
CU-86d2mp1vg-Gold-add-AzureImageService

Conversation

@rootflo-hardik
Copy link
Copy Markdown
Contributor

@rootflo-hardik rootflo-hardik commented Apr 13, 2026

Summary by CodeRabbit

  • New Features
    • Added Azure as a selectable cloud storage provider in addition to AWS and GCP.
    • Images and their metadata can now be uploaded and stored in Azure Blob Storage.
    • Processing messages can now be sent to Azure Storage Queue to integrate with existing workflows.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cfb47c43-6409-4425-ade8-c4bec64afd64

📥 Commits

Reviewing files that changed from the base of the PR and between b8048f8 and 083464d.

📒 Files selected for processing (2)
  • wavefront/server/apps/floware/floware/config.ini
  • wavefront/server/modules/gold_module/gold_module/gold_container.py
✅ Files skipped from review due to trivial changes (1)
  • wavefront/server/apps/floware/floware/config.ini
🚧 Files skipped from review as they are similar to previous changes (1)
  • wavefront/server/modules/gold_module/gold_module/gold_container.py

📝 Walkthrough

Walkthrough

Adds Azure cloud support to the gold module: new AzureImageService implementation, DI wiring for an azure provider, Azure config keys, and Azure SDK dependencies.

Changes

Cohort / File(s) Summary
Azure Configuration
wavefront/server/apps/floware/floware/config.ini
Added environment-substituted Azure settings: account_url, queue_url, queue_name under [azure].
Module dependencies
wavefront/server/modules/gold_module/pyproject.toml
Added Azure SDK dependencies: azure-identity, azure-storage-blob, azure-storage-queue.
Azure service implementation
wavefront/server/modules/gold_module/gold_module/services/cloud_image_service.py
Added AzureImageService subclass of CloudImageService with async methods to upload image bytes and metadata to Blob Storage and send messages to Azure Queue, using DefaultAzureCredential.
Dependency injection wiring
wavefront/server/modules/gold_module/gold_module/gold_container.py
Added azure_image_service singleton provider and extended cloud_service selector to include azure=azure_image_service.

Sequence Diagram

sequenceDiagram
    participant App as Application
    participant AzureService as AzureImageService
    participant Blob as Azure Blob Storage
    participant Queue as Azure Queue Storage

    App->>AzureService: upload_image(image_data, object_key)
    AzureService->>Blob: upload blob (content_type='image/jpeg')
    Blob-->>AzureService: blob URI

    App->>AzureService: upload_image_metadata(metadata, object_key)
    AzureService->>Blob: upload metadata blob (application/json)
    Blob-->>AzureService: metadata URI

    App->>AzureService: send_message(message)
    AzureService->>Queue: send json-serialized message
    Queue-->>AzureService: message ID
    AzureService-->>App: message ID
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • vishnurk6247

Poem

🐰 I hopped into clouds of azure blue,
Blobs and queues lined up in view,
I tuck each image safe and neat,
Send a message—tap my tiny feet,
The gold module hums a skyward tune.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding Azure image service support to the gold module, which is reflected across all four modified files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ 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 CU-86d2mp1vg-Gold-add-AzureImageService

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.

Copy link
Copy Markdown

@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: 2

Caution

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

⚠️ Outside diff range comments (1)
wavefront/server/modules/gold_module/pyproject.toml (1)

10-19: ⚠️ Potential issue | 🟠 Major

Add boto3 explicitly to gold-module dependencies.

wavefront/server/modules/gold_module/gold_module/services/cloud_image_service.py imports boto3 at line 6, but this dependency is not declared in pyproject.toml. The common-module dependency does not provide boto3, so a clean install of gold-module will fail. Add boto3<=1.38.40 to the dependencies list to match the version constraint used elsewhere in the workspace.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@wavefront/server/modules/gold_module/pyproject.toml` around lines 10 - 19,
The pyproject.toml for gold_module is missing the boto3 dependency referenced by
the import in gold_module/services/cloud_image_service.py (import boto3 at line
6); add "boto3<=1.38.40" to the dependencies list in the pyproject.toml so the
package installs cleanly and matches the workspace version constraint.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@wavefront/server/modules/gold_module/gold_module/gold_container.py`:
- Around line 42-45: The mapping selection uses the local variable
cloud_provider (from os.environ) instead of the configured value; change the
selection to use config.cloud_config.cloud_provider (or a resolved variable that
prefers config then falls back to env) when choosing between aws_image_service,
gcp_image_service, and azure_image_service so AzureImageService can be picked
when the config sets cloud_provider=azure; update any variable references to
cloud_provider in gold_container.py to read from the config object rather than
only os.environ to ensure config-driven deployments select the correct provider.

In
`@wavefront/server/modules/gold_module/gold_module/services/cloud_image_service.py`:
- Around line 7-9: The AzureImageService currently implements async methods
upload_image, upload_image_metadata, and send_message but instantiates and calls
synchronous Azure SDK clients (BlobServiceClient and QueueClient), which blocks
the event loop; fix by either (A) converting to true async: import and
instantiate azure.storage.blob.aio.BlobServiceClient and
azure.storage.queue.aio.QueueClient from the aio packages, use their async
context managers and await upload/metadata/message calls inside upload_image,
upload_image_metadata, and send_message, and ensure DefaultAzureCredential usage
remains compatible, or (B) make the service methods synchronous: remove
async/await from AzureImageService methods, call the current synchronous
BlobServiceClient and QueueClient directly, and update any callers to run them
in threadpool if needed; choose one approach and apply consistently across
AzureImageService, upload_image, upload_image_metadata, and send_message.

---

Outside diff comments:
In `@wavefront/server/modules/gold_module/pyproject.toml`:
- Around line 10-19: The pyproject.toml for gold_module is missing the boto3
dependency referenced by the import in
gold_module/services/cloud_image_service.py (import boto3 at line 6); add
"boto3<=1.38.40" to the dependencies list in the pyproject.toml so the package
installs cleanly and matches the workspace version constraint.
🪄 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

Run ID: cdd34f80-15ba-48d8-ac91-03d99c7b0e0c

📥 Commits

Reviewing files that changed from the base of the PR and between 32a529d and b8048f8.

⛔ Files ignored due to path filters (1)
  • wavefront/server/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • wavefront/server/apps/floware/floware/config.ini
  • wavefront/server/modules/gold_module/gold_module/gold_container.py
  • wavefront/server/modules/gold_module/gold_module/services/cloud_image_service.py
  • wavefront/server/modules/gold_module/pyproject.toml

Comment on lines +42 to +45
cloud_provider,
aws=aws_image_service,
gcp=gcp_image_service,
azure=azure_image_service,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Select the provider from the loaded config, not only from CLOUD_PROVIDER.

This new azure branch is still gated by cloud_provider, which is sourced from os.environ above instead of config.cloud_config.cloud_provider. In a config-driven deployment, setting [cloud_config] cloud_provider=azure in wavefront/server/apps/floware/floware/config.ini will still fall back to gcp when the env var is absent, so AzureImageService never gets selected.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@wavefront/server/modules/gold_module/gold_module/gold_container.py` around
lines 42 - 45, The mapping selection uses the local variable cloud_provider
(from os.environ) instead of the configured value; change the selection to use
config.cloud_config.cloud_provider (or a resolved variable that prefers config
then falls back to env) when choosing between aws_image_service,
gcp_image_service, and azure_image_service so AzureImageService can be picked
when the config sets cloud_provider=azure; update any variable references to
cloud_provider in gold_container.py to read from the config object rather than
only os.environ to ensure config-driven deployments select the correct provider.

Comment on lines +7 to +9
from azure.identity import DefaultAzureCredential
from azure.storage.blob import BlobServiceClient, ContentSettings
from azure.storage.queue import QueueClient
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

python - <<'PY'
import ast
from pathlib import Path

path = Path("wavefront/server/modules/gold_module/gold_module/services/cloud_image_service.py")
tree = ast.parse(path.read_text())

for node in tree.body:
    if isinstance(node, ast.ClassDef) and node.name == "AzureImageService":
        for fn in node.body:
            if isinstance(fn, ast.AsyncFunctionDef):
                has_await = any(isinstance(n, ast.Await) for n in ast.walk(fn))
                print(f"{fn.name}: has_await={has_await}")
PY

echo
echo "Azure client imports:"
rg -n -C1 'from azure\.storage\.(blob|queue)\b' wavefront/server/modules/gold_module/gold_module/services/cloud_image_service.py

Repository: rootflo/wavefront

Length of output: 395


Use async Azure SDK clients or make these methods synchronous.

The async methods upload_image, upload_image_metadata, and send_message in AzureImageService use synchronous Azure clients (BlobServiceClient from azure.storage.blob, QueueClient from azure.storage.queue) without await, which blocks the FastAPI event loop during network I/O. Either switch to azure.storage.blob.aio.BlobServiceClient and azure.storage.queue.aio.QueueClient and await their calls, or make these service methods synchronous.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@wavefront/server/modules/gold_module/gold_module/services/cloud_image_service.py`
around lines 7 - 9, The AzureImageService currently implements async methods
upload_image, upload_image_metadata, and send_message but instantiates and calls
synchronous Azure SDK clients (BlobServiceClient and QueueClient), which blocks
the event loop; fix by either (A) converting to true async: import and
instantiate azure.storage.blob.aio.BlobServiceClient and
azure.storage.queue.aio.QueueClient from the aio packages, use their async
context managers and await upload/metadata/message calls inside upload_image,
upload_image_metadata, and send_message, and ensure DefaultAzureCredential usage
remains compatible, or (B) make the service methods synchronous: remove
async/await from AzureImageService methods, call the current synchronous
BlobServiceClient and QueueClient directly, and update any callers to run them
in threadpool if needed; choose one approach and apply consistently across
AzureImageService, upload_image, upload_image_metadata, and send_message.

- rather use ASSET_STORAGE_BUCKET only
@rootflo-hardik rootflo-hardik merged commit c1bd811 into develop Apr 17, 2026
10 checks passed
@vizsatiz vizsatiz deleted the CU-86d2mp1vg-Gold-add-AzureImageService branch April 17, 2026 07:26
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