Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

API: implement clone managed service#338

Merged
nxtcoder17 merged 1 commit into
mainfrom
feat/clone-cmsvc
Jun 14, 2024
Merged

API: implement clone managed service#338
nxtcoder17 merged 1 commit into
mainfrom
feat/clone-cmsvc

Conversation

@nxtcoder19
Copy link
Copy Markdown
Contributor

@nxtcoder19 nxtcoder19 commented Jun 14, 2024

Resolves kloudlite/kloudlite#249

Summary by Sourcery

This pull request introduces a new feature to clone a managed service within a cluster. It adds a new GraphQL mutation infra_cloneClusterManagedService and implements the corresponding domain logic. Additionally, role bindings are updated to include permissions for this new action.

  • New Features:
    • Introduced a new GraphQL mutation infra_cloneClusterManagedService to clone a managed service within a cluster.
  • Enhancements:
    • Added a new method CloneClusterManagedService in the domain layer to handle the cloning logic for cluster managed services.
    • Updated role bindings to include permissions for the new CloneClusterManagedService action.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Jun 14, 2024

Reviewer's Guide by Sourcery

This pull request implements the 'clone managed service' feature for the API. The changes include adding a new mutation to the GraphQL schema, implementing the corresponding resolver, and updating the domain logic to handle the cloning of a managed service. The changes also include updates to role bindings and action types to support the new functionality.

File-Level Changes

Files Changes
apps/infra/internal/app/graph/generated/generated.go
apps/infra/internal/app/graph/schema.resolvers.go
Added and implemented the infra_cloneClusterManagedService mutation in the GraphQL schema and resolver.
apps/infra/internal/domain/cluster-managed-service.go
apps/infra/internal/domain/api.go
Implemented the domain logic for cloning a cluster managed service and updated the Domain interface.
apps/iam/internal/app/action-role-binding.go
apps/iam/types/types.go
Updated role bindings and action types to support the new clone managed service functionality.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey @nxtcoder19 - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

return fmt.Sprintf("cmsvc-%s", msvcName)
}

func (d *domain) CloneClusterManagedService(ctx InfraContext, args CloneManagedServiceArgs) (*entities.ClusterManagedService, error) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: Consider adding validation for CloneManagedServiceArgs.

Before proceeding with the cloning operation, it would be prudent to validate the CloneManagedServiceArgs to ensure all required fields are present and correctly formatted.

Comment thread apps/infra/internal/app/graph/schema.resolvers.go
@nxtcoder17 nxtcoder17 merged commit faa35e9 into main Jun 14, 2024
@nxtcoder17 nxtcoder17 deleted the feat/clone-cmsvc branch June 14, 2024 09:42
abdheshnayak pushed a commit that referenced this pull request Nov 5, 2024
API: implements clone managed service
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API: Implement cloning of managed service

2 participants