Skip to content

fix(api): show attached planned purchase quantities - #876

Merged
cristim merged 1 commit into
mainfrom
fix/631-ship-planned-projection
Oct 15, 2026
Merged

cristim merged 1 commit into
mainfrom
fix/631-ship-planned-projection

Conversation

@cristim

@cristim cristim commented Oct 14, 2026

Copy link
Copy Markdown
Member

Attached planned purchases currently report the number of recommendation rows as their quantity and always show generic resource labels. One stored 20-unit Azure recommendation therefore appears as 1 / Various / Multiple.

Sum the stored recommendation quantities and show resource type and region when each field is consistently known. Mixed or missing fields retain the existing generic labels. Raw quantities remain authoritative across reservation instances, Azure quantities, GCP vCPUs and Savings Plans; hourly commitment amounts are not converted into units.

Refs #631. This 83-line change covers only the mapper and its 15-case regression table. The existing combined API execution proof is exercised through a reviewed test overlay and will be retained in a separate small test PR.

Verification at 8c6c54c1911e51b680ebe943febfc1d6485fa70b (tree f1bb1158eae8a8e00dfdd39d70f0222ebb768aa5, base 5134af444026276c6cdbf7a135ca00e54d656ef0):

  • Two independent source/staged review passes and two fresh adversarial verification passes on the full diff, using the owner-selected GPT-6.1 Sol medium reviewer. No actionable findings.
  • Real authenticated-handler and PostgreSQL 119 paths confirm GET /api/purchases/planned returns 20 / Standard_D2s_v3 / westeurope. The unchanged parent fails those exact assertions while the unattached control passes.
  • Independent native verification passed the projection, manual approval/global-OFF, automatic/global-ON and cap-refusal cases in 6.417s. A scratch count mutation caused 11 quantity assertions to fail, with empty and Savings Plan controls passing.
  • Affected API and purchase race suites passed, pinned lint reported zero issues, build passed, and all normal commit hooks passed. A separate exact-commit native rerun passed in 7.221s.

These tests use real API/store/resolver/manager code and PostgreSQL, with simulated authentication, credentials, email, clock/global settings and an explicit recording-only provider. They do not perform a live cloud purchase, deployment or browser session. Existing authorization, caps, execution controls and unsupported Savings Plan policy are unchanged.

@cristim cristim added urgency/this-sprint Within the current sprint triaged Item has been triaged priority/p1 Next up; this sprint severity/high Significant harm impact/many Affects most users effort/xl Multi-week / refactor type/feat New capability labels Oct 14, 2026
@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 2 billable files and costs up to $0.50.

  • 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 22 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 64 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: 248c00d1-6472-4751-a828-af489e10507a
📥 Commits

Reviewing files that changed from the base of the PR and between 5134af4 and 8c6c54c.

📒 Files selected for processing: 2
  • internal/api/handler_purchases.go
  • internal/api/plan_display_test.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 14, 2026

Copy link
Copy Markdown
Member Author

Exact-head independent review is complete for 8c6c54c1911e51b680ebe943febfc1d6485fa70b, tree f1bb1158eae8a8e00dfdd39d70f0222ebb768aa5, against base 5134af444026276c6cdbf7a135ca00e54d656ef0.

The retained non-author reviewer completed two adversarial source/staged passes. A fresh independent GPT-6.1 Sol medium verifier completed two full-diff passes and independently traced account-scoped GET routing, stored recommendation decoding, DTO projection and escaped frontend consumption against the pinned provider quantity contracts. No actionable findings remain.

Independent macOS/PostgreSQL verification passed all four combined cases, the 15 committed table cases, unattached control and additional sparse/order cases in 6.417s. The unchanged parent failed the actual GET quantity/type/region assertions while controls passed. A scratch count mutation caused 11 quantity failures while empty and Savings Plan controls passed. Exact-commit author native verification also passed in 7.221s; affected race suites, pinned lint, build and normal hooks passed.

CodeRabbit reported a review-capacity limit and produced no review. Its green status is not counted as a review verdict. We are using the explicitly authorized complete independent-review path, with no paid review or quota wait. Required CI remains pending and must pass on this exact head before a normal merge.

The API/store/resolver/manager and PostgreSQL paths are real. Authentication, credentials, email, global settings, clock and the recording-only cloud provider are fixtures. No live purchase, deployment or new browser proof is claimed.

@cristim

cristim commented Oct 15, 2026

Copy link
Copy Markdown
Member Author

CI recovery at unchanged head 8c6c54c1911e51b680ebe943febfc1d6485fa70b:

All jobs except integration passed. The integration step remained active for 45 minutes, compared with recent successful same-backend steps of 10m30s, 10m41s and 14m50s. The workflow's 20-minute timeout applies per package, so elapsed time alone was not treated as proof of a code failure or hang.

After independent review, normal cancellation was requested once. Attempt 1 eventually completed as canceled; the dependent CI summary correctly failed. No force-cancel was used. GitHub returned no integration job log through either REST or the normal CLI, and annotations only recorded the requested cancellation. Its assertion outcome remains unknown.

One normal targeted rerun of integration and its dependent summary has now been requested at the same commit. Other successful jobs remain retained, and a fresh background watcher is armed. No source, timeout, test inventory or protection changed. The canceled attempt is not counted as a pass. Fresh successful required CI, the existing exact-head independent review and normal merge protections remain mandatory. A repeated delay or failure will be investigated rather than retried in a loop.

@cristim

cristim commented Oct 15, 2026

Copy link
Copy Markdown
Member Author

The one targeted integration retry completed successfully at unchanged head 8c6c54c1911e51b680ebe943febfc1d6485fa70b. Workflow 38656898282 attempt 2 and its fresh CI Success summary are successful; the retained pre-commit and all other jobs are also successful. The retry watcher exited 0 and was reaped.

Final live checks confirm the reviewed head and base are unchanged, the PR is MERGEABLE/CLEAN, and there are no inline or submitted review findings. The exact-head independent review and real-path local verification remain recorded in this PR. The canceled first attempt remains an unknown interrupted result, not evidence of a diagnosed infrastructure fault or a pass. No force-cancel, source change, timeout change or protection bypass was used.

@cristim
cristim merged commit 9da13c6 into main Oct 15, 2026
44 of 46 checks passed
@cristim

cristim commented Oct 15, 2026

Copy link
Copy Markdown
Member Author

Merged #876 normally as 9da13c6cefee4dbbdb9515c483ed92acaf5ae81a from reviewed head 8c6c54c1911e51b680ebe943febfc1d6485fa70b. The merged tree exactly matches the independently reviewed tree. All required checks passed, including the one targeted integration retry and its fresh summary; no protection bypass, force-cancel or source change was used.

The planned-purchases API now sums attached recommendation quantities and reports resource type and region when consistently known. Real local API/PostgreSQL verification confirms 20 / Standard_D2s_v3 / westeurope for the Azure regression, with unchanged-parent failures and independent mutation controls recorded above. Provider-specific raw unit semantics and existing authorization, caps and execution controls are preserved.

All four automatic post-merge workflows have individual background watchers. Deployment and authenticated live-listing results are not claimed yet. The already verified 374-line combined API/execution regression will be retained in a separate test-only PR; the existing UI date-default correction is #877. No live purchase or manual deployment was performed.

@cristim

cristim commented Oct 15, 2026

Copy link
Copy Markdown
Member Author

The running deployment now reports #876's source version: public GET /version returned HTTP 200 with git_sha=9da13c6 and build time 20261015011008. Lambda is Active/Successful, and its resolved image digest matches the image tagged with that commit and timestamp. Automatic deployment 38664043722 succeeded at full commit 9da13c6cefee4dbbdb9515c483ed92acaf5ae81a.

This is read-only deployed-source verification. Authenticated live planned-purchase listing was not exercised because this lane had no existing API session. The affected GET response and quantities were verified through the real local handler/PostgreSQL path recorded above. No live purchase, configuration change or manual deployment occurred.

Post-merge frontend and pre-commit workflows succeeded. The full main CI watcher remains active. The separate permanent combined regression-test leaf is committed locally and undergoing fresh independent verification; the existing UI date-default fix is #877.

@cristim

cristim commented Oct 15, 2026

Copy link
Copy Markdown
Member Author

All four post-merge workflows for 9da13c6cefee4dbbdb9515c483ed92acaf5ae81a are now successful: full CI 38664043763, pre-commit 38664043741, frontend sentinel 38664043804 and automatic deployment 38664043722. The full CI watcher encountered a transport timeout; GitHub's actual terminal result was checked directly and confirmed successful, so no test retry or source change was needed.

The read-only deployed-source verification is recorded above. The combined regression is now tracked in test-only #878; the existing UI date-default correction is #877. No live purchase or authenticated live planned-listing result is claimed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/xl Multi-week / refactor impact/many Affects most users priority/p1 Next up; this sprint severity/high Significant harm triaged Item has been triaged type/feat New capability urgency/this-sprint Within the current sprint

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant