Skip to content

Conversation

@kumar-zlai
Copy link
Contributor

@kumar-zlai kumar-zlai commented Feb 21, 2025

Summary

Added pinning support for both our maven and spark repositories so we don't have to resolve them during builds.

Going forward whenever we make any updates to the artifacts in either maven or spark repositories, we would need to re-pin the changed repos using following commands and check-in the updated json files.

REPIN=1 bazel run @maven//:pin
REPIN=1 bazel run @spark//:pin

Checklist

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

Summary by CodeRabbit

  • New Features

    • Integrated enhanced repository management for Maven and Spark, providing improved dependency installation.
    • Added support for JSON configuration files for Maven and Spark installations.
  • Chores

    • Updated documentation to include instructions on pinning Maven artifacts and managing dependency versions effectively.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 21, 2025

Walkthrough

This change extends repository configuration by adding Maven and Spark installation functions in the WORKSPACE file. The update integrates JSON configuration support via a new parameter maven_install_json across various dependency build rule modules, ensuring that both Maven and Spark repositories are set up with enhanced configurability. The modifications maintain existing functionality while appending additional JSON-based configuration parameters.

Changes

File(s) Change Summary
WORKSPACE Added loading and invocation of pinned_maven_repo_install() and pinned_spark_repo_install() to manage Maven and Spark repository installations.
tools/.../defs.bzl, tools/.../load_dependencies.bzl In defs.bzl, introduced an optional parameter maven_install_json to the repository function; in load_dependencies.bzl, updated load_all_dependencies to use this parameter instead of a fixed None.
tools/.../maven_repository.bzl, tools/.../spark_repository.bzl Added maven_install_json to their respective repository function calls with values "//:maven_install.json" and "//:spark_install.json", respectively.
devnotes.md Introduced a section on "Pinning maven artifacts," detailing version pinning practices and commands for managing dependencies.

Sequence Diagram(s)

sequenceDiagram
    participant W as WORKSPACE
    participant L as load_all_dependencies
    participant M as Maven Installer
    participant S as Spark Installer
    participant R as repository()
    
    W->>L: load_all_dependencies()
    W->>M: pinned_maven_repo_install()
    M->>R: Call repository(..., maven_install_json)
    W->>S: pinned_spark_repo_install()
    S->>R: Call repository(..., maven_install_json)
Loading

Possibly related PRs

Suggested reviewers

  • piyush-zlai
  • nikhil-zlai
  • tchow-zlai

Poem

Repository changes now take flight,
Maven and Spark shine ever bright.
JSON guides the build with grace,
New flows set the pace.
Code aligns in perfect rhyme,
Celebrating progress, one commit at a time!
🚀🎉

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.


🪧 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

@kumar-zlai kumar-zlai changed the title Added maven artifact pinning support Add maven artifact pinning support Feb 21, 2025
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 comments (1)
tools/build_rules/dependencies/maven_repository.bzl (1)

151-152: ⚠️ Potential issue

Remove duplicate dependency.

vertx-unit is listed twice with the same version.

     "io.vertx:vertx-unit:4.5.10",
-    "io.vertx:vertx-unit:4.5.10",
📜 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 428b77c and d8c887e.

📒 Files selected for processing (5)
  • WORKSPACE (1 hunks)
  • tools/build_rules/dependencies/defs.bzl (2 hunks)
  • tools/build_rules/dependencies/load_dependencies.bzl (1 hunks)
  • tools/build_rules/dependencies/maven_repository.bzl (1 hunks)
  • tools/build_rules/dependencies/spark_repository.bzl (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: bazel_config_tests
  • GitHub Check: enforce_triggered_workflows
🔇 Additional comments (4)
tools/build_rules/dependencies/load_dependencies.bzl (1)

21-21: LGTM!

The change enables JSON-based configuration for Maven installations.

tools/build_rules/dependencies/defs.bzl (1)

14-14: LGTM!

The new optional parameter maintains backward compatibility.

Also applies to: 31-31

tools/build_rules/dependencies/spark_repository.bzl (1)

9-9:

✅ Verification successful

Verify that spark_install.json exists.


🏁 Script executed:

#!/bin/bash
# Check if spark_install.json exists in the repository root
test -f spark_install.json || echo "spark_install.json not found"

Length of output: 28


Spark install file verified.

  • Line 9 in tools/build_rules/dependencies/spark_repository.bzl correctly references //:spark_install.json.
  • The repository root contains spark_install.json as confirmed by the shell check.
tools/build_rules/dependencies/maven_repository.bzl (1)

11-163:

❓ Verification inconclusive

Verify dependency versions.

Several dependencies use very recent versions. Ensure they are stable and compatible.


🏁 Script executed:

#!/bin/bash
# Check Maven Central for latest stable versions and any reported issues
for pkg in "io.vertx:vertx-core:4.5.10" "ch.qos.logback:logback-classic:1.5.6" "software.amazon.awssdk:dynamodb:2.30.13"
do
  artifact=$(echo $pkg | cut -d':' -f1,2)
  version=$(echo $pkg | cut -d':' -f3)
  curl -s "https://search.maven.org/solrsearch/select?q=g:$(echo $artifact | cut -d':' -f1)+AND+a:$(echo $artifact | cut -d':' -f2)&rows=1&wt=json" | jq -r '.response.docs[0].latestVersion'
done

Length of output: 1665


Action: Verify and confirm dependency versions for stability.

  • io.vertx:vertx-core: Currently set to 4.5.10; Maven Central reports 5.0.0.CR5 (a release candidate). Confirm if the current version is intentional.
  • ch.qos.logback:logback-classic: Set to 1.5.6; update available to 1.5.16. Verify upgrade compatibility.
  • software.amazon.awssdk:dynamodb: Using 2.30.13; Maven Central shows 2.30.24. Assess if an update is needed.

Ensure all dependencies are intentionally pinned to stable versions.

load("@maven//:defs.bzl", pinned_maven_repo_install = "pinned_maven_install")
pinned_maven_repo_install()

load("@spark//:defs.bzl", pinned_spark_repo_install = "pinned_maven_install")
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix the alias name for spark repository install.

-load("@spark//:defs.bzl", pinned_spark_repo_install = "pinned_maven_install")
+load("@spark//:defs.bzl", pinned_spark_repo_install = "pinned_spark_install")
📝 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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
load("@spark//:defs.bzl", pinned_spark_repo_install = "pinned_maven_install")
load("@spark//:defs.bzl", pinned_spark_repo_install = "pinned_spark_install")

Comment on lines 9 to +10
pinned = False,
maven_install_json = "//:maven_install.json",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Resolve conflicting pinning configuration.

pinned is set to False but maven_install_json is provided. This configuration appears contradictory since JSON pinning requires pinned=True.

-    pinned = False,
+    pinned = True,
📝 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. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
pinned = False,
maven_install_json = "//:maven_install.json",
pinned = True,
maven_install_json = "//:maven_install.json",

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

🧹 Nitpick comments (1)
devnotes.md (1)

91-98: Concise Documentation: Pinning Artifacts
The new section clearly describes Maven (and Spark) artifact pinning. Consider rewording “can take up a very long time” to “can be time-consuming” for brevity.

📜 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 d8c887e and d4cd708.

📒 Files selected for processing (1)
  • devnotes.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: bazel_config_tests
  • GitHub Check: enforce_triggered_workflows
🔇 Additional comments (1)
devnotes.md (1)

99-108: Clear Command Instructions
The re-pin commands are clear and correct. Ensure that the JSON file updates are committed as noted.

@kumar-zlai kumar-zlai merged commit 3c09382 into main Feb 21, 2025
5 checks passed
@kumar-zlai kumar-zlai deleted the artifact_pinning branch February 21, 2025 01:55
kumar-zlai added a commit that referenced this pull request Apr 25, 2025
## Summary
Added pinning support for both our maven and spark repositories so we
don't have to resolve them during builds.

Going forward whenever we make any updates to the artifacts in either
maven or spark repositories, we would need to re-pin the changed repos
using following commands and check-in the updated json files.

```
REPIN=1 bazel run @maven//:pin
REPIN=1 bazel run @spark//:pin
```

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



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

- **New Features**
- Integrated enhanced repository management for Maven and Spark,
providing improved dependency installation.
- Added support for JSON configuration files for Maven and Spark
installations.

- **Chores**
- Updated documentation to include instructions on pinning Maven
artifacts and managing dependency versions effectively.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
kumar-zlai added a commit that referenced this pull request Apr 29, 2025
## Summary
Added pinning support for both our maven and spark repositories so we
don't have to resolve them during builds.

Going forward whenever we make any updates to the artifacts in either
maven or spark repositories, we would need to re-pin the changed repos
using following commands and check-in the updated json files.

```
REPIN=1 bazel run @maven//:pin
REPIN=1 bazel run @spark//:pin
```

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



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

- **New Features**
- Integrated enhanced repository management for Maven and Spark,
providing improved dependency installation.
- Added support for JSON configuration files for Maven and Spark
installations.

- **Chores**
- Updated documentation to include instructions on pinning Maven
artifacts and managing dependency versions effectively.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
chewy-zlai pushed a commit that referenced this pull request May 15, 2025
## Summary
Added pinning support for both our maven and spark repositories so we
don't have to resolve them during builds.

Going forward whenever we make any updates to the artifacts in either
maven or spark repositories, we would need to re-pin the changed repos
using following commands and check-in the updated json files.

```
REPIN=1 bazel run @maven//:pin
REPIN=1 bazel run @spark//:pin
```

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



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

- **New Features**
- Integrated enhanced repository management for Maven and Spark,
providing improved dependency installation.
- Added support for JSON configuration files for Maven and Spark
installations.

- **Chores**
- Updated documentation to include instructions on pinning Maven
artifacts and managing dependency versions effectively.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
chewy-zlai pushed a commit that referenced this pull request May 15, 2025
## Summary
Added pinning support for both our maven and spark repositories so we
don't have to resolve them during builds.

Going forward whenever we make any updates to the artifacts in either
maven or spark repositories, we would need to re-pin the changed repos
using following commands and check-in the updated json files.

```
REPIN=1 bazel run @maven//:pin
REPIN=1 bazel run @spark//:pin
```

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



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

- **New Features**
- Integrated enhanced repository management for Maven and Spark,
providing improved dependency installation.
- Added support for JSON configuration files for Maven and Spark
installations.

- **Chores**
- Updated documentation to include instructions on pinning Maven
artifacts and managing dependency versions effectively.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
chewy-zlai pushed a commit that referenced this pull request May 16, 2025
## Summary
Added pinning support for both our maven and spark repositories so we
don't have to resolve them during builds.

Going forward whenever we make any updates to the artifacts in either
maven or spark repositories, we would need to re-pin the changed repos
using following commands and cheour clients-in the updated json files.

```
REPIN=1 bazel run @maven//:pin
REPIN=1 bazel run @spark//:pin
```

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



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

- **New Features**
- Integrated enhanced repository management for Maven and Spark,
providing improved dependency installation.
- Added support for JSON configuration files for Maven and Spark
installations.

- **Chores**
- Updated documentation to include instructions on pinning Maven
artifacts and managing dependency versions effectively.
<!-- 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.

3 participants