Skip to content

feat(recommendations): preserve source account provenance - #883

Merged
cristim merged 1 commit into
mainfrom
feat/recommendation-source-account
Oct 15, 2026
Merged

cristim merged 1 commit into
mainfrom
feat/recommendation-source-account

Conversation

@cristim

@cristim cristim commented Oct 15, 2026

Copy link
Copy Markdown
Member

Provider recommendations can name a source account that differs from the registered collector. The converter discarded that identity, preventing later source-aware matching. This change carries the nonempty provider value verbatim in optional source_account_id, independently of cloud_account_id.

Persistence rejects NUL and invalid UTF-8 with a fixed error before JSON encoding. A failure rolls back earlier batches, replacement deletion, eviction and freshness updates.

Refs #799. Recommendation IDs, the SQL conflict target and consumer identity remain unchanged. Same-tuple source variants still need the later identity steps; this PR does not complete Archera matching or the real-account validation tracked in #798.

Validation at 39c344541afe8245c0d4e09eb2b6303e6586bdeb: Go 1.26.9 backend build and package race tests, golangci-lint 2.10.1 including integration tests, complexity checks and normal hooks passed. Two source passes and exact-byte staged review are clean. Fresh independent cold verification completed two adversarial passes with no actionable findings: real loopback HTTP through the AWS SDK, production conversion/tagging and local PostgreSQL 17.11 JSONB roundtrip; 501-row upsert/replace rollback; null, empty, case and Unicode checks; parent regression and scratch mutation failures at the intended assertions.

Native evidence uses synthetic local data. AWS RI SDK transport was exercised; AWS SP and Azure/GCP provider assignments were checked against pinned source, with converter unit tests for all three clouds. No live provider, purchase or customer database verification is claimed.

@cristim cristim added effort/l Weeks triaged Item has been triaged priority/p3 Polish / idea / may never ship severity/low Minor harm urgency/eventually No deadline impact/few Limited audience type/feat New capability labels Oct 15, 2026
@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 7 billable files and costs up to $1.75.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 28 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 61 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: LeanerCloud/cloud-commitments-platform/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: d228eedf-1f21-4f4b-b97a-705a2ca1cd28
📥 Commits

Reviewing files that changed from the base of the PR and between 21910e3 and 39c3445.

📒 Files selected for processing: 7
  • internal/config/store_postgres_recommendation_source_account_test.go
  • internal/config/store_postgres_recommendations.go
  • internal/config/types.go
  • internal/scheduler/recommendation_completeness_integration_test.go
  • internal/scheduler/recommendation_source_account_integration_test.go
  • internal/scheduler/recommendation_source_account_test.go
  • internal/scheduler/scheduler.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@cristim

cristim commented Oct 15, 2026

Copy link
Copy Markdown
Member Author

This PR uses the independent-review path permitted by the project policy. Two fresh adversarial passes and native PostgreSQL/SDK verification cover 39c3445, as recorded in the description. CodeRabbit reported an included-review limit and did not review this head; no paid review or retry is requested. Any actual findings remain subject to resolution, and required CI and normal merge protections still apply.

@cristim
cristim merged commit 842ec35 into main Oct 15, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/l Weeks impact/few Limited audience priority/p3 Polish / idea / may never ship severity/low Minor harm triaged Item has been triaged type/feat New capability urgency/eventually No deadline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant