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

Feat/restart apps and managed services#237

Merged
nxtcoder17 merged 5 commits into
release-1.0.5from
feat/restart-apps-and-managed-services
Jan 25, 2024
Merged

Feat/restart apps and managed services#237
nxtcoder17 merged 5 commits into
release-1.0.5from
feat/restart-apps-and-managed-services

Conversation

@nxtcoder17
Copy link
Copy Markdown
Member

PR Description

Chore: Update kloudlite/operator

  • The kloudlite/operator module has been updated to the latest release (v1.0.5). This update brings support for restarting managed services, enhancing the overall functionality of the application.

GitHub Issue Template

  • Documentation has been improved by updating the GitHub issue template to specify assignees more effectively. This change streamlines the issue management process.

Feature: Restart API

  • A new feature has been added to the project that introduces an API for restarting both apps and project managed services. The apps/tenant-agent now includes an action called restart in addition to apply and delete.

Fix: GraphQL Updates

  • Fixes have been made to the GraphQL update process for node pools and infra VPN devices in the apps/infra module

Fix: Helm Release Status

  • A fix has been applied to the apps/infra module to address missing status in Helm releases. This ensures that the status information is accurately represented.

@nxtcoder17 nxtcoder17 self-assigned this Jan 25, 2024
@nxtcoder17 nxtcoder17 linked an issue Jan 25, 2024 that may be closed by this pull request
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.

PR Type: Enhancement

PR Summary: The pull request introduces a new feature that allows restarting both apps and project managed services. It includes updates to the GraphQL schema to support new resolver functions for restarting applications, as well as the necessary backend logic to handle the restart actions. Additionally, the PR includes updates to the GitHub issue template and the kloudlite/operator module.

Decision: Comment

📝 Type: 'Enhancement' - not supported yet.
  • Sourcery currently only approves 'Typo fix' PRs.
✅ Issue addressed: this change correctly addresses the issue or implements the desired feature.
No details provided.
📝 Complexity: the changes are too large or complex for Sourcery to approve.
  • Unsupported files: the diff contains files that Sourcery does not currently support during reviews.
  • Files deleted: Sourcery does not currently approve diffs with deleted files.
  • Big diff: the diff is too large to approve with confidence.

General suggestions:

  • Ensure that new functionality, such as the 'restartK8sResource' method, is well-documented within the codebase to aid future maintainability.
  • Implement comprehensive testing for the new restart feature to ensure it behaves as expected under various scenarios and handles errors gracefully.
  • Review the error handling across the new resolvers to ensure consistency and that informative messages are returned to the client.

Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨

Share Sourcery

Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

}

func (d *domain) deleteK8sResourceOfCluster(ctx K8sContext, clusterName string, obj client.Object) error {
func (d *domain) restartK8sResource(ctx K8sContext, projectName string, namespace string, labels map[string]string) 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 (llm): Consider adding a comment explaining the purpose of 'restartK8sResource' and how it should be used, as it is a new addition to the domain logic.

return true, nil
}

// CoreRestartApp is the resolver for the core_restartApp field.
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 (llm): The resolver 'CoreRestartApp' should handle potential errors from 'RestartApp' method gracefully and return user-friendly error messages.

return true, nil
}

func (d *domain) RestartApp(ctx ResourceContext, appName string) 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 (llm): The new 'RestartApp' function should be thoroughly tested to ensure it correctly restarts the application and handles any potential errors.

@pr-explainer-bot
Copy link
Copy Markdown

Pull Request Review - Summary

Hey there! 👋 Here's a summary of the previous tasks and their results for the pull request review. Let's dive in!

Changes

  1. Updated the assignees in the feature template from karthik1729 to nxtcoder17.
  2. Updated the assignees in the bug template from karthik1729 to nxtcoder17.
  3. Added a new field LinkedClusters to the ComplexityRoot struct in generated.go.
  4. Added a new resolver function CoreRestartApp to the QueryResolver interface in generated.go.
  5. Added a new field core_restartApp to the Query type in generated.go.

Suggestions

  1. In the file .tools/nvim/__http__/console/apps.graphql.yml, on line 16, add a new field metadata.annotations to the query block.
  2. In the file .tools/nvim/__http__/console/apps.graphql.yml, on line 150, add a new query block for restarting an app with the following fields: label, query, and variables.
  3. In the file .tools/nvim/__http__/console/project-managed-services.yml, on line 29, add a new query block for listing project managed services with the following fields: label, query, and variables.
  4. In the file .tools/nvim/__http__/console/project-managed-services.yml, on line 47, add a new query block for restarting a project managed service with the following fields: label, query, and variables.
  5. In the file .tools/nvim/__http__/infra/names.graphql.yml, on line 16, update the value of name from saple to sample.
  6. In the file .apps/console/internal/app/graph/generated/generated.go, on line 31626, add a new field linkedClusters to the fieldContext_Query_core_listVPNDevices function.
  7. In the file .apps/console/internal/app/graph/generated/generated.go, on line 31731, add a new field linkedClusters to the fieldContext_Query_core_restartApp function.

Bugs

  1. The _ConsoleVPNDevice_linkedClusters method in the generated.go file has a potential bug. The fc.Result assignment should be moved inside the if resTmp == nil block to avoid setting the result when there is an error.
  2. The _Query_core_restartApp method in the generated.go file has a potential bug. The fc.Result assignment should be moved inside the if resTmp == nil block to avoid setting the result when there is an error.
  3. The _Query_core_restartProjectManagedService method in the generated.go file has a potential bug. The fc.Result assignment should be moved inside the if resTmp == nil block to avoid setting the result when there is an error.

Improvements

  1. In the _ConsoleVPNDevice_linkedClusters method, consider using a more descriptive name for the resTmp variable.
  2. In the _Query_core_restartApp method, consider using a more descriptive name for the resTmp variable.
  3. In the _Query_core_restartProjectManagedService method, consider using a more descriptive name for the resTmp variable.

Rating

Overall, the code rates 7 out of 10 based on criteria such as readability, performance, and security.

That's it for the summary! If you have any questions or need further clarification, feel free to reach out. Happy reviewing! 😄🔍

@nxtcoder17 nxtcoder17 merged commit a76c45d into release-1.0.5 Jan 25, 2024
@nxtcoder17 nxtcoder17 deleted the feat/restart-apps-and-managed-services branch January 25, 2024 19:36
abdheshnayak pushed a commit that referenced this pull request Nov 5, 2024
…services

Feat/restart apps and managed services
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.

✨ FEAT: restart apps, and managed services

1 participant