Skip to content

Refactor mci dynamic codes#2117

Merged
cb-github-robot merged 3 commits intocloud-barista:mainfrom
seokho-son:main
Aug 27, 2025
Merged

Refactor mci dynamic codes#2117
cb-github-robot merged 3 commits intocloud-barista:mainfrom
seokho-son:main

Conversation

@seokho-son
Copy link
Copy Markdown
Member

No description provided.

Signed-off-by: Seokho Son <shsongist@gmail.com>
Copilot AI review requested due to automatic review settings August 27, 2025 11:00
@seokho-son seokho-son requested a review from yunkon-kim as a code owner August 27, 2025 11:00
Copy link
Copy Markdown
Contributor

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 MCI (Multi-Cloud Infrastructure) dynamic codes by adding a new parameter isReqFromDynamic to the CreateMci function to distinguish between manual and dynamic MCI creation requests. The changes improve the handling of dynamic MCI creation workflows and enhance error management.

Key changes:

  • Added isReqFromDynamic parameter to CreateMci function signature
  • Reorganized MCI creation logic to handle dynamic requests differently from manual ones
  • Improved error handling with better validation error formatting and cleanup
  • Moved CreateSystemMciDynamic function location for better code organization

Reviewed Changes

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

File Description
src/interface/rest/server/infra/provisioning.go Updated REST API calls to pass false for the new isReqFromDynamic parameter
src/core/infra/utility.go Updated utility function call to include the new parameter
src/core/infra/provisioning.go Main refactoring: added new parameter, reorganized MCI creation logic, improved error handling, and moved function location
src/core/infra/manageInfo.go Minor logging improvement for MCI termination waiting

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

}
if mciStatusTmp.Status == model.StatusPrepared {
// starting status for subgroups
log.Error().Err(err).Msgf("MCI '%s' does not exist in namespace '%s' should be prepared by dynamic request", mciId, nsId)
Copy link

Copilot AI Aug 27, 2025

Choose a reason for hiding this comment

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

There's a grammatical error in the error message. It should read 'should be prepared by a dynamic request' or 'should have been prepared by dynamic request'.

Suggested change
log.Error().Err(err).Msgf("MCI '%s' does not exist in namespace '%s' should be prepared by dynamic request", mciId, nsId)
log.Error().Err(err).Msgf("MCI '%s' does not exist in namespace '%s'; should have been prepared by dynamic request", mciId, nsId)

Copilot uses AI. Check for mistakes.
return nil, fmt.Errorf("MCI '%s' already exists in namespace '%s'", mciId, nsId)
} else {
req.SystemLabel = "Registered from CSP resource"
req.SystemLabel = "Registered from CSP"
Copy link

Copilot AI Aug 27, 2025

Choose a reason for hiding this comment

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

[nitpick] The system label was changed from 'Registered from CSP resource' to 'Registered from CSP'. This appears to be an intentional simplification, but consider whether the more specific label provided better context for debugging and auditing purposes.

Suggested change
req.SystemLabel = "Registered from CSP"
req.SystemLabel = "Registered from CSP resource"

Copilot uses AI. Check for mistakes.
seokho-son and others added 2 commits August 27, 2025 20:06
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@seokho-son
Copy link
Copy Markdown
Member Author

/approve

@github-actions github-actions bot added the approved This PR is approved and will be merged soon. label Aug 27, 2025
@cb-github-robot cb-github-robot merged commit 67f2175 into cloud-barista:main Aug 27, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved This PR is approved and will be merged soon.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants