kloudlite / kl

Kloudlite CLI Client
GNU Affero General Public License v3.0
5 stars 1 forks source link

Ref/testing changes #173

Closed nxtcoder36 closed 2 weeks ago

nxtcoder36 commented 2 weeks ago

Summary by Sourcery

Refactor the codebase to replace 'account' terminology with 'team' terminology, updating function names, variable names, and documentation to reflect this change.

Enhancements:

Documentation:

sourcery-ai[bot] commented 2 weeks ago

Reviewer's Guide by Sourcery

This pull request implements a significant refactoring of the codebase, replacing the concept of "account" with "team" throughout the project. The changes are widespread, affecting multiple files and components, including function names, variable names, and documentation.

Updated class diagram for the Team model

classDiagram
    class Team {
        Metadata metadata
        string displayName
        Status status
    }

    class apiClient {
        +ListTeams() []Team
        +GetClusterConfig(team string) TeamClusterConfig
        +CreateDevice(devName, displayName, team string) Device
        +GetVPNDevice(teamName string, devName string) Device
        +ListApps(teamName string, envName string) []App
        +ListConfigs(teamName string, envName string) []Config
        +ListSecrets(teamName string, envName string) []Secret
        +CloneEnv(teamName, envName, newEnvName, clusterName string) Env
        +CheckEnvName(teamName, envName string) bool
        +ListBYOKClusters(teamName string) []BYOKCluster
        +GetMresConfigValues(teamName string) map[string]string
    }

    class TeamClusterConfig {
        string clusterToken
        string clusterName
        InstallCommand installCommand
    }

    class InstallCommand {
        string chartVersion
        string crdsURL
        InstallHelmValues helmValues
    }

    class InstallHelmValues {
        string teamName
        string clusterName
        string clusterToken
        string kloudliteDNSSuffix
    }

    class Device {
        string teamName
        string creationTime
        User createdBy
        string displayName
    }

    Team --|> apiClient
    TeamClusterConfig --|> InstallCommand
    InstallCommand --|> InstallHelmValues
    Device --|> apiClient

File-Level Changes

Change Details Files
Renamed 'account' to 'team' throughout the codebase
  • Updated function names (e.g., CreateClustersAccounts to CreateClustersTeams)
  • Changed variable names (e.g., accountName to teamName)
  • Modified struct field names (e.g., AccountName to TeamName)
  • Updated API endpoint names and parameters
  • Revised configuration file structures
  • Modified command-line interface options and descriptions
  • Updated documentation and help text
k3s/impl.go
domain/apiclient/account.go
domain/apiclient/k3s-local.go
domain/apiclient/impl.go
cmd/use/account.go
domain/fileclient/k3s-local.go
cmd/list/acc.go
domain/apiclient/environment.go
domain/apiclient/device.go
cmd/box/boxpkg/utils.go
domain/fileclient/device.go
cmd/use/env.go
domain/apiclient/configs.go
domain/apiclient/secrets.go
domain/fileclient/account.go
clis/kl/help.go
cmd/k3s/up.go
cmd/list/env.go
cmd/status/status.go
README.md
cmd/box/boxpkg/main.go
domain/fileclient/context.go
domain/fileclient/kl-file.go
k3s/main.go
Updated CLI commands and documentation
  • Modified 'list accounts' to 'list teams'
  • Updated 'use account' to 'use team'
  • Revised help text and command descriptions
  • Updated command aliases
docs/kli/kli_use_account.md
docs/kl/list_accounts.md
docs/kli/kli_list_accounts.md
cmd/list/list.go
docs/kli/kli_list.md
docs/kl/kl.md
docs/kl/kl_list.md
docs/kli/kli.md
docs/kli/kli_list_clusters.md
docs/kl/kl_use_env.md
docs/kli/kli_use.md
docs/kli/kli_use_cluster.md
Refactored data structures and configurations
  • Updated struct definitions (e.g., AccountVpnConfig to TeamVpnConfig)
  • Modified configuration file structures
  • Changed environment variable names
domain/fileclient/k3s-local.go
cmd/box/boxpkg/hashctrl/main.go
domain/fileclient/auth.go
Modified API client and file client interfaces
  • Updated method signatures in ApiClient interface
  • Changed FileClient interface methods
  • Revised error messages and logging statements
domain/apiclient/main.go
domain/fileclient/main.go
Updated authentication and context handling
  • Modified cookie handling for authentication
  • Updated context-related functions and structures
domain/apiclient/main.go
domain/fileclient/context.go

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).