-
Notifications
You must be signed in to change notification settings - Fork 11
[Pull Request] Merged Refactoring codes to Master #359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature-refactoring
Are you sure you want to change the base?
[Pull Request] Merged Refactoring codes to Master #359
Conversation
Signed-off-by: ImMin5 <[email protected]>
Modify analyze Daily date range 1 month -> 31days
Signed-off-by: ImMin5 <[email protected]>
Modify budget and budget usages all apis
Signed-off-by: ImMin5 <[email protected]>
Remove unused files
Signed-off-by: ImMin5 <[email protected]>
Add convert model decorator at budget usage analyze api
Signed-off-by: ImMin5 <[email protected]>
Signed-off-by: ImMin5 <[email protected]>
Signed-off-by: ImMin5 <[email protected]>
Add budget alert notification function
Signed-off-by: ImMin5 <[email protected]>
Signed-off-by: ImMin5 <[email protected]>
Signed-off-by: ImMin5 <[email protected]>
Add logic for project based budget
Signed-off-by: ImMin5 <[email protected]>
Signed-off-by: ImMin5 <[email protected]>
Signed-off-by: ImMin5 <[email protected]>
Signed-off-by: ImMin5 <[email protected]>
# Conflicts: # src/spaceone/cost_analysis/interface/grpc/budget_usage.py # src/spaceone/cost_analysis/manager/budget_manager.py # src/spaceone/cost_analysis/manager/budget_usage_manager.py # src/spaceone/cost_analysis/manager/email_manager.py # src/spaceone/cost_analysis/manager/identity_manager.py # src/spaceone/cost_analysis/model/__init__.py # src/spaceone/cost_analysis/model/budget/request.py # src/spaceone/cost_analysis/model/budget/response.py # src/spaceone/cost_analysis/model/budget_usage/request.py # src/spaceone/cost_analysis/model/budget_usage/response.py # src/spaceone/cost_analysis/service/budget_service.py # src/spaceone/cost_analysis/service/budget_usage_service.py # src/spaceone/cost_analysis/service/cost_report_serivce.py # src/spaceone/cost_analysis/service/unified_cost_service.py
Signed-off-by: ImMin5 <[email protected]>
Modify field name notifications -> notification
Signed-off-by: ImMin5 <[email protected]>
Implement budget state update job scheduling and enhance budget state management
Signed-off-by: ImMin5 <[email protected]>
Add service_account_id field to budget usage model
… filter Signed-off-by: ImMin5 <[email protected]>
Add service_account_id field to budget usage list request query filter
Migrate cost report services to UnifiedCost model
…ster Revert "Migrate cost report services to UnifiedCost model"
Signed-off-by: ImMin5 <[email protected]>
…-pg-filter Add Unified cost analysis with domain_id filtering and project_group_id
Signed-off-by: ImMin5 <[email protected]>
Add error handling for duplicated budget thresholds
Signed-off-by: ImMin5 <[email protected]>
Update workspace_id field to be optional when get budget info
# Conflicts: # src/spaceone/cost_analysis/manager/budget_manager.py # src/spaceone/cost_analysis/manager/budget_usage_manager.py # src/spaceone/cost_analysis/service/budget_service.py
✅ Why it is requiredThe 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
Git even has a
|
✅ Why it is requiredThe 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
Git even has a
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, just a minor tweak needed for the type hint.
@@ -85,7 +85,8 @@ def get_data_source_plugin_endpoint_by_vo(self, data_source_vo: DataSource): | |||
|
|||
return endpoint | |||
|
|||
def get_data_source_plugin_endpoint(self, plugin_info, domain_id): | |||
@staticmethod | |||
def get_data_source_plugin_endpoint(plugin_info, domain_id): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def get_data_source_plugin_endpoint(plugin_info, domain_id): | |
def get_data_source_plugin_endpoint(plugin_info: dict, domain_id:str) -> str: |
@@ -113,7 +114,8 @@ def upgrade_data_source_plugin_version( | |||
plugin_metadata, resource_group, data_source_id, workspace_id, domain_id | |||
) | |||
|
|||
def delete_data_source_rules(self, data_source_id, domain_id): | |||
@staticmethod | |||
def delete_data_source_rules(data_source_id, domain_id): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def delete_data_source_rules(data_source_id, domain_id): | |
def delete_data_source_rules(data_source_id: str, domain_id:str ) -> None: |
@@ -73,7 +73,8 @@ def create_job( | |||
_LOGGER.debug(f"[create_job] create job: {job_vo.job_id}") | |||
return job_vo | |||
|
|||
def update_job_by_vo(self, params, job_vo): | |||
@staticmethod | |||
def update_job_by_vo(params, job_vo): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def update_job_by_vo(params, job_vo): | |
def update_job_by_vo(params: dict, job_vo: Job) -> Job: |
@@ -26,7 +26,7 @@ class DataSourceRuleCreateRequest(BaseModel): | |||
options: Union[dict, None] = None | |||
tags: Union[dict, None] = None | |||
resource_group: ResourceGroup | |||
workspace_id: str | |||
workspace_id: Union[dict, None] = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workspace_id: Union[dict, None] = None | |
workspace_id: Union[str, None] = None |
There was a problem hiding this 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 pull request merges extensive refactoring changes into master for the cost analysis module. Key changes include updates to date range logic in cost management, reordering and renaming of parameters in budget usage and notification methods, and adjustments in scheduler and error message configurations.
Reviewed Changes
Copilot reviewed 55 out of 55 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
src/spaceone/cost_analysis/manager/cost_manager.py | Changed date range check from 1 month to 31 days and updated the corresponding error message. |
src/spaceone/cost_analysis/manager/budget_usage_manager.py | Reordered arguments in the _update_monthly_budget_usage call and updated budget usage notification logic. |
src/spaceone/cost_analysis/manager/budget_manager.py | Minor adjustments including default tag assignment and updated method signatures. |
Various scheduler and configuration files | Updated scheduler instantiation, configuration settings, and deployment files as part of the refactor. |
if start + relativedelta(days=31) < end: | ||
raise ERROR_INVALID_DATE_RANGE( | ||
start=start_str, | ||
end=end_str, | ||
reason="Request up to a maximum of 1 month.", | ||
reason="Request up to a maximum of 1 month. or 31 days.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the date range check from 1 month to 31 days may introduce edge cases for months with fewer or more days. Ensure this change fully aligns with the intended business logic.
Copilot uses AI. Check for mistakes.
_LOGGER.info(f"[update_cost_usage] Update Budget Usage: {budget_vo.budget_id}") | ||
unified_cost_mgr = UnifiedCostManager() | ||
|
||
self._update_monthly_budget_usage(budget_vo, unified_cost_mgr) | ||
self._update_monthly_budget_usage(unified_cost_mgr, budget_vo) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The argument order for _update_monthly_budget_usage has been changed; verify that the new order is consistent with its definition and that all callers have been updated accordingly.
self._update_monthly_budget_usage(unified_cost_mgr, budget_vo) | |
self._update_monthly_budget_usage(budget_vo, unified_cost_mgr) |
Copilot uses AI. Check for mistakes.
✅ Why it is requiredThe 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
Git even has a
|
1 similar comment
✅ Why it is requiredThe 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
Git even has a
|
Category
Description
[Pull Request] Merged Refactoring codes to Master