Skip to content

Conversation

@tchow-zlai
Copy link
Collaborator

@tchow-zlai tchow-zlai commented Mar 6, 2025

Summary

  • Use bazel runfiles to discover resources.

Checklist

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

Summary by CodeRabbit

  • Chores
    • Updated dependency configurations to ensure consistent runtime support and resource availability.
  • Tests
    • Enhanced resource handling for improved configuration loading.
    • Re-enabled and optimized test scenarios for better coverage and reliability.
    • Improved clarity in test case execution with updated resource access methods.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 6, 2025

Walkthrough

This change updates the dependency and resource management for the Spark test targets. In the Bazel build file, _RUNFILES_DEP is added to the deps attributes and a new data attribute is introduced for the fetcher_test suite. In the Scala test file, import statements have been reorganized, resource loading now uses the class loader and Runfiles, and a previously ignored test is enabled.

Changes

Files Change Summary
spark/BUILD.bazel Updated deps for scala_test_suite (fetcher_test) and scala_library (test_lib) by appending _RUNFILES_DEP; added data attribute for test resources.
spark/src/test/scala/ai/chronon/spark/test/fetcher/FetcherTest.scala Reorganized import statements; changed resource access from getResource to getClassLoader.getResource and Runfiles for resource location; enabled test case.

Suggested reviewers

  • piyush-zlai
  • nikhil-zlai
  • kumar-zlai
  • david-zlai

Poem

In the code where tests align,
Dependencies now neatly combine.
Runfiles guide the resource way,
Enabling tests to brightly play.
Code runs smooth – hooray! 🚀

Happy coding!

Warning

Review ran into problems

🔥 Problems

GitHub Actions and Pipeline Checks: Resource not accessible by integration - https://docs.github.com/rest/actions/workflow-runs#list-workflow-runs-for-a-repository.

Please grant the required permissions to the CodeRabbit GitHub App under the organization or repository settings.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 05b6657 and 238d942.

📒 Files selected for processing (1)
  • spark/src/test/scala/ai/chronon/spark/test/fetcher/FetcherTest.scala (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (13)
  • GitHub Check: streaming_tests
  • GitHub Check: streaming_tests
  • GitHub Check: join_tests
  • GitHub Check: join_tests
  • GitHub Check: analyzer_tests
  • GitHub Check: groupby_tests
  • GitHub Check: groupby_tests
  • GitHub Check: analyzer_tests
  • GitHub Check: spark_tests
  • GitHub Check: spark_tests
  • GitHub Check: fetcher_tests
  • GitHub Check: fetcher_tests
  • GitHub Check: scala_compile_fmt_fix
🔇 Additional comments (12)
spark/src/test/scala/ai/chronon/spark/test/fetcher/FetcherTest.scala (12)

27-28: Added necessary imports for fetcher functionality.

Required imports added for FetchContext and Request classes.


34-34: Changed from GsonBuilder to Runfiles.

Switched to Bazel's Runfiles for resource handling.


61-61: Enabled metadata store test.

Previously ignored test now enabled.


66-66: Updated resource loading pattern.

Changed from getClass.getResource(s"/$joinPath") to getClass.getClassLoader.getResource(s"$joinPath") for proper classpath resource loading.


70-71: Added Bazel Runfiles support.

Using Runfiles for test resource resolution.


83-83: Updated MetadataDirWalker instantiation.

Now using Runfiles path instead of classpath resource.


90-91: Added joinKeyName variable.

Extracted key name to improve readability and maintainability.


92-92: Using joinKeyName for KV store retrieval.

Consistent variable usage for key lookups.


100-100: Updated equality check with joinKeyName.

Using the correct key format for verification.


107-107: Consistent use of runFilesResource for second walker.

Makes resource handling consistent throughout the test.


114-114: Final instance of joinKeyName usage.

Consistently using the same key format.


122-122: Updated expected group_by assertion.

Using dot notation for group by key.


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

Co-authored-by: Thomas Chow <[email protected]>
singleFilePut.flatMap(putRequests => Await.result(putRequests, Duration.Inf))

val response = inMemoryKvStore.get(GetRequest(joinPath.getBytes(), singleFileDataSet))
val joinKeyName = "joins/team.example_join.v1"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hey guys, so this is a change I'm not sure is exactly correct, but it does get the tests to pass. I had to change joins/team/example_join.v1 -> joins/team.example_join.v1 removing the second / since that didn't seem to match up with what was written to the kv store. Not sure if this behavior had changed at any point. cc @piyush-zlai @nikhil-zlai

Copy link
Contributor

Choose a reason for hiding this comment

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

this is correct. join and groupby name in the metadata would have the team inside it.

ex:
quickstart.purchases.v1 where quickstart is the team

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

wonder how this ever worked?

@tchow-zlai tchow-zlai merged commit f992e7b into main Mar 6, 2025
16 of 30 checks passed
@tchow-zlai tchow-zlai deleted the tchow/reenable-fetcher branch March 6, 2025 19:47
kumar-zlai pushed a commit that referenced this pull request Apr 25, 2025
## Summary

- Use bazel runfiles to discover resources. 

## Checklist
- [ ] Added Unit Tests
- [ ] Covered by existing CI
- [ ] Integration tested
- [ ] Documentation update
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Chores**
- Updated dependency configurations to ensure consistent runtime support
and resource availability.
- **Tests**
  - Enhanced resource handling for improved configuration loading.
- Re-enabled and optimized test scenarios for better coverage and
reliability.
- Improved clarity in test case execution with updated resource access
methods.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- av pr metadata
This information is embedded by the av CLI when creating PRs to track
the status of stacks when using Aviator. Please do not delete or edit
this section of the PR.
```
{"parent":"main","parentHead":"","trunk":"main"}
```
-->

---------

Co-authored-by: Thomas Chow <[email protected]>
kumar-zlai pushed a commit that referenced this pull request Apr 29, 2025
## Summary

- Use bazel runfiles to discover resources. 

## Checklist
- [ ] Added Unit Tests
- [ ] Covered by existing CI
- [ ] Integration tested
- [ ] Documentation update
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Chores**
- Updated dependency configurations to ensure consistent runtime support
and resource availability.
- **Tests**
  - Enhanced resource handling for improved configuration loading.
- Re-enabled and optimized test scenarios for better coverage and
reliability.
- Improved clarity in test case execution with updated resource access
methods.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- av pr metadata
This information is embedded by the av CLI when creating PRs to track
the status of stacks when using Aviator. Please do not delete or edit
this section of the PR.
```
{"parent":"main","parentHead":"","trunk":"main"}
```
-->

---------

Co-authored-by: Thomas Chow <[email protected]>
chewy-zlai pushed a commit that referenced this pull request May 15, 2025
## Summary

- Use bazel runfiles to discover resources. 

## Checklist
- [ ] Added Unit Tests
- [ ] Covered by existing CI
- [ ] Integration tested
- [ ] Documentation update
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Chores**
- Updated dependency configurations to ensure consistent runtime support
and resource availability.
- **Tests**
  - Enhanced resource handling for improved configuration loading.
- Re-enabled and optimized test scenarios for better coverage and
reliability.
- Improved clarity in test case execution with updated resource access
methods.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- av pr metadata
This information is embedded by the av CLI when creating PRs to track
the status of stacks when using Aviator. Please do not delete or edit
this section of the PR.
```
{"parent":"main","parentHead":"","trunk":"main"}
```
-->

---------

Co-authored-by: Thomas Chow <[email protected]>
chewy-zlai pushed a commit that referenced this pull request May 15, 2025
## Summary

- Use bazel runfiles to discover resources. 

## Checklist
- [ ] Added Unit Tests
- [ ] Covered by existing CI
- [ ] Integration tested
- [ ] Documentation update
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Chores**
- Updated dependency configurations to ensure consistent runtime support
and resource availability.
- **Tests**
  - Enhanced resource handling for improved configuration loading.
- Re-enabled and optimized test scenarios for better coverage and
reliability.
- Improved clarity in test case execution with updated resource access
methods.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- av pr metadata
This information is embedded by the av CLI when creating PRs to track
the status of stacks when using Aviator. Please do not delete or edit
this section of the PR.
```
{"parent":"main","parentHead":"","trunk":"main"}
```
-->

---------

Co-authored-by: Thomas Chow <[email protected]>
chewy-zlai pushed a commit that referenced this pull request May 16, 2025
## Summary

- Use bazel runfiles to discover resources. 

## Cheour clientslist
- [ ] Added Unit Tests
- [ ] Covered by existing CI
- [ ] Integration tested
- [ ] Documentation update
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Chores**
- Updated dependency configurations to ensure consistent runtime support
and resource availability.
- **Tests**
  - Enhanced resource handling for improved configuration loading.
- Re-enabled and optimized test scenarios for better coverage and
reliability.
- Improved clarity in test case execution with updated resource access
methods.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

<!-- av pr metadata
This information is embedded by the av CLI when creating PRs to traour clients
the status of staour clientss when using Aviator. Please do not delete or edit
this section of the PR.
```
{"parent":"main","parentHead":"","trunk":"main"}
```
-->

---------

Co-authored-by: Thomas Chow <[email protected]>
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.

5 participants