Skip to content

fix: display correct multiplier for non-list fields#1449

Merged
ysmolski merged 2 commits intomasterfrom
yury/fix_costs_debug
Mar 17, 2026
Merged

fix: display correct multiplier for non-list fields#1449
ysmolski merged 2 commits intomasterfrom
yury/fix_costs_debug

Conversation

@ysmolski
Copy link
Copy Markdown
Contributor

@ysmolski ysmolski commented Mar 17, 2026

Very small fix to make debugging easier.

Summary by CodeRabbit

  • Bug Fixes
    • Improved cost calculation logic for non-list fields by enforcing a minimum multiplier threshold. The system now ensures non-zero multipliers are applied appropriately, preventing anomalies in cost computations. This results in more accurate cost calculations and clearer debug output throughout the application.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fe81dacf-41a8-40a4-983e-7cf4705c7bba

📥 Commits

Reviewing files that changed from the base of the PR and between 310c26a and 098ad12.

📒 Files selected for processing (1)
  • v2/pkg/engine/plan/cost.go

📝 Walkthrough

Walkthrough

This change adds logic to enforce a minimum multiplier of 1 for non-list fields in cost calculations and debug output. When the computed multiplier is zero and the field does not return a list, the multiplier is coerced to 1.

Changes

Cohort / File(s) Summary
Cost multiplier enforcement
v2/pkg/engine/plan/cost.go
Adds conditional logic to coerce zero multipliers to 1 for non-list fields in both cost calculation and debug printing routines.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: enforcing a minimum multiplier of 1 for non-list fields in cost calculations, which directly affects how the multiplier is displayed in debug output.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch yury/fix_costs_debug
📝 Coding Plan
  • Generate coding plan for human review comments

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

Tip

CodeRabbit can use your project's `golangci-lint` configuration to improve the quality of Go code reviews.

Add a configuration file to your project to customize how CodeRabbit runs golangci-lint.

@ysmolski ysmolski merged commit cba8401 into master Mar 17, 2026
10 checks passed
@ysmolski ysmolski deleted the yury/fix_costs_debug branch March 17, 2026 13:34
ysmolski pushed a commit that referenced this pull request Mar 17, 2026
🤖 I have created a release *beep* *boop*
---


##
[2.0.0-rc.265](v2.0.0-rc.264...v2.0.0-rc.265)
(2026-03-17)


### Bug Fixes

* display correct multiplier for non-list fields
([#1449](#1449))
([cba8401](cba8401))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

## Release Notes

* **Bug Fixes**
* Fixed an issue where the multiplier was not displayed correctly for
non-list fields.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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