Skip to content

Conversation

@piyush-zlai
Copy link
Contributor

@piyush-zlai piyush-zlai commented Oct 14, 2024

Summary

Downgrade Play to 2.x. The version of Play we had required Scala 2.13. This ends up being painful to work with when we start introducing dependencies from the 'hub' play module to other modules like api / online (which we need for the Dynamodb hookup). Sbt isn't very happy when we're trying to hook up these builds across scala versions when hub is defaulting to 2.13 and the rest of the project on 2.12. To not bang at this further, I'm downgrading to a play version on scala 2.12 and we can revisit when we're ready to bump to Scala 2.13.

Checklist

  • Added Unit Tests
  • Covered by existing CI
  • Integration tested
  • Documentation update

Summary by CodeRabbit

  • New Features

    • Enhanced mock data generation for time series, allowing for a broader range of generated values.
    • Updated Java options in the Docker initialization script to prevent execution errors.
  • Bug Fixes

    • Improved error handling in test cases by correctly accessing the successful results from decoded responses.
  • Chores

    • Updated project dependencies and plugins to maintain compatibility and improve build configuration, including the Play Framework plugin and several SBT plugins.

@piyush-zlai piyush-zlai requested a review from ken-zlai October 14, 2024 14:14
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 14, 2024

Walkthrough

The changes in this pull request primarily involve updates to the build.sbt file, modifications to the docker-init/start.sh script, and alterations in various test files related to the TimeSeriesController. The build.sbt file sees a downgrade in the scalatestplus-play dependency and a change in the Scala version for the hub project. The start.sh script is updated to include new Java options to resolve a specific error. Additionally, test files are modified to improve the handling of Either types in response decoding.

Changes

File Change Summary
build.sbt - Scala version changed from scala_2_13 to scala_2_12.
- scalatestplus-play version downgraded from 7.0.0 to 5.1.0.
- Multiple SBT plugins added and updated.
- New configuration for scala-xml dependency schemes added.
docker-init/start.sh - Added environment variable JAVA_OPTS with specific options to address java.lang.ClassFormatError.
hub/app/controllers/TimeSeriesController.scala - Updated random number generation methods to use random.nextDouble() for broader value ranges.
hub/test/controllers/ModelControllerSpec.scala - Corrected access method for items from listModelResponse using right.value instead of value.
hub/test/controllers/SearchControllerSpec.scala - Corrected access method for items from listModelResponse using right.value instead of value.
hub/test/controllers/TimeSeriesControllerSpec.scala - Updated handling of responses from fetchModel, fetchJoin, and fetchFeature methods to use right.value.

Possibly related PRs

Suggested reviewers

  • ken-zlai
  • nikhil-zlai

🐰 In the garden, changes bloom,
With Scala's shift, we make room.
Java's whispers, plugins galore,
Mock data dances, tests explore.
A hop, a skip, through code we weave,
In this patch, new tales we conceive! 🌼


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (5)
project/plugins.sbt (2)

11-14: Approved: Added library dependency scheme for scala-xml.

The addition of the library dependency scheme for scala-xml is a good practice to ensure version consistency. The comment provides helpful context by referencing the related GitHub issue.

Consider adding a brief comment explaining the purpose of this setting directly in the code. For example:

// Ensure consistent scala-xml version across the project
ThisBuild / libraryDependencySchemes ++= Seq(
  "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always
)

Line range hint 1-14: Summary: Play Framework downgraded and build settings updated.

The changes in this file successfully downgrade the Play Framework plugin to version 2.8.22, which aligns with the PR objective of sticking to Scala 2.12. Additionally, a new build setting has been added to ensure consistent versioning of the scala-xml module.

These changes are crucial for resolving the integration challenges mentioned in the PR objectives. However, it's important to note that downgrading a major framework version may have broader implications on the project:

  1. Compatibility: Some APIs or features available in Play 3.x might not be available or might work differently in Play 2.8.x. A thorough review of the codebase may be necessary to identify and address any incompatibilities.

  2. Performance: There might be performance differences between Play 3.x and 2.8.x. It would be beneficial to run performance tests to ensure that the downgrade doesn't negatively impact the application's performance.

  3. Security: Ensure that Play 2.8.22 doesn't have any known security vulnerabilities. If it does, plan to address them or consider using the latest patch version of Play 2.8.x.

  4. Future Upgrades: As mentioned in the PR objectives, this downgrade is temporary. It would be helpful to create a plan or ticket for the future upgrade to Scala 2.13 and Play 3.x to ensure this technical debt is addressed in the future.

Consider documenting the reasons for this downgrade and the future upgrade plan in a prominent place (e.g., README.md or a separate UPGRADE.md file) to inform other developers and prevent accidental upgrades before the codebase is ready.

hub/test/controllers/ModelControllerSpec.scala (1)

Line range hint 25-54: Consider adding error handling test case

While the changes correctly handle successful decoding of the response, it might be beneficial to add a test case that verifies the behavior when decoding fails. This would ensure that the controller properly handles and reports errors in malformed responses.

Would you like me to provide an example of how such a test case could be implemented?

hub/app/controllers/TimeSeriesController.scala (2)

308-308: Approved: Wider range of mock data, but consider documenting the change.

The modification to use random.nextDouble() instead of random.between(0, 0.5) increases the range of generated values from [0, 0.5) to [0, 1). This change provides a wider range of mock data, which could be more representative of real-world scenarios.

Consider adding a comment to document the new range of generated values, as this change might affect downstream processing or visualization if those components expect values within a certain range.


313-313: Approved: Consistent change, but document the new range.

The modification to use random.nextDouble() instead of random.between(0, 0.5) is consistent with the change in generateMockTimeSeriesPoints. This consistency is good for maintainability.

As with the previous change, consider adding a comment to document the new range of generated values (now [0, 1) instead of [0, 0.5)).

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 04ca54b and 8a4b869.

📒 Files selected for processing (7)
  • build.sbt (1 hunks)
  • docker-init/start.sh (1 hunks)
  • hub/app/controllers/TimeSeriesController.scala (1 hunks)
  • hub/test/controllers/ModelControllerSpec.scala (2 hunks)
  • hub/test/controllers/SearchControllerSpec.scala (2 hunks)
  • hub/test/controllers/TimeSeriesControllerSpec.scala (7 hunks)
  • project/plugins.sbt (1 hunks)
🧰 Additional context used
🔇 Additional comments (13)
docker-init/start.sh (1)

7-9: Approve the Java options addition with recommendations.

The addition of these Java options effectively addresses the ClassFormatError issue. However, I have a few suggestions to improve this change:

  1. Consider adding more detailed documentation about why these specific options are needed. This will help future maintainers understand the context and potential implications.

  2. While this solves the immediate problem, it might be beneficial to investigate the root cause of the module access issue. There might be a more permanent solution that doesn't require opening up module access.

  3. Verify if these options are necessary for all environments or just in the Docker context. If it's specific to Docker, consider moving this to a Docker-specific configuration file.

To ensure this change doesn't introduce any unintended side effects, please run the following verification:

Consider exploring alternative solutions that don't require opening up module access, as this could potentially introduce security vulnerabilities. Some options to consider:

  1. Upgrade the dependencies that are causing this issue to versions that are compatible with Java 9+ module system.
  2. If possible, refactor the code to avoid accessing internal Java APIs that are now restricted by the module system.
project/plugins.sbt (1)

10-10: Approved: Play Framework plugin downgraded as intended.

The Play Framework plugin has been successfully downgraded from 3.0.5 to 2.8.22, which aligns with the PR objective of sticking to Scala 2.12. The organization change from "org.playframework" to "com.typesafe.play" is correct for Play 2.x versions.

Please ensure that all project dependencies and features are compatible with Play 2.8.22. You may want to run the following command to check for any compatibility issues:

✅ Verification successful

Verified: No deprecated Play Framework APIs detected.

The Play Framework plugin has been successfully downgraded to version 2.8.22 without introducing any deprecated or removed API usages. This ensures compatibility with the project's current codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for potential compatibility issues with Play 2.8.22

# Search for Play Framework imports and usages
echo "Searching for Play Framework imports and usages:"
rg --type scala --type java 'import play\.' -A 5

# Search for potential deprecated or removed APIs
echo "Searching for potential deprecated or removed APIs:"
rg --type scala --type java 'GlobalSettings|Play\.current|Play\.application|Action\.async'

# Note: This script provides a starting point. Manual verification is still recommended.

Length of output: 4311

hub/test/controllers/ModelControllerSpec.scala (2)

39-39: Correct usage of Either type

The change from listModelResponse.value.items to listModelResponse.right.value.items is correct. This modification properly accesses the Right side of the Either type returned by decode[ListModelResponse], which contains the successful decoding result. The previous code incorrectly assumed the Either was always in the Left state, which could have led to runtime errors.


51-51: Consistent correction across test cases

This change mirrors the correction made in the previous test case, consistently using listModelResponse.right.value.items to access the Right side of the Either type. This ensures that both the regular and paginated result test cases are handling the decoded response correctly.

hub/test/controllers/SearchControllerSpec.scala (2)

39-39: Improved handling of Either type

The change from listModelResponse.value to listModelResponse.right.value is a good improvement. It explicitly handles the right side of the Either type, which represents the success case. This change enhances type safety and makes the code's intent clearer.


51-51: Consistent improvement in Either handling

The same change has been applied here as in the previous test case, consistently improving the handling of the Either type. This consistency across test cases is commendable as it enhances the overall maintainability and readability of the test suite.

build.sbt (1)

214-226: LGTM with suggestions for improvement

The changes to the hub project configuration align well with the PR objectives:

  1. The added comment (lines 214-215) clearly explains the rationale for using Play 2.x, which is helpful for future maintenance.
  2. The downgrade of scalatestplus-play to version 5.1.0 (line 222) is consistent with moving to an earlier version of Play framework that supports Scala 2.12.

However, there are a couple of points that could be addressed:

  1. The AI summary mentioned changing the Scala version for the hub project to 2.12, but this change is not visible in the provided diff. Could you confirm if this change has been made elsewhere or if it needs to be added explicitly to the hub project settings?

  2. It would be beneficial to add a comment specifying the exact Play version being used, as it's currently only referred to as "Play 2.x" in the comment. This would provide more precise information for future reference.

To verify the Scala version setting for the hub project, please run the following command:

This will display the Scala version configured for the hub project. If it's not set to 2.12.18, you may need to add the following line to the hub project settings:

scalaVersion := scala_2_12
✅ Verification successful

LGTM with suggestions for improvement

The changes to the hub project configuration align well with the PR objectives:

  1. The added comment (lines 214-215) clearly explains the rationale for using Play 2.x, which is helpful for future maintenance.
  2. The downgrade of scalatestplus-play to version 5.1.0 (line 222) is consistent with moving to an earlier version of the Play framework that supports Scala 2.12.
  3. The Scala version for the hub project is correctly set to 2.12.18 in the build configuration, ensuring consistency across the repository.
  4. It would be beneficial to add a comment specifying the exact Play version being used, as it's currently only referred to as "Play 2.x" in the comment. This would provide more precise information for future reference.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

sbt "project hub" "show scalaVersion"

Length of output: 110


Script:

#!/bin/bash
# Search for scalaVersion in build.sbt
grep 'scalaVersion' build.sbt

# Search for scalaVersion in project/*.sbt
grep 'scalaVersion' project/*.sbt

# List the contents of the project directory
ls project/

Length of output: 354

hub/test/controllers/TimeSeriesControllerSpec.scala (6)

48-48: Improved error handling with explicit Either access

The change from modelTSResponse.value to modelTSResponse.right.value is a good improvement. It explicitly accesses the right side of the Either type, which represents the success case. This change enhances type safety and makes the code more robust by ensuring that we're only proceeding with the successful case.


90-90: Consistent application of explicit Either access

This change follows the same pattern as the previous one, using modelTSResponse.right.value instead of modelTSResponse.value. It's good to see this consistency maintained throughout the test file, improving error handling and type safety across all test cases.


110-110: Consistent error handling across different test cases

The change to modelTSResponse.right.value is consistently applied here as well. It's commendable to see this pattern maintained across different test cases, ensuring uniform and improved error handling throughout the entire test suite.


191-191: Consistent error handling extended to FeatureTimeSeries responses

The explicit Either access pattern is correctly applied here to the FeatureTimeSeries response. This demonstrates a thorough approach to improving error handling across different response types in the controller. Well done on maintaining consistency throughout the test suite.


210-210: Comprehensive improvement in error handling across all test cases

The consistent application of *Response.right.value across all test cases and response types (including various feature time series lookups) demonstrates a thorough and systematic approach to improving error handling in the entire test suite. This change enhances the robustness and type safety of all tests, making them more resilient to potential errors and easier to maintain.

Also applies to: 229-229, 249-249


Line range hint 1-262: Summary: Consistent improvement in error handling aligns with PR objectives

The changes made to this test file demonstrate a systematic approach to improving error handling and type safety. By consistently using *Response.right.value instead of *Response.value, the code now explicitly handles the success case of Either types. This change:

  1. Enhances type safety across all test cases.
  2. Improves error handling without altering the core test logic.
  3. Makes the tests more robust and easier to maintain.

These modifications align well with the PR objective of downgrading Play to 2.x and sticking to Scala 2.12. By making the code more explicit in its handling of Either types, it ensures compatibility with Scala 2.12 features and idioms. This systematic update across the test suite suggests careful consideration of the implications of the framework downgrade.

Overall, these changes contribute positively to the codebase's quality and maintainability while supporting the transition to an earlier Play version compatible with Scala 2.12.

Copy link
Contributor

@ken-zlai ken-zlai left a comment

Choose a reason for hiding this comment

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

Largely looks good, just one point for me to understand about the new number generation

@piyush-zlai piyush-zlai force-pushed the piyush/play_downgrade branch from 8a4b869 to ebb5ad3 Compare October 14, 2024 18:23
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (2)
project/plugins.sbt (1)

11-14: LGTM: Build setting addresses specific issue.

The addition of the build setting to specify the version scheme for scala-xml is appropriate:

  1. It addresses a specific issue (referenced by the GitHub issue link).
  2. The comment provides context for why this configuration is necessary.

Consider expanding the comment slightly to provide more context:

- // related to: https://github.com/sbt/sbt/issues/6997
+ // Addresses version conflicts with scala-xml: https://github.com/sbt/sbt/issues/6997

This minor change would make the purpose of the configuration immediately clear to other developers.

build.sbt (1)

214-226: LGTM with a suggestion for explicit Scala version.

The changes align well with the PR objective of downgrading Play to 2.x and sticking to Scala 2.12 across the repo. The added comments provide clear reasoning for this decision.

Consider explicitly setting the Scala version for the hub project to ensure consistency:

lazy val hub = (project in file("hub"))
  .enablePlugins(PlayScala)
  .settings(
    name := "hub",
    scalaVersion := scala_2_12,  // Add this line
    libraryDependencies ++= Seq(
      // ... existing dependencies
    )
  )

This will make it clear that the hub project is using Scala 2.12, consistent with the rest of the repository.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 8a4b869 and ebb5ad3.

📒 Files selected for processing (7)
  • build.sbt (1 hunks)
  • docker-init/start.sh (1 hunks)
  • hub/app/controllers/TimeSeriesController.scala (1 hunks)
  • hub/test/controllers/ModelControllerSpec.scala (2 hunks)
  • hub/test/controllers/SearchControllerSpec.scala (2 hunks)
  • hub/test/controllers/TimeSeriesControllerSpec.scala (7 hunks)
  • project/plugins.sbt (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
  • docker-init/start.sh
  • hub/app/controllers/TimeSeriesController.scala
  • hub/test/controllers/ModelControllerSpec.scala
  • hub/test/controllers/SearchControllerSpec.scala
  • hub/test/controllers/TimeSeriesControllerSpec.scala
🧰 Additional context used
🔇 Additional comments (2)
project/plugins.sbt (1)

Line range hint 1-10: LGTM: Plugin additions and Play Framework downgrade align with PR objectives.

The changes to the plugins are appropriate:

  1. The addition of various SBT plugins (sbt-assembly, sbt-scalafmt, sbt-pgp, sbt-release, sbt-git, sbt-buildinfo, sbt-shading, sbt-scalafix) enhances the project's build and development capabilities.
  2. The downgrade of the Play Framework plugin from 3.0.5 to 2.8.22 aligns with the PR objective to stick to Scala 2.12 across the repo.
  3. The addition of the dependency tree plugin will help in managing complex dependency structures.

These changes support the goal of maintaining compatibility with Scala 2.12 while improving the build process.

build.sbt (1)

Line range hint 1-238: Verify Scala versions across all modules.

While the changes for the hub project look good, it's important to ensure that all modules in the project are consistently using Scala 2.12 as intended by this PR.

Let's run a quick check to verify the Scala versions used across all modules:

This will help us confirm that all modules are set to use Scala 2.12 and identify any modules that might need adjustment.

✅ Verification successful

Scala Versions Consistency Verified

All modules are consistently using Scala 2.12 as intended by this PR.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
echo "Checking Scala versions across all modules:"
grep -n "scalaVersion :=" build.sbt
echo "Checking crossScalaVersions:"
grep -n "crossScalaVersions :=" build.sbt

Length of output: 418

@piyush-zlai piyush-zlai merged commit 0693f14 into main Oct 14, 2024
7 checks passed
@piyush-zlai piyush-zlai deleted the piyush/play_downgrade branch October 14, 2024 18:44
This was referenced Oct 15, 2024
piyush-zlai added a commit that referenced this pull request Oct 18, 2024
## Summary
PR overview - [Video
Link](https://drive.google.com/file/d/1Rei6upL2OiAls2jX7mCERaJGai3Noo1j/view?usp=drive_link)
This PR builds on #33 and
#43. We register the relevant
model / join / groupby / staging query artifacts at the 'app' docker
container startup by using the MetadataUploader and hitting the Dynamo
endpoints using the KV store. We also extend the API to stop returning
mocked data for the list and search calls and start returning real
registered models + enriched responses (so the model object includes
details on the Joins, GroupBys and features).

There were a few broken pieces along the way that I fixed while working
through the integration (e.g. the metadata walker code was missing
handling models, the api.thrift enum for model type needed to start at
index 0 etc).

## Checklist
- [X] Added Unit Tests
- [X] Covered by existing CI
- [X] Integration tested
- [ ] Documentation update

Bringing up the container and curling:
```
$ curl http://localhost:9000/api/v1/search?term=1&limit=20
{"offset":0,"items":[{"name":"risk.transaction_model.v1","join":{"name":"risk.user_transactions.txn_join","joinFeatures":[],"groupBys":[{"name":"risk.transaction_events.txn_group_by_user","features":["transaction_amount_count_1h","transaction_amount_count_1d","transaction_amount_count_30d","transaction_amount_count_365d","transaction_amount_sum_1h"]},{"name":"risk.transaction_events.txn_group_by_merchant","features":["transaction_amount_count_1h","transaction_amount_count_1d","transaction_amount_count_30d","transaction_amount_count_365d","transaction_amount_sum_1h"]},{"name":"risk.user_data.user_group_by","features":["account_age","account_balance","credit_score","number_of_devices","country","account_type","preferred_language"]},{"name":"risk.merchant_data.merchant_group_by","features":["account_age","zipcode","is_big_merchant","country","account_type","preferred_language"]}]},"online":false,"production":false,"team":"risk","modelType":"XGBoost"}]}
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Introduced a new `DynamoDBMonitoringStore` for improved model data
retrieval.
- Enhanced `Model` structure to include joins and groupings for better
data organization.
- Expanded `parseTeam` method to handle `Model` instances in metadata
processing.
- Updated `ModelController` and `SearchController` to utilize real data
from `DynamoDBMonitoringStore`.
	- Introduced new methods for managing datasets in the `MetadataStore`.
- Improved handling of list values in the DynamoDB key-value store
implementation.
- Added support for AWS services in the application through new Docker
configurations.
- Enhanced the application's Docker setup for better build and runtime
environments.
- Modified the application's metadata loading process to include a new
section for DynamoDB.
- **Bug Fixes**
- Corrected handling of `Either` types in test cases to prevent runtime
errors.
- **Documentation**
	- Updated configuration files to support new DynamoDB module.
- **Tests**
- Added comprehensive unit tests for `DynamoDBKVStoreImpl` and
`DynamoDBMonitoringStore`.
- Enhanced test coverage for `ModelController` and `SearchController`
with mocked dependencies.
- Introduced new tests for the functionality of
`DynamoDBMonitoringStore`.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
nikhil-zlai pushed a commit that referenced this pull request Oct 24, 2024
## Summary
Downgrade Play to 2.x. The version of Play we had required Scala 2.13.
This ends up being painful to work with when we start introducing
dependencies from the 'hub' play module to other modules like api /
online (which we need for the Dynamodb hookup). Sbt isn't very happy
when we're trying to hook up these builds across scala versions when hub
is defaulting to 2.13 and the rest of the project on 2.12. To not bang
at this further, I'm downgrading to a play version on scala 2.12 and we
can revisit when we're ready to bump to Scala 2.13.

## Checklist
- [ ] Added Unit Tests
- [X] Covered by existing CI
- [X] Integration tested
- [ ] Documentation update



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Enhanced mock data generation for time series, allowing for a broader
range of generated values.
- Updated Java options in the Docker initialization script to prevent
execution errors.

- **Bug Fixes**
- Improved error handling in test cases by correctly accessing the
successful results from decoded responses.

- **Chores**
- Updated project dependencies and plugins to maintain compatibility and
improve build configuration, including the Play Framework plugin and
several SBT plugins.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
nikhil-zlai pushed a commit that referenced this pull request Oct 24, 2024
## Summary
PR overview - [Video
Link](https://drive.google.com/file/d/1Rei6upL2OiAls2jX7mCERaJGai3Noo1j/view?usp=drive_link)
This PR builds on #33 and
#43. We register the relevant
model / join / groupby / staging query artifacts at the 'app' docker
container startup by using the MetadataUploader and hitting the Dynamo
endpoints using the KV store. We also extend the API to stop returning
mocked data for the list and search calls and start returning real
registered models + enriched responses (so the model object includes
details on the Joins, GroupBys and features).

There were a few broken pieces along the way that I fixed while working
through the integration (e.g. the metadata walker code was missing
handling models, the api.thrift enum for model type needed to start at
index 0 etc).

## Checklist
- [X] Added Unit Tests
- [X] Covered by existing CI
- [X] Integration tested
- [ ] Documentation update

Bringing up the container and curling:
```
$ curl http://localhost:9000/api/v1/search?term=1&limit=20
{"offset":0,"items":[{"name":"risk.transaction_model.v1","join":{"name":"risk.user_transactions.txn_join","joinFeatures":[],"groupBys":[{"name":"risk.transaction_events.txn_group_by_user","features":["transaction_amount_count_1h","transaction_amount_count_1d","transaction_amount_count_30d","transaction_amount_count_365d","transaction_amount_sum_1h"]},{"name":"risk.transaction_events.txn_group_by_merchant","features":["transaction_amount_count_1h","transaction_amount_count_1d","transaction_amount_count_30d","transaction_amount_count_365d","transaction_amount_sum_1h"]},{"name":"risk.user_data.user_group_by","features":["account_age","account_balance","credit_score","number_of_devices","country","account_type","preferred_language"]},{"name":"risk.merchant_data.merchant_group_by","features":["account_age","zipcode","is_big_merchant","country","account_type","preferred_language"]}]},"online":false,"production":false,"team":"risk","modelType":"XGBoost"}]}
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Introduced a new `DynamoDBMonitoringStore` for improved model data
retrieval.
- Enhanced `Model` structure to include joins and groupings for better
data organization.
- Expanded `parseTeam` method to handle `Model` instances in metadata
processing.
- Updated `ModelController` and `SearchController` to utilize real data
from `DynamoDBMonitoringStore`.
	- Introduced new methods for managing datasets in the `MetadataStore`.
- Improved handling of list values in the DynamoDB key-value store
implementation.
- Added support for AWS services in the application through new Docker
configurations.
- Enhanced the application's Docker setup for better build and runtime
environments.
- Modified the application's metadata loading process to include a new
section for DynamoDB.
- **Bug Fixes**
- Corrected handling of `Either` types in test cases to prevent runtime
errors.
- **Documentation**
	- Updated configuration files to support new DynamoDB module.
- **Tests**
- Added comprehensive unit tests for `DynamoDBKVStoreImpl` and
`DynamoDBMonitoringStore`.
- Enhanced test coverage for `ModelController` and `SearchController`
with mocked dependencies.
- Introduced new tests for the functionality of
`DynamoDBMonitoringStore`.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@coderabbitai coderabbitai bot mentioned this pull request Nov 7, 2024
4 tasks
@coderabbitai coderabbitai bot mentioned this pull request Dec 23, 2024
4 tasks
@coderabbitai coderabbitai bot mentioned this pull request Jan 10, 2025
4 tasks
@coderabbitai coderabbitai bot mentioned this pull request Jan 17, 2025
4 tasks
kumar-zlai pushed a commit that referenced this pull request Apr 25, 2025
## Summary
Downgrade Play to 2.x. The version of Play we had required Scala 2.13.
This ends up being painful to work with when we start introducing
dependencies from the 'hub' play module to other modules like api /
online (which we need for the Dynamodb hookup). Sbt isn't very happy
when we're trying to hook up these builds across scala versions when hub
is defaulting to 2.13 and the rest of the project on 2.12. To not bang
at this further, I'm downgrading to a play version on scala 2.12 and we
can revisit when we're ready to bump to Scala 2.13.

## Checklist
- [ ] Added Unit Tests
- [X] Covered by existing CI
- [X] Integration tested
- [ ] Documentation update



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Enhanced mock data generation for time series, allowing for a broader
range of generated values.
- Updated Java options in the Docker initialization script to prevent
execution errors.

- **Bug Fixes**
- Improved error handling in test cases by correctly accessing the
successful results from decoded responses.

- **Chores**
- Updated project dependencies and plugins to maintain compatibility and
improve build configuration, including the Play Framework plugin and
several SBT plugins.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
kumar-zlai pushed a commit that referenced this pull request Apr 25, 2025
## Summary
PR overview - [Video
Link](https://drive.google.com/file/d/1Rei6upL2OiAls2jX7mCERaJGai3Noo1j/view?usp=drive_link)
This PR builds on #33 and
#43. We register the relevant
model / join / groupby / staging query artifacts at the 'app' docker
container startup by using the MetadataUploader and hitting the Dynamo
endpoints using the KV store. We also extend the API to stop returning
mocked data for the list and search calls and start returning real
registered models + enriched responses (so the model object includes
details on the Joins, GroupBys and features).

There were a few broken pieces along the way that I fixed while working
through the integration (e.g. the metadata walker code was missing
handling models, the api.thrift enum for model type needed to start at
index 0 etc).

## Checklist
- [X] Added Unit Tests
- [X] Covered by existing CI
- [X] Integration tested
- [ ] Documentation update

Bringing up the container and curling:
```
$ curl http://localhost:9000/api/v1/search?term=1&limit=20
{"offset":0,"items":[{"name":"risk.transaction_model.v1","join":{"name":"risk.user_transactions.txn_join","joinFeatures":[],"groupBys":[{"name":"risk.transaction_events.txn_group_by_user","features":["transaction_amount_count_1h","transaction_amount_count_1d","transaction_amount_count_30d","transaction_amount_count_365d","transaction_amount_sum_1h"]},{"name":"risk.transaction_events.txn_group_by_merchant","features":["transaction_amount_count_1h","transaction_amount_count_1d","transaction_amount_count_30d","transaction_amount_count_365d","transaction_amount_sum_1h"]},{"name":"risk.user_data.user_group_by","features":["account_age","account_balance","credit_score","number_of_devices","country","account_type","preferred_language"]},{"name":"risk.merchant_data.merchant_group_by","features":["account_age","zipcode","is_big_merchant","country","account_type","preferred_language"]}]},"online":false,"production":false,"team":"risk","modelType":"XGBoost"}]}
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Introduced a new `DynamoDBMonitoringStore` for improved model data
retrieval.
- Enhanced `Model` structure to include joins and groupings for better
data organization.
- Expanded `parseTeam` method to handle `Model` instances in metadata
processing.
- Updated `ModelController` and `SearchController` to utilize real data
from `DynamoDBMonitoringStore`.
	- Introduced new methods for managing datasets in the `MetadataStore`.
- Improved handling of list values in the DynamoDB key-value store
implementation.
- Added support for AWS services in the application through new Docker
configurations.
- Enhanced the application's Docker setup for better build and runtime
environments.
- Modified the application's metadata loading process to include a new
section for DynamoDB.
- **Bug Fixes**
- Corrected handling of `Either` types in test cases to prevent runtime
errors.
- **Documentation**
	- Updated configuration files to support new DynamoDB module.
- **Tests**
- Added comprehensive unit tests for `DynamoDBKVStoreImpl` and
`DynamoDBMonitoringStore`.
- Enhanced test coverage for `ModelController` and `SearchController`
with mocked dependencies.
- Introduced new tests for the functionality of
`DynamoDBMonitoringStore`.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
kumar-zlai pushed a commit that referenced this pull request Apr 29, 2025
## Summary
Downgrade Play to 2.x. The version of Play we had required Scala 2.13.
This ends up being painful to work with when we start introducing
dependencies from the 'hub' play module to other modules like api /
online (which we need for the Dynamodb hookup). Sbt isn't very happy
when we're trying to hook up these builds across scala versions when hub
is defaulting to 2.13 and the rest of the project on 2.12. To not bang
at this further, I'm downgrading to a play version on scala 2.12 and we
can revisit when we're ready to bump to Scala 2.13.

## Checklist
- [ ] Added Unit Tests
- [X] Covered by existing CI
- [X] Integration tested
- [ ] Documentation update



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Enhanced mock data generation for time series, allowing for a broader
range of generated values.
- Updated Java options in the Docker initialization script to prevent
execution errors.

- **Bug Fixes**
- Improved error handling in test cases by correctly accessing the
successful results from decoded responses.

- **Chores**
- Updated project dependencies and plugins to maintain compatibility and
improve build configuration, including the Play Framework plugin and
several SBT plugins.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
kumar-zlai pushed a commit that referenced this pull request Apr 29, 2025
## Summary
PR overview - [Video
Link](https://drive.google.com/file/d/1Rei6upL2OiAls2jX7mCERaJGai3Noo1j/view?usp=drive_link)
This PR builds on #33 and
#43. We register the relevant
model / join / groupby / staging query artifacts at the 'app' docker
container startup by using the MetadataUploader and hitting the Dynamo
endpoints using the KV store. We also extend the API to stop returning
mocked data for the list and search calls and start returning real
registered models + enriched responses (so the model object includes
details on the Joins, GroupBys and features).

There were a few broken pieces along the way that I fixed while working
through the integration (e.g. the metadata walker code was missing
handling models, the api.thrift enum for model type needed to start at
index 0 etc).

## Checklist
- [X] Added Unit Tests
- [X] Covered by existing CI
- [X] Integration tested
- [ ] Documentation update

Bringing up the container and curling:
```
$ curl http://localhost:9000/api/v1/search?term=1&limit=20
{"offset":0,"items":[{"name":"risk.transaction_model.v1","join":{"name":"risk.user_transactions.txn_join","joinFeatures":[],"groupBys":[{"name":"risk.transaction_events.txn_group_by_user","features":["transaction_amount_count_1h","transaction_amount_count_1d","transaction_amount_count_30d","transaction_amount_count_365d","transaction_amount_sum_1h"]},{"name":"risk.transaction_events.txn_group_by_merchant","features":["transaction_amount_count_1h","transaction_amount_count_1d","transaction_amount_count_30d","transaction_amount_count_365d","transaction_amount_sum_1h"]},{"name":"risk.user_data.user_group_by","features":["account_age","account_balance","credit_score","number_of_devices","country","account_type","preferred_language"]},{"name":"risk.merchant_data.merchant_group_by","features":["account_age","zipcode","is_big_merchant","country","account_type","preferred_language"]}]},"online":false,"production":false,"team":"risk","modelType":"XGBoost"}]}
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Introduced a new `DynamoDBMonitoringStore` for improved model data
retrieval.
- Enhanced `Model` structure to include joins and groupings for better
data organization.
- Expanded `parseTeam` method to handle `Model` instances in metadata
processing.
- Updated `ModelController` and `SearchController` to utilize real data
from `DynamoDBMonitoringStore`.
	- Introduced new methods for managing datasets in the `MetadataStore`.
- Improved handling of list values in the DynamoDB key-value store
implementation.
- Added support for AWS services in the application through new Docker
configurations.
- Enhanced the application's Docker setup for better build and runtime
environments.
- Modified the application's metadata loading process to include a new
section for DynamoDB.
- **Bug Fixes**
- Corrected handling of `Either` types in test cases to prevent runtime
errors.
- **Documentation**
	- Updated configuration files to support new DynamoDB module.
- **Tests**
- Added comprehensive unit tests for `DynamoDBKVStoreImpl` and
`DynamoDBMonitoringStore`.
- Enhanced test coverage for `ModelController` and `SearchController`
with mocked dependencies.
- Introduced new tests for the functionality of
`DynamoDBMonitoringStore`.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
chewy-zlai pushed a commit that referenced this pull request May 16, 2025
…#43)

## Summary
Downgrade Play to 2.x. The version of Play we had required Scala 2.13.
This ends up being painful to work with when we start introducing
dependencies from the 'hub' play module to other modules like api /
online (which we need for the Dynamodb hookup). Sbt isn't very happy
when we're trying to hook up these builds across scala versions when hub
is defaulting to 2.13 and the rest of the project on 2.12. To not bang
at this further, I'm downgrading to a play version on scala 2.12 and we
can revisit when we're ready to bump to Scala 2.13.

## Cheour clientslist
- [ ] Added Unit Tests
- [X] Covered by existing CI
- [X] Integration tested
- [ ] Documentation update



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Enhanced moour clients data generation for time series, allowing for a broader
range of generated values.
- Updated Java options in the Doour clientser initialization script to prevent
execution errors.

- **Bug Fixes**
- Improved error handling in test cases by correctly accessing the
successful results from decoded responses.

- **Chores**
- Updated project dependencies and plugins to maintain compatibility and
improve build configuration, including the Play Framework plugin and
several SBT plugins.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
chewy-zlai pushed a commit that referenced this pull request May 16, 2025
## Summary
PR overview - [Video
Link](https://drive.google.com/file/d/1Rei6upL2OiAls2jX7mCERaJGai3Noo1j/view?usp=drive_link)
This PR builds on #33 and
#43. We register the relevant
model / join / groupby / staging query artifacts at the 'app' doour clientser
container startup by using the MetadataUploader and hitting the Dynamo
endpoints using the KV store. We also extend the API to stop returning
moour clientsed data for the list and search calls and start returning real
registered models + enriched responses (so the model object includes
details on the Joins, GroupBys and features).

There were a few broken pieces along the way that I fixed while working
through the integration (e.g. the metadata walker code was missing
handling models, the api.thrift enum for model type needed to start at
index 0 etc).

## Cheour clientslist
- [X] Added Unit Tests
- [X] Covered by existing CI
- [X] Integration tested
- [ ] Documentation update

Bringing up the container and curling:
```
$ curl http://localhost:9000/api/v1/search?term=1&limit=20
{"offset":0,"items":[{"name":"risk.transaction_model.v1","join":{"name":"risk.user_transactions.txn_join","joinFeatures":[],"groupBys":[{"name":"risk.transaction_events.txn_group_by_user","features":["transaction_amount_count_1h","transaction_amount_count_1d","transaction_amount_count_30d","transaction_amount_count_365d","transaction_amount_sum_1h"]},{"name":"risk.transaction_events.txn_group_by_merchant","features":["transaction_amount_count_1h","transaction_amount_count_1d","transaction_amount_count_30d","transaction_amount_count_365d","transaction_amount_sum_1h"]},{"name":"risk.user_data.user_group_by","features":["account_age","account_balance","credit_score","number_of_devices","country","account_type","preferred_language"]},{"name":"risk.merchant_data.merchant_group_by","features":["account_age","zipcode","is_big_merchant","country","account_type","preferred_language"]}]},"online":false,"production":false,"team":"risk","modelType":"XGBoost"}]}
```


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Introduced a new `DynamoDBMonitoringStore` for improved model data
retrieval.
- Enhanced `Model` structure to include joins and groupings for better
data organization.
- Expanded `parseTeam` method to handle `Model` instances in metadata
processing.
- Updated `ModelController` and `SearchController` to utilize real data
from `DynamoDBMonitoringStore`.
	- Introduced new methods for managing datasets in the `MetadataStore`.
- Improved handling of list values in the DynamoDB key-value store
implementation.
- Added support for AWS services in the application through new Doour clientser
configurations.
- Enhanced the application's Doour clientser setup for better build and runtime
environments.
- Modified the application's metadata loading process to include a new
section for DynamoDB.
- **Bug Fixes**
- Corrected handling of `Either` types in test cases to prevent runtime
errors.
- **Documentation**
	- Updated configuration files to support new DynamoDB module.
- **Tests**
- Added comprehensive unit tests for `DynamoDBKVStoreImpl` and
`DynamoDBMonitoringStore`.
- Enhanced test coverage for `ModelController` and `SearchController`
with moour clientsed dependencies.
- Introduced new tests for the functionality of
`DynamoDBMonitoringStore`.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
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.

4 participants