Skip to content

fix(content): deliver CSV catalog files before validation - #433

Merged
bobtista merged 3 commits into
developmentfrom
codex/fix-csv-provider-delivery
Aug 30, 2026
Merged

fix(content): deliver CSV catalog files before validation#433
bobtista merged 3 commits into
developmentfrom
codex/fix-csv-provider-delivery

Conversation

@bobtista

Copy link
Copy Markdown
Collaborator

Summary

  • deliver CSV catalog files through the configured HTTP deliverer
  • return failures when the manifest is unsupported or delivery fails
  • forward the working directory, progress reporter, and cancellation token
  • continue preparation and validation with the delivered manifest
  • add regression coverage for successful, unsupported, and failed delivery paths

Closes #432

Verification

  • dotnet test GenHub/GenHub.Tests/GenHub.Tests.Core/GenHub.Tests.Core.csproj -c Release --filter FullyQualifiedName~CsvContentProviderTests — 12 passed
  • dotnet format GenHub/GenHub.sln --verify-no-changes --no-restore --include ... — passed
  • pnpm exec gitnexus detect-changes — low risk, no affected processes

Implemented with GPT-5.6 Codex in the Codex desktop harness.

@qodo-code-review

Copy link
Copy Markdown

ⓘ Your Qodo trial ends soon. Ask your workspace admin to set up billing to keep reviews running after the trial. Manage billing

@deepsource-io

deepsource-io Bot commented Aug 30, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 19678f2...a24e79f on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
C# Aug 30, 2026 7:59p.m. Review ↗
JavaScript Aug 30, 2026 7:59p.m. Review ↗
Shell Aug 30, 2026 7:59p.m. Review ↗
Secrets Aug 30, 2026 7:59p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

fix(content): deliver CSV catalog files before validation

🐞 Bug fix 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Downloads CSV catalog files through the configured HTTP deliverer before final validation.
• Propagates unsupported-manifest and delivery failures while preserving operation context.
• Adds regression tests for successful delivery and both failure paths.
Diagram

graph TD
  A["Base preparation"] --> B["CSV provider"] --> C{"Deliverable?"}
  C -->|Yes| D["HTTP deliverer"] --> E["Delivered manifest"] --> F["Final validation"]
  C -->|No| G["Failure result"]
  D -->|Failure| G
Loading
High-Level Assessment

The provider-specific delivery hook is the appropriate fix because BaseContentProvider already owns manifest checks, post-installation work, and final validation. Generalizing automatic delivery in the base class would risk changing preparation semantics for unrelated providers.

Files changed (2) +143 / -9

Bug fix (1) +21 / -2
CsvContentProvider.csDeliver CSV manifest files during preparation +21/-2

Deliver CSV manifest files during preparation

• Changes CSV preparation from a no-op into an HTTP delivery step. It rejects unsupported manifests, propagates delivery failures, and returns the delivered manifest for post-installation processing and final validation.

GenHub/GenHub/Features/Content/Services/ContentProviders/CsvContentProvider.cs

Tests (1) +122 / -7
CsvContentProviderTests.csCover CSV delivery success and failure paths +122/-7

Cover CSV delivery success and failure paths

• Expands preparation tests to verify HTTP delivery occurs before final validation and that the working directory, progress reporter, cancellation token, and delivered manifest are forwarded. Adds regression cases for unsupported manifests and failed downloads, including assertions that later pipeline stages are skipped.

GenHub/GenHub.Tests/GenHub.Tests.Core/Features/Content/CsvContentProviderTests.cs

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b2d9ffcd-dc0c-4952-be11-5e37ed65e8a5

📥 Commits

Reviewing files that changed from the base of the PR and between 19678f2 and 28f082e.

📒 Files selected for processing (2)
  • GenHub/GenHub.Tests/GenHub.Tests.Core/Features/Content/CsvContentProviderTests.cs
  • GenHub/GenHub/Features/Content/Services/ContentProviders/CsvContentProvider.cs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Important

Approval pending

CodeRabbit has no unresolved comments, but it has not reviewed the latest commit.

Use the checkbox below to review the latest commit. CodeRabbit will approve the changes if it finds no blocking issues.

  • 🔍 Trigger review
📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • CSV catalog content is now downloaded and delivered before validation.
    • Delivery progress and working-directory handling are supported during preparation.
  • Bug Fixes

    • Clear errors are now reported when content cannot be delivered or downloading fails.
    • Validation no longer runs when content delivery is unsuccessful.

Walkthrough

CsvContentProvider now delivers CSV manifests before validation. It forwards the working directory, progress reporter, and cancellation token, handles unsupported or failed delivery, and uses the delivered manifest. Tests cover success and failure paths.

Changes

CSV delivery flow

Layer / File(s) Summary
Provider delivery and validation
GenHub/GenHub/Features/Content/Services/ContentProviders/CsvContentProvider.cs
The provider checks CanDeliver, calls DeliverContentAsync, propagates delivery failures, and validates the delivered manifest.
Delivery path regression coverage
GenHub/GenHub.Tests/GenHub.Tests.Core/Features/Content/CsvContentProviderTests.cs
Tests cover successful delivery, unsupported manifests, failed delivery, and configurable deliverer injection.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: 🟡 Moderate · up to 28f08

The change now downloads CSV catalog files into staging before validation and continues with the delivered manifest. Normal failures are handled, but merge readiness is reduced by unresolved safeguards for path containment, concurrent acquisitions, and preserving manifest identity and version semantics; these could cause writes outside staging or mixed or mis-associated content unless explicitly constrained or accepted.

Suggested reviewers: undead2146

Poem

A rabbit checked the CSV trail,
The deliverer carried each file without fail.
Unsupported paths stopped at the gate,
Failed downloads reported their state.
Delivered manifests reached validation bright,
And tests kept the flow in sight.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title uses the conventional commit format and accurately describes the CSV delivery change.
Description check ✅ Passed The description directly explains CSV delivery, failure handling, parameter forwarding, validation, and regression tests.
Linked Issues check ✅ Passed The changes satisfy issue #432. CSV preparation invokes the configured deliverer, forwards the working directory, progress reporter, and cancellation token, returns delivery failures, uses the deliver…
Out of Scope Changes check ✅ Passed The changes are limited to CSV content delivery behavior and its regression tests. No unrelated code changes are identified.
Docstring Coverage ✅ Passed Docstring coverage is 75.00% which is sufficient. The required threshold is 50.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 2 files.
Full details: Linked Issues check

Explanation

The changes satisfy issue #432. CSV preparation invokes the configured deliverer, forwards the working directory, progress reporter, and cancellation token, returns delivery failures, uses the delivered manifest for validation, and adds the required regression tests.

✨ 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 codex/fix-csv-provider-delivery

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.

@qodo-code-review

qodo-code-review Bot commented Aug 30, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Delivery changes manifest identity ✓ Resolved 🐞 Bug ≡ Correctness
Description
The delivered manifest regenerates its ID from the display name and converts versions such as 1.08
to integer 0, instead of preserving the registry/discovered ID and original version. Acquisition
therefore returns and stores the content under a different identity than the requested CSV catalog
entry.
Code

GenHub/GenHub/Features/Content/Services/ContentProviders/CsvContentProvider.cs[116]

+        return OperationResult<ContentManifest>.CreateSuccess(deliveryResult.Data ?? manifest);
Relevance

●●● Strong

Recent CSV-provider review accepted preserving authoritative content identity; regenerated IDs and
altered versions conflict with that pattern.

PR-#425

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
CsvResolver preserves an authoritative discovered ID and string version, while HttpContentDeliverer
parses the version as an integer and asks ContentManifestBuilder to generate a fresh ID. The builder
writes the parsed version and regenerates the ID from publisher, display name, type, and integer
version.

GenHub/GenHub/Features/Content/Services/ContentResolvers/CsvResolver.cs[278-307]
GenHub/GenHub/Features/Content/Services/ContentDeliverers/HttpContentDeliverer.cs[59-77]
GenHub/GenHub/Features/Manifest/ContentManifestBuilder.cs[111-120]
GenHub/GenHub/Features/Manifest/ContentManifestBuilder.cs[184-216]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
HTTP delivery returns a rebuilt manifest with a regenerated ID and a lossy integer version rather than the CSV manifest identity.

## Issue Context
The requested manifest may carry an authoritative discovered ID, and CSV versions are arbitrary strings. Delivery must retain both exactly.

## Fix Focus Areas
- GenHub/GenHub/Features/Content/Services/ContentDeliverers/HttpContentDeliverer.cs[59-77]
- GenHub/GenHub/Features/Content/Services/ContentResolvers/CsvResolver.cs[278-307]
- GenHub/GenHub/Features/Content/Services/ContentProviders/CsvContentProvider.cs[110-116]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Delivered files always fail validation ✓ Resolved 🐞 Bug ≡ Correctness
Description
The newly invoked HTTP deliverer marks each downloaded CSV file as ContentAddressable but neither
copies its hash nor stores it in CAS, so downstream validation emits “ContentAddressable file
missing hash” and the orchestrator rejects the acquisition. Because CanDeliver requires at least
one downloadable file, every real CSV delivery reaches this failure.
Code

GenHub/GenHub/Features/Content/Services/ContentProviders/CsvContentProvider.cs[R104-107]

+        var deliveryResult = await Deliverer.DeliverContentAsync(
+            manifest,
+            workingDirectory,
+            progress,
Relevance

●●● Strong

Recent reviews accept concrete delivery/validation failures; CSV delivery’s missing hash directly
breaks the PR’s stated workflow.

PR-#423
PR-#425

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
CSV resolution supplies hash and size, but HTTP delivery discards them and hardcodes CAS. Content
validation explicitly rejects a CAS entry without a hash, and the orchestrator turns that validation
error into acquisition failure.

GenHub/GenHub/Features/Content/Services/ContentResolvers/CsvResolver.cs[217-250]
GenHub/GenHub/Features/Content/Services/ContentDeliverers/HttpContentDeliverer.cs[94-152]
GenHub/GenHub/Features/Manifest/ContentManifestBuilder.cs[869-903]
GenHub/GenHub/Features/Content/Services/ContentValidator.cs[119-137]
GenHub/GenHub/Features/Content/Services/ContentOrchestrator.cs[544-556]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
CSV delivery rebuilds downloaded files as hashless CAS entries, causing mandatory validation to reject the acquisition.

## Issue Context
Downloaded files exist in the staging directory, not CAS. Preserve the original hash, size, requiredness, and other file metadata, and use a source type that makes validation check the staged file unless the deliverer actually inserts it into CAS.

## Fix Focus Areas
- GenHub/GenHub/Features/Content/Services/ContentDeliverers/HttpContentDeliverer.cs[94-152]
- GenHub/GenHub/Features/Content/Services/ContentProviders/CsvContentProvider.cs[104-116]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Repeated deliveries share manifest state ✓ Resolved 🐞 Bug ☼ Reliability
Description
Each newly activated delivery reuses the same mutable builder, whose Build() returns one
persistent manifest without clearing its file or dependency collections. A second CSV acquisition on
the same orchestrator/provider therefore receives files from the first acquisition, while duplicate
paths may silently retain the first package’s entries.
Code

GenHub/GenHub/Features/Content/Services/ContentProviders/CsvContentProvider.cs[104]

+        var deliveryResult = await Deliverer.DeliverContentAsync(
Relevance

●● Moderate

State-retention risk is plausible, but no close precedent specifically accepts reusable
manifest-builder contamination in this provider.

PR-#423

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
HttpContentDeliverer captures one builder field, ContentManifestBuilder owns one manifest and
returns that same object, and the scoped orchestrator retains its provider instances for multiple
operations. The duplicate check then skips later files with paths already accumulated in the
builder.

GenHub/GenHub/Features/Content/Services/ContentDeliverers/HttpContentDeliverer.cs[22-26]
GenHub/GenHub/Features/Manifest/ContentManifestBuilder.cs[21-38]
GenHub/GenHub/Features/Manifest/ContentManifestBuilder.cs[752-783]
GenHub/GenHub/Features/Manifest/ContentManifestBuilder.cs[905-915]
GenHub/GenHub/Features/Content/Services/ContentOrchestrator.cs[55-68]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
HttpContentDeliverer reuses one mutable ContentManifestBuilder across multiple CSV acquisitions, contaminating later manifests.

## Issue Context
Use the registered builder factory to create a fresh builder for every delivery, or stop rebuilding and clone the input manifest without shared mutable state.

## Fix Focus Areas
- GenHub/GenHub/Features/Content/Services/ContentDeliverers/HttpContentDeliverer.cs[22-26]
- GenHub/GenHub/Features/Content/Services/ContentDeliverers/HttpContentDeliverer.cs[63-164]
- GenHub/GenHub/Features/Manifest/ContentManifestBuilder.cs[21-38]
- GenHub/GenHub/Infrastructure/DependencyInjection/ManifestModule.cs[55-60]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

4. Cancellation becomes delivery failure ✓ Resolved 🐞 Bug ☼ Reliability
Description
Cancellation thrown by the HTTP deliverer’s loop or download service is caught as a general
exception, then the new provider call returns it as a normal delivery failure. Callers that
explicitly rely on OperationCanceledException propagation therefore cannot distinguish user
cancellation from a failed CSV download.
Code

GenHub/GenHub/Features/Content/Services/ContentProviders/CsvContentProvider.cs[108]

+            cancellationToken);
Relevance

●●● Strong

Recent repository precedent explicitly accepts preserving OperationCanceledException instead of
converting cancellation into ordinary delivery failure.

PR-#385
PR-#423

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
HttpContentDeliverer explicitly throws when the token is canceled but catches all exceptions and
returns failure. Both BaseContentProvider and ContentOrchestrator have dedicated cancellation
catches, proving the pipeline expects cancellation to propagate as an exception.

GenHub/GenHub/Features/Content/Services/ContentDeliverers/HttpContentDeliverer.cs[98-130]
GenHub/GenHub/Features/Content/Services/ContentDeliverers/HttpContentDeliverer.cs[164-169]
GenHub/GenHub/Features/Content/Services/ContentProviders/BaseContentProvider.cs[257-265]
GenHub/GenHub/Features/Content/Services/ContentOrchestrator.cs[620-627]
PR-#423

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
CSV HTTP delivery converts OperationCanceledException into an OperationResult failure instead of propagating cancellation.

## Issue Context
Add a dedicated OperationCanceledException catch that rethrows before the general exception handler, preserving the cancellation contract used by BaseContentProvider and ContentOrchestrator.

## Fix Focus Areas
- GenHub/GenHub/Features/Content/Services/ContentDeliverers/HttpContentDeliverer.cs[98-169]
- GenHub/GenHub/Features/Content/Services/ContentProviders/CsvContentProvider.cs[104-113]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
✅ Compliance rules (platform): 29 rules
Review mode: ⚖️ Balanced

Grey Divider

Tip of the day
💡 Did you know, you can enable the Remediation agent and Qodo fixes findings in a dedicated fix PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 30, 2026
@sonarqubecloud

Copy link
Copy Markdown

$"Content delivery failed: {deliveryResult.FirstError}");
}

return OperationResult<ContentManifest>.CreateSuccess(deliveryResult.Data ?? manifest);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: deliveryResult.Data ?? manifest fallback is unreachable.

HttpContentDeliverer.DeliverContentAsync returns OperationResult<ContentManifest>.CreateSuccess(packageManifest) on success (HttpContentDeliverer.cs:102), so Data is never null when Success is true. The ?? manifest branch is dead code and obscures the contract — either the deliverer's contract is "Data non-null on success" (then drop the fallback) or it isn't (then the deliverer should be fixed to honor it). Keeping the fallback silently masks future regressions where a deliverer returns Success(null).

Suggested change
return OperationResult<ContentManifest>.CreateSuccess(deliveryResult.Data ?? manifest);
return OperationResult<ContentManifest>.CreateSuccess(deliveryResult.Data!);

Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Aug 30, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
GenHub/GenHub/Features/Content/Services/ContentProviders/CsvContentProvider.cs 116 deliveryResult.Data ?? manifest fallback is unreachable — HttpContentDeliverer returns Success(packageManifest) so Data is never null; either drop the fallback or fix the deliverer contract.
Files Reviewed (4 files)
  • GenHub/GenHub/Features/Content/Services/ContentProviders/CsvContentProvider.cs - 1 issue
  • GenHub/GenHub/Features/Content/Services/ContentDeliverers/HttpContentDeliverer.cs - 0 issues
  • GenHub/GenHub.Tests/GenHub.Tests.Core/Features/Content/CsvContentProviderTests.cs - 0 issues
  • GenHub/GenHub.Tests/GenHub.Tests.Core/Features/Content/Services/ContentDeliverers/HttpContentDelivererTests.cs - 0 issues

Notes

The 4 high/medium Qodo findings on CsvContentProvider.cs (lines 104, 107, 108, 116) have been resolved by commits 61f6085 and a24e79f: the builder-based manifest rebuild was removed from HttpContentDeliverer, the cancellation rethrow was added, and the resolved manifest is now passed through unchanged. The new ResolveTargetPath guard at HttpContentDeliverer.cs:140 provides path-containment protection.

Fix these issues in Kilo Cloud


Reviewed by minimax-m3:free · Input: 61.2K · Output: 7.4K · Cached: 698.5K

@bobtista
bobtista merged commit 28a9637 into development Aug 30, 2026
15 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.

CSV content provider skips HTTP delivery

1 participant