Skip to content

Conversation

@gfyrag
Copy link
Contributor

@gfyrag gfyrag commented Dec 11, 2025


Summary by cubic

Fix CORS to allow all headers and expose the Count header so browser clients can reliably call the API. Also backports small API improvements for idempotency and time filters.

  • Bug Fixes

    • CORS: add AllowedHeaders "*" and ExposedHeaders "Count".
    • Transactions filters: support startTime/endTime (with fallback to start_time/end_time) and use the correct timestamp column.
  • New Features

    • Add Idempotency-Hit response header on write endpoints when a request reuses an idempotency key.
    • Add PUT /v2/exporters/{exporterID} to update exporter configuration, with GRPC support.
    • Pulumi: support custom image registry/repository/tag and a configurable Postgres chart version.

Written for commit e7029fb. Summary will update automatically on new commits.

@gfyrag gfyrag requested a review from a team as a code owner December 11, 2025 13:05
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 11, 2025

Caution

Review failed

Failed to post review comments

Walkthrough

Introduces idempotency support with HTTP headers, adds UpdateExporter API endpoint, refactors image configuration handling across deployments, updates TypedMocks generation, rewrites SQL migration logic, and expands client SDK models with response headers and new operations.

Changes

Cohort / File(s) Change Summary
Documentation & Configuration
README.md, internal/README.md, pkg/assets/asset.go
Updated community channel reference from Slack to GitHub Discussions; minor grammar corrections; expanded asset pattern regex to support underscore-separated codes
CLI & Command Setup
cmd/root.go, cmd/serve.go
Removed experimental-numscript-interpreter flags; changed NumscriptInterpreterFlagsToPass from String to StringSlice type
Deployment & Image Configuration
deployments/pulumi/pkg/common/common.go, deployments/pulumi/pkg/config/config.go, deployments/pulumi/pkg/utils/convert.go, deployments/pulumi/pkg/**/component.go, deployments/pulumi/pkg/storage/component_postgres.go, deployments/pulumi/pkg/worker/deployment.go, deployments/pulumi/pkg/api/deployment.go
Introduced ImageConfiguration struct; replaced Tag-based image selection with ImageConfiguration; added ChartVersion field support; centralized image tag resolution via WithFallbackTag; updated image construction across generator, provisioner, worker, and ledger deployments
API Routes & Handlers (v1)
internal/api/v1/controllers_*.go, internal/api/router.go, internal/api/v1/mocks.go
Added idempotency hit detection and Idempotency-Hit header propagation across metadata operations; enhanced CORS configuration with AllowedHeaders and ExposedHeaders; updated parameter filtering for timestamp-based queries with startTime/endTime; regenerated mocks with -typed flag
API Routes & Handlers (v2)
internal/api/v2/controllers_*.go, internal/api/v2/routes.go, internal/api/v2/mocks.go, internal/api/v2/controllers_exporters_update.go
Added UpdateExporter endpoint handler; propagated idempotency hit and headers across transaction/metadata operations; updated balance filtering to use big.Int; added support for bulk operation tracking; regenerated typed mocks
Controller Layer
internal/controller/ledger/controller.go, internal/controller/ledger/controller_*.go, internal/controller/ledger/log_process.go
Extended method signatures to return idempotencyHit boolean; propagated idempotency flag through all metadata and transaction operation paths; updated forgeLog to return idempotency indicator based on log retrieval vs. creation
System Controller & Replication
internal/controller/system/controller.go, internal/controller/system/state_tracker.go, internal/replication/manager.go, internal/replication/controller_grpc_*.go, internal/replication/store.go
Added UpdateExporter operation to ReplicationBackend interface and implementation; updated error handling for postgres.ErrNotFound; improved synchronization with locking mechanisms; added pipeline stop helper and driver lifecycle improvements
Storage & Migration (Ledger)
internal/storage/ledger/resource_*.go, internal/storage/ledger/store.go, internal/storage/common/*.go
Introduced newScopedSelect for ledger-scoped queries to replace explicit ledger filtering; updated balance calculations for effective volumes; expanded TypeNumeric to support big.Int; renamed cursor type parameter from OF to Options
Storage & Migration (System)
internal/storage/system/store.go, internal/storage/bucket/migrations/*
Added UpdateExporter implementation; centralized error handling for postgres.ErrNotFound; rewrote 13 SQL migrations (11, 17-19, 27-29, 31-34, 39, 42-43) with improved batching using row_number, temporary/permanent views, and optimized pagination patterns
Test Infrastructure & Mocks
internal/api/bulking/mocks.go, internal/api/bulking/mocks_*.go, internal/api/common/mocks_*.go, internal/api/v1/mocks_*.go, internal/api/v2/mocks_*.go, internal/controller/ledger/controller_generated_test.go, internal/replication/exporters_generated.go, internal/replication/store_generated_test.go
Regenerated all mocks with -typed flag; added specialized Call wrapper types for each mocked method; updated method signatures to include idempotencyHit boolean returns; introduced fluent Return/Do/DoAndReturn APIs on call wrappers
Client SDK Models & Operations
pkg/client/models/operations/*.go, pkg/client/v1.go, pkg/client/v2.go
Added Headers field to multiple response types; introduced GetHeaders() accessors; added V2UpdateExporterRequest/Response models; propagated HTTP headers from responses to SDK models; implemented UpdateExporter operation handler
Client Documentation
pkg/client/docs/**, docs/api/README.md
Added Headers field documentation to response models; introduced V2UpdateExporterRequest schema and update exporter API section; added Idempotency-Key and Idempotency-Hit header documentation across endpoints
End-to-End Tests
test/e2e/api_*.go, test/e2e/suite_test.go
Added comprehensive e2e tests for exporter update functionality, idempotency-hit header propagation, big integer filtering, bulk operations, and transaction revert workflows; updated test infrastructure imports
Build & Tooling
tools/provisioner/Dockerfile, tools/provisioner/justfile, pkg/testserver/server.go
Updated provisioner Dockerfile to Go 1.25; parameterized registry in push-image target; added ExperimentalPipelinesSyncPeriodInstrumentation helper

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Areas requiring extra attention:

  • SQL Migration Rewrites: 13 migrations significantly restructured with new batching patterns (row_number vs. OFFSET/LIMIT), temporary table handling, and feature-flag-conditional logic. Requires careful review of pagination correctness and performance implications.
  • Idempotency Propagation: Extensive signature changes across 6+ controller methods with boolean threading throughout call chains. Verify consistent propagation in all code paths (success, error, dry-run scenarios) and test coverage adequacy.
  • Image Configuration Refactoring: New ImageConfiguration struct and WithFallbackTag logic replace inline tag handling across multiple deployment components. Ensure image construction consistency and default fallback behavior is correct.
  • Mock Regeneration Scope: Large number of new typed call wrapper types introduced via mockgen -typed flag across multiple packages. Review for consistency and correct method signature alignment with production code.
  • UpdateExporter Implementation: New gRPC operation, storage layer, system controller, and API handler integration. Cross-verify error handling (InvalidArgument → ErrInvalidDriverConfiguration, NotFound → ErrExporterNotFound) consistency across layers.

Possibly related PRs

Suggested reviewers

  • flemzord
  • paul-nicolas

Poem

🐰 Hopping through headers and configs anew,
Idempotency keys make transactions true,
Migrations rewrit with rows numbered bright,
Image configs dance in deployment's light,
UpdateExporter hops into the fray,
A warren of changes, hooray hooray! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 2.27% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'hotfix(v2.3): cors issue' accurately describes the main fix: a CORS issue involving missing headers. It is concise, clear, and directly related to the primary changeset focus on CORS configuration.
Description check ✅ Passed The PR description comprehensively outlines the changeset including bug fixes (CORS, transaction filters), new features (idempotency-hit headers, exporter update endpoint, Pulumi improvements), and backports. The description is directly related to the actual changes made across multiple files.
✨ 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 hotfix/v2.3/cors-issue

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

@gfyrag gfyrag changed the base branch from main to release/v2.3 December 11, 2025 13:05
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.88%. Comparing base (94a5ca9) to head (e7029fb).
⚠️ Report is 2 commits behind head on release/v2.3.

Additional details and impacted files
@@               Coverage Diff                @@
##           release/v2.3    #1183      +/-   ##
================================================
+ Coverage         81.84%   81.88%   +0.04%     
================================================
  Files               187      187              
  Lines              9032     9032              
================================================
+ Hits               7392     7396       +4     
+ Misses             1205     1203       -2     
+ Partials            435      433       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gfyrag gfyrag merged commit 893cf48 into release/v2.3 Dec 12, 2025
10 of 11 checks passed
@gfyrag gfyrag deleted the hotfix/v2.3/cors-issue branch December 12, 2025 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants