Skip to content

Conversation

@lhhyung
Copy link
Member

@lhhyung lhhyung commented Jun 10, 2025

Category

  • New feature
  • Bug fix
  • Improvement
  • Refactor
  • etc

Description

Add support for Refunds and refine options handling in PAYG cost calculation

Known issue

@lhhyung lhhyung requested a review from Copilot June 10, 2025 04:05
@lhhyung lhhyung self-assigned this Jun 10, 2025
@lhhyung lhhyung added enhancement New feature or request pass/signedoff labels Jun 10, 2025
@github-actions
Copy link

⚠️ @lhhyung the signed-off-by was not found in the following 3 commits:

  • cc84298: fix: Update cost calculation logic for PAYG
  • 12b92b9: feat: Add support for Refunds and refine options handling in PAYG cost calculation
  • e47eeb3: Merge branch 'cloudforet-io:master' into master

✅ Why it is required

The Developer Certificate of Origin (DCO) is a lightweight way for contributors to certify that they wrote or otherwise have the right to submit the code they are contributing to the project. Here is the full text of the DCO.

Contributors sign-off that they adhere to these requirements by adding a Signed-off-by line to commit messages.

This is my commit message

Signed-off-by: Random Developer <randomdeveloper@example.com>

Git even has a -s command line option to append this automatically to your commit message:

$ git commit -s -m 'This is my commit message'

1 similar comment
@github-actions
Copy link

⚠️ @lhhyung the signed-off-by was not found in the following 3 commits:

  • cc84298: fix: Update cost calculation logic for PAYG
  • 12b92b9: feat: Add support for Refunds and refine options handling in PAYG cost calculation
  • e47eeb3: Merge branch 'cloudforet-io:master' into master

✅ Why it is required

The Developer Certificate of Origin (DCO) is a lightweight way for contributors to certify that they wrote or otherwise have the right to submit the code they are contributing to the project. Here is the full text of the DCO.

Contributors sign-off that they adhere to these requirements by adding a Signed-off-by line to commit messages.

This is my commit message

Signed-off-by: Random Developer <randomdeveloper@example.com>

Git even has a -s command line option to append this automatically to your commit message:

$ git commit -s -m 'This is my commit message'

@lhhyung lhhyung merged commit 85c87da into cloudforet-io:master Jun 10, 2025
0 of 2 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the PAYG cost calculation logic to add support for refunds while refining options handling with new cost metrics.

  • Modified dictionary keys in data_source_manager to accept string values for cost options and added a new key for showing retail costs.
  • Updated cost_manager to pass options through to cost info functions and added logic to handle refund scenarios.
  • Expanded cost configuration to include "Refund" as an accepted value.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/cloudforet/cost_analysis/manager/data_source_manager.py Updated option keys and types for reservation cost handling
src/cloudforet/cost_analysis/manager/cost_manager.py Refactored function signatures and integrated refund support in cost calculation
src/cloudforet/cost_analysis/conf/cost_conf.py Modified configuration to include "Refund" as a valid charge type

"include_credit_cost(bool)": False,
"include_reservation_cost_at_payg(bool)": False,
"include_reservation_cost_at_payg(str)": "ActualCost",
"show_reservation_cost_as_retail(bool): False,
Copy link

Copilot AI Jun 10, 2025

Choose a reason for hiding this comment

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

There appears to be a syntax error in the dictionary key: the key 'show_reservation_cost_as_retail(bool)' is missing a closing quote. It should be corrected to "show_reservation_cost_as_retail(bool)": False.

Suggested change
"show_reservation_cost_as_retail(bool): False,
"show_reservation_cost_as_retail(bool)": False,

Copilot uses AI. Check for mistakes.
Comment on lines +544 to +547
# if cost_pay_as_you_go == 0.0:
# cost_pay_as_you_go = self._convert_str_to_float_format(
# result.get("costinbillingcurrency", 0.0)
# )
Copy link

Copilot AI Jun 10, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider removing or clarifying the commented-out code block to enhance maintainability if it is no longer necessary for future reference.

Suggested change
# if cost_pay_as_you_go == 0.0:
# cost_pay_as_you_go = self._convert_str_to_float_format(
# result.get("costinbillingcurrency", 0.0)
# )

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request pass/signedoff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant