Skip to content

Fix integration tests for dev loop #608

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

Merged
merged 2 commits into from
Apr 8, 2025
Merged

Conversation

david-zlai
Copy link
Contributor

@david-zlai david-zlai commented Apr 8, 2025

Summary

Temporary fix as we recently made a change to enforce that whatever version we're running in the python side, we also run the same jar versions - b9c0818

And in our build_and_upload script, it always pushes to version: latest
But when we run our tests, we're running with python version of 0.1.0 - so we're never running with the updated jars we intend to.

This change just updates our dev testing to always point to latest

Checklist

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

Summary by CodeRabbit

  • New Features

    • Improved error handling now provides clear feedback if any execution step fails.
    • Key operations automatically use the latest available package version.
    • Environment configuration has been streamlined for a more predictable setup.
  • Bug Fixes

    • Removed a line that raised an error when no job ID was found, allowing smoother execution in such cases.

Copy link

coderabbitai bot commented Apr 8, 2025

Walkthrough

The pull request updates the run_gcp_quickstart.sh script to improve error handling and command execution. A new function fail_if_bash_failed is added to check the exit status after key commands, ensuring that errors are caught and the script exits appropriately. The zipline run commands are modified to include the --version latest flag for the development environment, ensuring the most recent package is used. Additionally, the export of PYTHONPATH is simplified to reference only the CHRONON_ROOT path.

Changes

File(s) Affected Change Summary
scripts/distribution/run_gcp_quickstart.sh Added fail_if_bash_failed to check command exit statuses; updated zipline run commands to include --version latest; simplified PYTHONPATH export.
api/python/ai/chronon/repo/gcp.py Removed line raising RuntimeError when no job ID is found in Dataproc submitter logs, allowing function to complete without failure.

Possibly related PRs

Suggested reviewers

  • chewy-zlai
  • tchow-zlai

Poem

In our script of bash and might,
New checks shine with error light,
Latest version leads the run,
Each command now gracefully done,
Code and cheer in joyful flight! 🎉

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 36295d2 and 03512e2.

📒 Files selected for processing (1)
  • api/python/ai/chronon/repo/gcp.py (0 hunks)
💤 Files with no reviewable changes (1)
  • api/python/ai/chronon/repo/gcp.py
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: non_spark_tests
  • GitHub Check: non_spark_tests
  • GitHub Check: enforce_triggered_workflows

🪧 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 plan to trigger planning for file edits and PR creation.
  • @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

@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

🧹 Nitpick comments (3)
scripts/distribution/run_gcp_quickstart.sh (3)

66-71: Improve fail_if_bash_failed Implementation:
Currently, the function relies on $? directly. Consider accepting an explicit exit code for consistency since some calls pass $? while others do not. For example:

-function fail_if_bash_failed() {
-  if [ $? -ne 0 ]; then
-    echo -e "${RED} <<<<<<<<<<<<<<<<-----------------FAILED!----------------->>>>>>>>>>>>>>>>>\033[0m"
-    exit 1
-  fi
-}
+function fail_if_bash_failed() {
+  local exit_code=$1
+  if [ $exit_code -ne 0 ]; then
+    echo -e "${RED} <<<<<<<<<<<<<<<<-----------------FAILED!----------------->>>>>>>>>>>>>>>>>\033[0m"
+    exit 1
+  fi
+}

Then call it consistently as fail_if_bash_failed $?.


88-88: Unused Variable Warning:
BACKFILL_JOB_ID is assigned but not used. If it’s meant for future use or external reference, please document or consider making it local.

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 88-88: BACKFILL_JOB_ID appears unused. Verify use (or export if used externally).

(SC2034)


109-109: Unused Variable Warning:
UPLOAD_TO_KV_JOB_ID appears unused. Verify its necessity or clean it up to avoid confusion.

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 109-109: UPLOAD_TO_KV_JOB_ID appears unused. Verify use (or export if used externally).

(SC2034)

📜 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 0e3f93b and 36295d2.

📒 Files selected for processing (1)
  • scripts/distribution/run_gcp_quickstart.sh (5 hunks)
🧰 Additional context used
🪛 Shellcheck (0.10.0)
scripts/distribution/run_gcp_quickstart.sh

[warning] 88-88: BACKFILL_JOB_ID appears unused. Verify use (or export if used externally).

(SC2034)


[warning] 109-109: UPLOAD_TO_KV_JOB_ID appears unused. Verify use (or export if used externally).

(SC2034)

🔇 Additional comments (6)
scripts/distribution/run_gcp_quickstart.sh (6)

45-47: Simplify PYTHONPATH Export:
Exporting PYTHONPATH to only CHRONON_ROOT meets the PR objective. Just verify no other required paths are lost.


83-84: Backfill Version Flag:
The dev backfill command now uses --version latest, ensuring version consistency with JAR files.


95-96: Group-By-Upload Version Flag:
The dev group-by-upload command correctly adds --version latest for updated testing.


106-107: Upload-to-KV Version Flag:
The dev upload-to-kv command now includes --version latest, aligning with the PR goal.


116-117: Metadata-Upload Version Flag:
The metadata-upload command for dev now specifies --version latest, which is consistent.


127-128: Fetch Version Flag:
The fetch command now uses --version latest, ensuring the latest package is used during development testing.

@david-zlai david-zlai merged commit 799975d into main Apr 8, 2025
7 checks passed
@david-zlai david-zlai deleted the davidhan/fix_integration_tests branch April 8, 2025 20:18
kumar-zlai pushed a commit that referenced this pull request Apr 25, 2025
## Summary

Temporary fix as we recently made a change to enforce that whatever
version we're running in the python side, we also run the same jar
versions -
f1ed879

And in our build_and_upload script, it always pushes to version:
[latest](https://github.com/zipline-ai/chronon/blob/main/scripts/distribution/build_and_upload_artifacts.sh#L184-L186)
But when we run our tests, we're running with[ python version of
0.1.0](https://github.com/zipline-ai/chronon/blob/main/scripts/distribution/build_and_upload_artifacts.sh#L103)
- so we're never running with the updated jars we intend to.

This change just updates our dev testing to always point to `latest` 

## Checklist
- [ ] Added Unit Tests
- [ ] 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**
- Improved error handling now provides clear feedback if any execution
step fails.
- Key operations automatically use the latest available package version.
- Environment configuration has been streamlined for a more predictable
setup.
  
- **Bug Fixes**
- Removed a line that raised an error when no job ID was found, allowing
smoother execution in such cases.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
kumar-zlai pushed a commit that referenced this pull request Apr 29, 2025
## Summary

Temporary fix as we recently made a change to enforce that whatever
version we're running in the python side, we also run the same jar
versions -
51c9bc0

And in our build_and_upload script, it always pushes to version:
[latest](https://github.com/zipline-ai/chronon/blob/main/scripts/distribution/build_and_upload_artifacts.sh#L184-L186)
But when we run our tests, we're running with[ python version of
0.1.0](https://github.com/zipline-ai/chronon/blob/main/scripts/distribution/build_and_upload_artifacts.sh#L103)
- so we're never running with the updated jars we intend to.

This change just updates our dev testing to always point to `latest` 

## Checklist
- [ ] Added Unit Tests
- [ ] 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**
- Improved error handling now provides clear feedback if any execution
step fails.
- Key operations automatically use the latest available package version.
- Environment configuration has been streamlined for a more predictable
setup.
  
- **Bug Fixes**
- Removed a line that raised an error when no job ID was found, allowing
smoother execution in such cases.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
chewy-zlai pushed a commit that referenced this pull request May 15, 2025
## Summary

Temporary fix as we recently made a change to enforce that whatever
version we're running in the python side, we also run the same jar
versions -
aef8406

And in our build_and_upload script, it always pushes to version:
[latest](https://github.com/zipline-ai/chronon/blob/main/scripts/distribution/build_and_upload_artifacts.sh#L184-L186)
But when we run our tests, we're running with[ python version of
0.1.0](https://github.com/zipline-ai/chronon/blob/main/scripts/distribution/build_and_upload_artifacts.sh#L103)
- so we're never running with the updated jars we intend to.

This change just updates our dev testing to always point to `latest` 

## Checklist
- [ ] Added Unit Tests
- [ ] 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**
- Improved error handling now provides clear feedback if any execution
step fails.
- Key operations automatically use the latest available package version.
- Environment configuration has been streamlined for a more predictable
setup.
  
- **Bug Fixes**
- Removed a line that raised an error when no job ID was found, allowing
smoother execution in such cases.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
chewy-zlai pushed a commit that referenced this pull request May 15, 2025
## Summary

Temporary fix as we recently made a change to enforce that whatever
version we're running in the python side, we also run the same jar
versions -
8f14e61

And in our build_and_upload script, it always pushes to version:
[latest](https://github.com/zipline-ai/chronon/blob/main/scripts/distribution/build_and_upload_artifacts.sh#L184-L186)
But when we run our tests, we're running with[ python version of
0.1.0](https://github.com/zipline-ai/chronon/blob/main/scripts/distribution/build_and_upload_artifacts.sh#L103)
- so we're never running with the updated jars we intend to.

This change just updates our dev testing to always point to `latest` 

## Checklist
- [ ] Added Unit Tests
- [ ] 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**
- Improved error handling now provides clear feedback if any execution
step fails.
- Key operations automatically use the latest available package version.
- Environment configuration has been streamlined for a more predictable
setup.
  
- **Bug Fixes**
- Removed a line that raised an error when no job ID was found, allowing
smoother execution in such cases.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
chewy-zlai pushed a commit that referenced this pull request May 16, 2025
## Summary

Temporary fix as we recently made a change to enforce that whatever
version we're running in the python side, we also run the same jar
versions -
15efc6c

And in our build_and_upload script, it always pushes to version:
[latest](https://github.com/zipline-ai/chronon/blob/main/scripts/distribution/build_and_upload_artifacts.sh#L184-L186)
But when we run our tests, we're running with[ python version of
0.1.0](https://github.com/zipline-ai/chronon/blob/main/scripts/distribution/build_and_upload_artifacts.sh#L103)
- so we're never running with the updated jars we intend to.

This change just updates our dev testing to always point to `latest` 

## Cheour clientslist
- [ ] Added Unit Tests
- [ ] 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**
- Improved error handling now provides clear feedbaour clients if any execution
step fails.
- Key operations automatically use the latest available paour clientsage version.
- Environment configuration has been streamlined for a more predictable
setup.
  
- **Bug Fixes**
- Removed a line that raised an error when no job ID was found, allowing
smoother execution in such cases.
<!-- 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.

2 participants