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

Fix the init command #336

Merged
merged 11 commits into from
Mar 20, 2024
Merged

Fix the init command #336

merged 11 commits into from
Mar 20, 2024

Conversation

Bhashinee
Copy link
Member

@Bhashinee Bhashinee commented Mar 19, 2024

Purpose

Fixes:ballerina-platform/ballerina-library#6195

Examples

Checklist

  • Linked to an issue
  • Updated the specification
  • Updated the changelog
  • Added tests

Copy link

codecov bot commented Mar 19, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 84.05%. Comparing base (2b352b4) to head (d31fd83).

Files Patch % Lines
...i/src/main/java/io/ballerina/persist/cmd/Init.java 90.90% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #336      +/-   ##
==========================================
+ Coverage   83.70%   84.05%   +0.35%     
==========================================
  Files          63       63              
  Lines        5690     5671      -19     
  Branches      743      737       -6     
==========================================
+ Hits         4763     4767       +4     
+ Misses        698      681      -17     
+ Partials      229      223       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -0,0 +1,78 @@
/*
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org).

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 5a7297f

". but found '%s' datasource.%n", Arrays.toString(SUPPORTED_DB_PROVIDERS.toArray()), datastore);
return;
}

if (Files.isDirectory(Paths.get(sourcePath, PERSIST_DIRECTORY, MIGRATIONS))) {
errStream.println("ERROR: reinitializing persistence after executing the migrate command is not " +
"permitted. please remove the migrations directory within the persist directory and try " +
"executing the command again.");
return;
}
Copy link
Member

Choose a reason for hiding this comment

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

Shall we remove this too? As we are not adding any configuration, this validation is not valid

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 5a7297f

@@ -14,5 +14,5 @@ EXAMPLES
$ bal persist generate --help

Generate client objects for the model definition file inside persist directory.
$ bal persist generate
$ bal persist generate --module persist --datastore mysql
Copy link
Member

@daneshk daneshk Mar 20, 2024

Choose a reason for hiding this comment

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

SYNOPSIS
       bal persist generate [--module <module name>]
                                        [--datastore <store type>]
                                        [<-h> | <--help>]

OPTIONS
       --module <module name>
              The name of the module to initialize the persistence layer. If not specified, the default module will be used.
       --datastore <store type>
              The type of the datastore to be used for persistence.
              The supported datastores are 'inmemory', 'mysql', 'mssql', 'postgresql', 'googlesheets', and redis.
       -h, --help
           Print the usage details of all commands.

We need to mention the options like above here

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed in 48cc647

@@ -44,7 +58,9 @@ OPTIONS
BALLERINA COMMANDS
The below is a list of available subcommands:

init Initialize the package for persistence
add Initialize the package for persistence. Used along with `bal build` command.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
add Initialize the package for persistence. Used along with `bal build` command.
add Initialize the package for persistence and integrate the client generation to the `bal build` command.

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed the suggestions in 103a302

Co-authored-by: Danesh Kuruppu <daneshk@users.noreply.github.com>
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@daneshk daneshk merged commit c4e9239 into ballerina-platform:main Mar 20, 2024
6 checks passed
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.

2 participants