Skip to content
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

fixed ts issues #339

Merged
merged 1 commit into from
Dec 10, 2024
Merged

fixed ts issues #339

merged 1 commit into from
Dec 10, 2024

Conversation

tulsiojha
Copy link
Contributor

@tulsiojha tulsiojha commented Dec 10, 2024

Summary by Sourcery

Fix TypeScript issues by adding missing commas in the cliQueries function definitions and remove the 'kind' field from several GraphQL queries related to cluster managed services.

Bug Fixes:

  • Fix TypeScript issues by adding missing commas in the cliQueries function definitions.

Enhancements:

  • Remove the 'kind' field from several GraphQL queries related to cluster managed services.

Copy link

sourcery-ai bot commented Dec 10, 2024

Reviewer's Guide by Sourcery

This PR addresses TypeScript issues by making several syntax fixes and schema updates. The changes primarily involve adding missing commas in object literals and updating field names in GraphQL queries.

ER diagram for updated GraphQL schema

erDiagram
    QUERY {
        String name
        CursorPaginationIn pagination
        SearchClusterMSv search
    }
    QUERY ||--o{ lastUpdatedBy : "has"
    lastUpdatedBy {
        String userEmail
        String userId
    }
    note for QUERY "Removed 'kind' field from queries."
    note for QUERY "Updated 'containerPort' to 'devicePort' in portMappings."
Loading

Class diagram for updated GraphQL queries

classDiagram
    class cliQueries {
        +cli_createGlobalVPNDevice()
        +cli_getDNSHostSuffix()
        +cli_getMresOutputKeyValues()
        +cli_getGlobalVpnDevice()
        +cli_coreCheckNameAvailability()
        +cli_getMresKeys()
        +cli_listMreses()
        +cli_getMresConfigsValues()
        +cli_infraCheckNameAvailability()
        +cli_getConfigSecretMap()
        +cli_intercepExternalApp()
        +cli_interceptApp()
        +cli_removeDeviceIntercepts()
        +cli_getEnvironment()
        +cli_updateEnvironment()
        +cli_cloneEnvironment()
        +cli_getSecret()
        +cli_getConfig()
        +cli_listServices()
        +cli_listServiceBindings()
        +cli_createServiceIntercept()
        +cli_deleteServiceIntercept()
        +cli_listApps()
        +cli_listConfigs()
        +cli_listSecrets()
        +cli_listEnvironments()
        +cli_getKubeConfig()
        +cli_listClusters()
        +cli_listVPNDevices()
        +cli_listAccounts()
        +cli_getCurrentUser()
        +cli_createRemoteLogin()
        +cli_getRemoteLogin()
        +cli_listAccountClusters()
        +cli_getBYOKCluster()
        +cli_createClusterReference()
        +cli_deleteClusterReference()
        +cli_clusterReferenceInstructions()
        +cli_listImportedManagedResources()
    }
    note for cliQueries "Updated to fix TypeScript syntax issues by adding missing commas."
Loading

File-Level Changes

Change Details Files
Fixed missing trailing commas in object literals throughout the codebase
  • Added missing trailing commas after object properties
  • Ensured consistent comma usage in executor configurations
src/apps/auth/server/gql/cli-queries.ts
Updated GraphQL schema field names for better clarity
  • Renamed 'containerPort' to 'devicePort' in service intercept status
  • Removed deprecated 'kind' field from cluster managed services queries
gql-queries-generator/doc/queries.graphql
src/apps/console/server/gql/queries/cluster-managed-services-queries.ts
src/generated/gql/server.ts

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 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

@tulsiojha tulsiojha merged commit f362c50 into release-v1.1.1 Dec 10, 2024
4 checks passed
@tulsiojha tulsiojha deleted the ts/issue branch December 10, 2024 09:10
Copy link

@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 @tulsiojha - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 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 and I'll use the feedback to improve your reviews.

Comment on lines 1067 to 1070
const instructions = JSON.parse(
data.infrat_getBYOKClusterSetupInstructions[0].command
data.infrat_getBYOKClusterSetupInstructions[0].command,
);
return instructions;
Copy link

Choose a reason for hiding this comment

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

suggestion (code-quality): Inline variable that is immediately returned (inline-immediately-returned-variable)

Suggested change
const instructions = JSON.parse(
data.infrat_getBYOKClusterSetupInstructions[0].command
data.infrat_getBYOKClusterSetupInstructions[0].command,
);
return instructions;
return JSON.parse(
data.infrat_getBYOKClusterSetupInstructions[0].command,
);


ExplanationSomething that we often see in people's code is assigning to a result variable
and then immediately returning it.

Returning the result directly shortens the code and removes an unnecessary
variable, reducing the mental load of reading the function.

Where intermediate variables can be useful is if they then get used as a
parameter or a condition, and the name can act like a comment on what the
variable represents. In the case where you're returning it from a function, the
function name is there to tell you what the result is, so the variable name
is unnecessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant