-
Notifications
You must be signed in to change notification settings - Fork 1
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
enable to pass config #91
Conversation
WalkthroughThe Scala project underwent a significant refactor, primarily focusing on the integration of a new Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #91 +/- ##
==========================================
+ Coverage 69.25% 71.50% +2.25%
==========================================
Files 19 20 +1
Lines 348 372 +24
Branches 40 47 +7
==========================================
+ Hits 241 266 +25
+ Misses 107 106 -1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (21)
- src/main/scala/Main.scala (7 hunks)
- src/main/scala/domain/graph/GraphEdge.scala (3 hunks)
- src/main/scala/domain/graph/GraphVertex.scala (3 hunks)
- src/main/scala/infrastructure/EdgeQuery.scala (4 hunks)
- src/main/scala/infrastructure/VertexQuery.scala (3 hunks)
- src/main/scala/usecase/ByExhaustiveSearch.scala (4 hunks)
- src/main/scala/usecase/UsecaseBase.scala (1 hunks)
- src/main/scala/usecase/UsingSpecificKeyList.scala (4 hunks)
- src/main/scala/utils/Config.scala (1 hunks)
- src/main/scala/utils/FileUtility.scala (3 hunks)
- src/test/scala/GenerateTestData.scala (5 hunks)
- src/test/scala/MainSpec.scala (1 hunks)
- src/test/scala/domain/graph/GraphEdgeSpec.scala (4 hunks)
- src/test/scala/domain/graph/GraphVertexSpec.scala (4 hunks)
- src/test/scala/domain/table/ddl/TableListSpec.scala (2 hunks)
- src/test/scala/domain/table/dml/RecordListSpec.scala (2 hunks)
- src/test/scala/infrastructure/EdgeQuerySpec.scala (3 hunks)
- src/test/scala/infrastructure/VertexQuerySpec.scala (5 hunks)
- src/test/scala/usecase/ByExhaustiveSearchSpec.scala (2 hunks)
- src/test/scala/usecase/UsingSpecificKeyListSpec.scala (3 hunks)
- src/test/scala/utils/ConfigSpec.scala (1 hunks)
Files skipped from review due to trivial changes (1)
- src/main/scala/utils/Config.scala
Additional comments: 49
src/main/scala/usecase/UsecaseBase.scala (1)
- 14-14: Protected member
config
of typeConfig
has been added to theUsecaseBase
trait.src/test/scala/utils/ConfigSpec.scala (1)
- 9-18: The test case for the default configuration seems to correctly instantiate a
Config
object with expected values.src/main/scala/utils/FileUtility.scala (2)
- 15-20: The
writeJson
method now correctly accepts adirectoryPath
parameter and creates the directory if it does not exist.- 34-39: The
writeSql
method has been updated similarly towriteJson
to accept adirectoryPath
parameter and create the directory if needed.src/main/scala/domain/graph/GraphVertex.scala (3)
- 9-15:
GraphVertex
class now correctly accepts aConfig
object and uses its properties to constructtableName
andcolumnNamePrefixProperty
.- 26-29: The
toDdl
method has been updated to use theConfig
object's properties for column names.- 40-40: The
toDml
method has been updated to use theConfig
object's properties for column names.src/test/scala/MainSpec.scala (1)
- 10-15: A
config
object has been added and is now passed to theByExhaustiveSearch
instantiation.src/main/scala/infrastructure/EdgeQuery.scala (4)
- 11-14:
EdgeQuery
class now correctly accepts aconfig
parameter and uses it when creatingGraphEdge
instances.- 31-31: The
getInEdgeList
method has been updated to pass theconfig
object to theGraphEdge
constructor.- 48-51: The
getList
method has been updated to pass theconfig
object to theGraphEdge
constructor.- 70-70: The
getOutEdgeList
method has been updated to pass theconfig
object to theGraphEdge
constructor.src/main/scala/infrastructure/VertexQuery.scala (3)
- 11-14:
VertexQuery
class now correctly accepts aconfig
parameter and uses it when creatingGraphVertex
instances.- 37-40: The
getList
method has been updated to pass theconfig
object to theGraphVertex
constructor.- 73-73: The
getListByPropertyKey
method has been updated to pass theconfig
object to theGraphVertex
constructor.src/test/scala/domain/graph/GraphVertexSpec.scala (2)
- 19-24: A
config
variable has been added and is used in theVertexQuery
constructor.- 64-64: The
config
variable is correctly used in theGraphVertex
constructor.src/test/scala/domain/table/ddl/TableListSpec.scala (1)
- 11-17: A
config
variable has been added and is used in theVertexQuery
constructor.src/test/scala/infrastructure/EdgeQuerySpec.scala (4)
- 11-16: A
config
variable has been added and is used in theEdgeQuery
constructor.- 24-27: The
config
variable is correctly used in theGraphEdge
constructor and thegetInEdgeList
method.- 35-49: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [38-55]
The
config
variable is correctly used in theEdgeQuery
constructor and thegetList
method.
- 65-69: The
config
variable is correctly used in thegetOutEdgeList
method.src/main/scala/domain/graph/GraphEdge.scala (3)
- 11-20:
GraphEdge
class now correctly accepts aConfig
object and uses its properties to constructtableName
and column names.- 31-42: The
toDdl
method has been updated to use theConfig
object's properties for column names.- 73-76: The
toDml
method has been updated to use theConfig
object's properties for column names.src/test/scala/infrastructure/VertexQuerySpec.scala (3)
- 11-16: A
config
variable has been added and is used in theVertexQuery
constructor.- 22-36: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [25-42]
The
config
variable is correctly used in thegetList
method.
- 50-64: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [53-70]
The
config
variable is correctly used in thegetListByPropertyKey
method.src/test/scala/domain/graph/GraphEdgeSpec.scala (2)
- 20-25: A
config
variable has been added and is used in theEdgeQuery
constructor.- 43-49: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [46-69]
The
config
variable is correctly used in theGraphEdge
constructor and thetoDml
method.src/main/scala/usecase/ByExhaustiveSearch.scala (2)
- 22-23:
ByExhaustiveSearch
class now correctly accepts aconfig
parameter and uses it in its execution logic.- 34-40: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [37-66]
The
execute
method has been updated to use theconfig
parameter when instantiatingVertexQuery
andEdgeQuery
.src/test/scala/usecase/UsingSpecificKeyListSpec.scala (1)
- 13-23: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [19-33]
A
config
variable has been added and is used in theUsingSpecificKeyList
instantiation.src/main/scala/usecase/UsingSpecificKeyList.scala (2)
- 35-35:
UsingSpecificKeyList
class now correctly accepts aconfig
parameter and uses it in its execution logic.- 47-53: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [50-64]
The
execute
method has been updated to use theconfig
parameter when instantiatingVertexQuery
andEdgeQuery
.src/main/scala/Main.scala (5)
- 12-12: A
config
object of typeConfig
has been instantiated usingConfig.default
.- 25-30: The
execute
method has been refactored to use theconfig
object for determining the use case command.- 39-49: The
ByExhaustiveSearch
andUsingSpecificKeyList
classes are correctly instantiated with theconfig
object.- 88-104: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [67-101]
The
writeSql
method calls have been updated to use theconfig
object's properties for directory and file names.
- 117-117: The
traversal().withRemote
method call has been updated to use theconfig
object's properties.src/test/scala/domain/table/dml/RecordListSpec.scala (1)
- 5-15: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [11-85]
A
config
variable has been added and is used in theVertexQuery
constructor and thetoSqlSentence
method.src/test/scala/usecase/ByExhaustiveSearchSpec.scala (3)
- 16-16: The import of
utils.Config
is correct and aligns with the PR objectives to use the newConfig
class.- 19-19: The addition of the
config
variable usingConfig.default
is consistent with the PR objectives to pass configuration through the system.- 24-24: The
ByExhaustiveSearch
class is correctly instantiated with theconfig
object, ensuring that configuration settings are passed as intended.src/test/scala/GenerateTestData.scala (5)
- 11-11: The import of
utils.Config
is correct and necessary for the use of theConfig
class within this file.- 19-19: The declaration of
config
usingConfig.default
is appropriate and aligns with the PR objectives to use a centralized configuration object.- 166-166: The variable
grapdbConnection
is correctly assigned fromconfig.graphDb.remoteGraphProperties
, which is in line with the PR's goal to use structured configuration access.- 327-328: The file writing operation correctly uses
config.usingSpecificKeyList.outputDirectory
andconfig.usingSpecificKeyList.filename
, which is consistent with the PR objectives to use theConfig
object for accessing configuration properties.- 335-337: The error handling in the
recover
block is appropriate, logging the error and exiting the system. This is a standard Scala practice for handling non-fatal exceptions in a standalone script.
@@ -163,10 +163,9 @@ object GenerateTestData extends StrictLogging { | |||
/** @param args | |||
*/ | |||
def main(args: Array[String]): Unit = { | |||
val config = ConfigFactory.load() | |||
val grapdbConnection = config.graphDb.remoteGraphProperties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logging statement correctly references the grapdbConnection
variable. However, there is a typo in the variable name grapdbConnection
; it should be graphdbConnection
.
- val grapdbConnection = config.graphDb.remoteGraphProperties
+ val graphdbConnection = config.graphDb.remoteGraphProperties
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
val grapdbConnection = config.graphDb.remoteGraphProperties | |
val graphdbConnection = config.graphDb.remoteGraphProperties |
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Tests
Documentation