Skip to content

Conversation

@SATYAsasini
Copy link
Contributor

@SATYAsasini SATYAsasini commented Jul 28, 2025

Description

Fixes #6764

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR requires documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have tested it for all user roles.
  • I have added all the required unit/api test cases.

Does this PR introduce a user-facing change?


Summary by Bito

This PR refactors unit conversion logic in the k8s capacity service to fix resource measurement inaccuracies. It enhances memory unit conversion (Gi, Mi, Ki), implements precise CPU conversion, and adds detailed comments for better understanding. These changes correct resource capacity calculations while improving code readability.

@bito-code-review
Copy link

bito-code-review bot commented Jul 28, 2025

Code Review Agent Run #343091

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 2e22e5b..2e22e5b
    • pkg/k8s/capacity/k8sCapacityService.go
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@SATYAsasini SATYAsasini changed the title fix: refactored unit conversion for cluster details fix: unify unit formatting and conversion for CPU and memory in cluster resources Jul 28, 2025
@bito-code-review
Copy link

Changelist by Bito

This pull request implements the following key changes.

Key Change Files Impacted
Bug Fix - Refactored Resource Unit Conversion

k8sCapacityService.go - Enhanced conversion logic for resource quantities with precise rounding and CPU-specific handling.

@sonarqubecloud
Copy link

@bito-code-review
Copy link

Bito Banner

Bito's AI Code Review trial is almost over

Your free trial of Bito's AI Code Reviews was setup by [email protected] and is nearly over. Let them know if you'd like to continue getting complete reviews.

Sign in to upgrade

About Bito
Merge PRs 89% faster, with 34% fewer regressions, and 87% of relevant PR feedback provided by Bito's AI Code Reviews. Trusted by 100,000+ developers and 1,000+ engineering teams.

@SATYAsasini SATYAsasini merged commit b177abc into develop Jul 28, 2025
10 checks passed
@SATYAsasini SATYAsasini deleted the fix-clusterDetailResourceCapacity-oss branch July 28, 2025 10:15
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.

4 participants