Skip to content

Conversation

@ImMin5
Copy link
Member

@ImMin5 ImMin5 commented May 21, 2025

Category

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

Description

  • add sync_currency api to report_adjustment_policy.proto for currency

Known issue

@ImMin5 ImMin5 requested a review from Copilot May 21, 2025 07:08
@ImMin5 ImMin5 self-assigned this May 21, 2025
@ImMin5 ImMin5 added the enhancement New feature or request label May 21, 2025
@ImMin5 ImMin5 merged commit ca3b64a into cloudforet-io:master May 21, 2025
3 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

Adds a new currency synchronization endpoint and extends/enhances existing proto definitions for adjustment policies and reports.

  • Introduce a sync_currency RPC under the ReportAdjustmentPolicy service
  • Extend Scope enums everywhere with a SERVICE_ACCOUNT member
  • Restructure policy messages (remove name, add description, reorder fields) and rename AdjustmentMethodAdjustmentUnit in report adjustments

Reviewed Changes

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

File Description
proto/spaceone/api/cost_analysis/v1/report_adjustment_policy.proto Added sync_currency RPC; appended SERVICE_ACCOUNT to Scope enums; reordered and renamed fields in Create/Update/Info messages
proto/spaceone/api/cost_analysis/v1/report_adjustment.proto Renamed AdjustmentMethod enum to AdjustmentUnit and updated all references
proto/spaceone/api/cost_analysis/v1/cost_report_config.proto Appended SERVICE_ACCOUNT to the Scope enum
Comments suppressed due to low confidence (3)

proto/spaceone/api/cost_analysis/v1/report_adjustment_policy.proto:42

  • There are no tests covering the new 'sync_currency' RPC. Add unit or integration tests to verify its behavior and HTTP mapping.
rpc sync_currency (ReportAdjustmentPolicyRequest) returns (ReportAdjustmentPolicyInfo) {

proto/spaceone/api/cost_analysis/v1/report_adjustment_policy.proto:77

  • Reordering and reusing field tags (removing 'name' and shifting 'scope' from 2→1) breaks backward compatibility. Instead, introduce new fields for additions and deprecate old ones without renumbering existing tags.
Scope scope = 1;

proto/spaceone/api/cost_analysis/v1/report_adjustment.proto:58

  • Renaming the enum from 'AdjustmentMethod' to 'AdjustmentUnit' is a breaking change. Consider deprecating the old enum and introducing the new one alongside it to maintain compatibility.
enum AdjustmentUnit {

};
}

rpc sync_currency (ReportAdjustmentPolicyRequest) returns (ReportAdjustmentPolicyInfo) {
Copy link

Copilot AI May 21, 2025

Choose a reason for hiding this comment

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

Using a generic ReportAdjustmentPolicyRequest for the new sync_currency RPC may obscure which fields are required. Define a dedicated SyncCurrencyRequest message with explicit parameters to improve clarity.

Suggested change
rpc sync_currency (ReportAdjustmentPolicyRequest) returns (ReportAdjustmentPolicyInfo) {
rpc sync_currency (SyncCurrencyRequest) returns (ReportAdjustmentPolicyInfo) {

Copilot uses AI. Check for mistakes.
int32 order = 3;
// +optional
google.protobuf.Struct tags = 6;
string description = 4;
Copy link

Copilot AI May 21, 2025

Choose a reason for hiding this comment

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

The 'description' field is intended to be optional but lacks a '+optional' annotation. Add '+optional' to align with other fields and improve readability.

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