Skip to content

Add AWS to Artifact Distribution Script #421

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 19 commits into from
Feb 24, 2025
Merged

Conversation

chewy-zlai
Copy link
Collaborator

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

Summary

Adds the ability to push artifacts to aws in addition to gcp. Also adds ability to specify specific customer ids to push to.

Checklist

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

Summary by CodeRabbit

  • New Features

    • Introduced a new automation script that streamlines the process of building artifacts and deploying them to both AWS and GCP with improved error handling and user confirmation.
  • Chores

    • Removed a legacy artifact upload script that previously handled only GCP deployments.

Copy link

coderabbitai bot commented Feb 21, 2025

Walkthrough

This pull request introduces a new shell script, build_and_upload_artifacts.sh, which automates the building and uploading of artifacts for both GCP and AWS. It includes command-line options, input validation, version checks, and functions for uploading artifacts. The legacy script build_and_upload_gcp_artifacts.sh, which focused solely on GCP, has been removed.

Changes

File Change Summary
distribution/build_and_upload_artifacts.sh New unified script that builds artifacts (Python code, JARs, wheels) and uploads them to both GCP and AWS with error handling, confirmation prompts, and cleanup steps.
distribution/build_and_upload_gcp_artifacts.sh Removed legacy script that exclusively built and uploaded artifacts to GCP, including its upload_to_gcp function implementation.

Possibly related PRs

Suggested Reviewers

  • david-zlai

Poem

In the realm of code so bright,
A script unites both cloud and night.
GCP and AWS now share the stage,
With checks and prompts to set the gauge.
Artifacts soar on digital flight —
A cleanup dance, a coder’s delight!

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 e3091a0 and 83bde59.

📒 Files selected for processing (1)
  • distribution/build_and_upload_artifacts.sh (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • distribution/build_and_upload_artifacts.sh

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

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: 1

🧹 Nitpick comments (6)
distribution/build_and_upload_artifacts.sh (6)

39-47: Clarify error message for AWS customer IDs.
Use the explicit option name (e.g., "--aws_customer_ids requires a value") for clarity.


48-56: Clarify error message for GCP customer IDs.
Mention "--gcp_customer_ids" in the error message for precision.


111-119: Thrift generation and wheel build.
Combining the VERSION assignment with the pip command might reduce clarity; consider splitting them.


237-244: AWS customer IDs array handling.
The check [ -z "$INPUT_AWS_CUSTOMER_IDS" ] expands only the first element; consider using a length test to avoid SC2128 warnings.

-if [ -z "$INPUT_AWS_CUSTOMER_IDS" ]; then
-    echo "No customer ids provided for AWS. Using default: ${AWS_CUSTOMER_IDS[*]}"
+if [ ${#INPUT_AWS_CUSTOMER_IDS[@]} -eq 0 ]; then
+    echo "No customer ids provided for AWS. Using default: ${AWS_CUSTOMER_IDS[*]}"
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 238-238: Expanding an array without an index only gives the first element.

(SC2128)


245-252: GCP customer IDs array handling.
Similarly, use a length check to avoid SC2128 warnings.

-if [ -z "$INPUT_GCP_CUSTOMER_IDS" ]; then
-    echo "No customer ids provided for GCP. Using default: ${GCP_CUSTOMER_IDS[*]}"
+if [ ${#INPUT_GCP_CUSTOMER_IDS[@]} -eq 0 ]; then
+    echo "No customer ids provided for GCP. Using default: ${GCP_CUSTOMER_IDS[*]}"
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 246-246: Expanding an array without an index only gives the first element.

(SC2128)


256-256: Wheel cleanup command.
Consider using rm -f ./*.whl to avoid errors if no wheels exist.

📜 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 e6d1790 and 66f4b55.

📒 Files selected for processing (2)
  • distribution/build_and_upload_artifacts.sh (1 hunks)
  • distribution/build_and_upload_gcp_artifacts.sh (0 hunks)
💤 Files with no reviewable changes (1)
  • distribution/build_and_upload_gcp_artifacts.sh
🧰 Additional context used
🪛 Shellcheck (0.10.0)
distribution/build_and_upload_artifacts.sh

[warning] 238-238: Expanding an array without an index only gives the first element.

(SC2128)


[warning] 246-246: Expanding an array without an index only gives the first element.

(SC2128)

🔇 Additional comments (10)
distribution/build_and_upload_artifacts.sh (10)

1-2: Shebang is correct.
No issues.


3-12: print_usage function is clear.
Well-structured usage instructions.


14-18: No-argument check is solid.


66-69: Git diff check is solid.


72-82: Git sync check works as expected.


121-137: Jar build section is solid.
No issues.


141-157: AWS jar build block is acceptable.


158-174: GCP jar build block is acceptable.


184-208: upload_to_gcp function is clear.
The interactive prompt is fine; consider a non-interactive flag for CI if needed later.


210-234: upload_to_aws function is clear.
Well-structured and readable.

Comment on lines 94 to 108
MAJOR_PYTHON_VERSION=$(python --version | cut -d " " -f2 | cut -d "." -f 1)
MINOR_PYTHON_VERSION=$(python --version | cut -d " " -f2 | cut -d "." -f 2)

EXPECTED_MINIMUM_MAJOR_PYTHON_VERSION=3
EXPECTED_MINIMUM_MINOR_PYTHON_VERSION=9

if [[ $EXPECTED_MINIMUM_MAJOR_PYTHON_VERSION -gt $MAJOR_PYTHON_VERSION ]] ; then
echo "Failed major version of $MAJOR_PYTHON_VERSION. Expecting python version of at least $EXPECTED_MINIMUM_MAJOR_PYTHON_VERSION.$EXPECTED_MINIMUM_MINOR_PYTHON_VERSION to build wheel. Your version is $(python --version)"
exit 1
fi

if [[ EXPECTED_MINIMUM_MINOR_PYTHON_VERSION -gt MINOR_PYTHON_VERSION ]] ; then
echo "Failed minor version of $MINOR_PYTHON_VERSION. Expecting python version of at least $EXPECTED_MINIMUM_MAJOR_PYTHON_VERSION.$EXPECTED_MINIMUM_MINOR_PYTHON_VERSION to build wheel. Your version is $(python --version)"
exit 1
fi
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

⚠️ Potential issue

Python version check bug.
Missing '$' in the minor version test (lines 105-108); use $EXPECTED_MINIMUM_MINOR_PYTHON_VERSION and $MINOR_PYTHON_VERSION.

-if [[ EXPECTED_MINIMUM_MINOR_PYTHON_VERSION -gt MINOR_PYTHON_VERSION ]] ; then
-    echo "Failed minor version of $MINOR_PYTHON_VERSION. Expecting python version of at least $EXPECTED_MINIMUM_MAJOR_PYTHON_VERSION.$EXPECTED_MINIMUM_MINOR_PYTHON_VERSION to build wheel. Your version is $(python --version)"
-    exit 1
-fi
+if [[ $EXPECTED_MINIMUM_MINOR_PYTHON_VERSION -gt $MINOR_PYTHON_VERSION ]] ; then
+    echo "Failed minor version of $MINOR_PYTHON_VERSION. Expecting python version of at least $EXPECTED_MINIMUM_MAJOR_PYTHON_VERSION.$EXPECTED_MINIMUM_MINOR_PYTHON_VERSION to build wheel. Your version is $(python --version)"
+    exit 1
+fi
📝 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
MAJOR_PYTHON_VERSION=$(python --version | cut -d " " -f2 | cut -d "." -f 1)
MINOR_PYTHON_VERSION=$(python --version | cut -d " " -f2 | cut -d "." -f 2)
EXPECTED_MINIMUM_MAJOR_PYTHON_VERSION=3
EXPECTED_MINIMUM_MINOR_PYTHON_VERSION=9
if [[ $EXPECTED_MINIMUM_MAJOR_PYTHON_VERSION -gt $MAJOR_PYTHON_VERSION ]] ; then
echo "Failed major version of $MAJOR_PYTHON_VERSION. Expecting python version of at least $EXPECTED_MINIMUM_MAJOR_PYTHON_VERSION.$EXPECTED_MINIMUM_MINOR_PYTHON_VERSION to build wheel. Your version is $(python --version)"
exit 1
fi
if [[ EXPECTED_MINIMUM_MINOR_PYTHON_VERSION -gt MINOR_PYTHON_VERSION ]] ; then
echo "Failed minor version of $MINOR_PYTHON_VERSION. Expecting python version of at least $EXPECTED_MINIMUM_MAJOR_PYTHON_VERSION.$EXPECTED_MINIMUM_MINOR_PYTHON_VERSION to build wheel. Your version is $(python --version)"
exit 1
fi
MAJOR_PYTHON_VERSION=$(python --version | cut -d " " -f2 | cut -d "." -f 1)
MINOR_PYTHON_VERSION=$(python --version | cut -d " " -f2 | cut -d "." -f 2)
EXPECTED_MINIMUM_MAJOR_PYTHON_VERSION=3
EXPECTED_MINIMUM_MINOR_PYTHON_VERSION=9
if [[ $EXPECTED_MINIMUM_MAJOR_PYTHON_VERSION -gt $MAJOR_PYTHON_VERSION ]] ; then
echo "Failed major version of $MAJOR_PYTHON_VERSION. Expecting python version of at least $EXPECTED_MINIMUM_MAJOR_PYTHON_VERSION.$EXPECTED_MINIMUM_MINOR_PYTHON_VERSION to build wheel. Your version is $(python --version)"
exit 1
fi
if [[ $EXPECTED_MINIMUM_MINOR_PYTHON_VERSION -gt $MINOR_PYTHON_VERSION ]] ; then
echo "Failed minor version of $MINOR_PYTHON_VERSION. Expecting python version of at least $EXPECTED_MINIMUM_MAJOR_PYTHON_VERSION.$EXPECTED_MINIMUM_MINOR_PYTHON_VERSION to build wheel. Your version is $(python --version)"
exit 1
fi

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

♻️ Duplicate comments (1)
distribution/build_and_upload_artifacts.sh (1)

92-108: ⚠️ Potential issue

Python version check needs a minor fix.
The minor version test on line 105 is missing $ signs.

-if [[ EXPECTED_MINIMUM_MINOR_PYTHON_VERSION -gt MINOR_PYTHON_VERSION ]] ; then
+if [[ $EXPECTED_MINIMUM_MINOR_PYTHON_VERSION -gt $MINOR_PYTHON_VERSION ]] ; then
🧹 Nitpick comments (3)
distribution/build_and_upload_artifacts.sh (3)

20-63: Argument parsing is correct.
Consider refining error messages in the --aws_customer_ids and --gcp_customer_ids cases to mention the specific option.


230-237: AWS customer IDs check.
Expanding $INPUT_AWS_CUSTOMER_IDS may only yield the first element. Consider using a length check like:

if [ ${#INPUT_AWS_CUSTOMER_IDS[@]} -eq 0 ]; then

to ensure proper handling if multiple IDs are expected.

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 231-231: Expanding an array without an index only gives the first element.

(SC2128)


238-245: GCP customer IDs check.
Similar to AWS, using if [ -z "$INPUT_GCP_CUSTOMER_IDS" ] might not capture all entries. A length check is preferable.

🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 239-239: Expanding an array without an index only gives the first element.

(SC2128)

📜 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 66f4b55 and b72f025.

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

[warning] 231-231: Expanding an array without an index only gives the first element.

(SC2128)


[warning] 239-239: Expanding an array without an index only gives the first element.

(SC2128)

🔇 Additional comments (14)
distribution/build_and_upload_artifacts.sh (14)

1-2: Shebang is set correctly.
No issues here.


3-12: Usage function is clear.
Good concise help message for available options.


14-18: Handles missing arguments properly.
Prints usage and exits if no args provided.


66-69: Uncommitted changes check works as intended.


71-83: Git branch sync verification is solid.
Ensures local branch is up-to-date.


84-91: Script directory and work directory setup look fine.


111-119: Thrift generation and wheel build are proper.
Commands are straightforward and validate wheel existence.


121-137: JAR builds are invoked correctly.
Bazel build commands and file existence checks are in order.


141-150: AWS JAR build block is valid.
Build and existence check for AWS jar works correctly.


151-167: GCP JAR build block is solid.
Both library and submitter JARs are built and validated.


173-174: Default GCP customer IDs set appropriately.
Provides fallback values for GCP uploads.


176-201: upload_to_gcp function is well structured.
Implementation is clear; consider consistently quoting variables for safety.


203-227: upload_to_aws function implementation looks good.
Clear upload flow with proper metadata assignment.


248-249: Cleanup command is concise.
Removes generated wheel files as intended.

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: 4

📜 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 b72f025 and 2402905.

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

[warning] 231-231: Expanding an array without an index only gives the first element.

(SC2128)


[warning] 239-239: Expanding an array without an index only gives the first element.

(SC2128)

🔇 Additional comments (13)
distribution/build_and_upload_artifacts.sh (13)

1-2: Shebang is correct.


3-12: Usage function is clear.


14-18: No-argument check works as expected.


20-63: CLI option parsing is straightforward.


66-69: Git diff check is effective.


71-83: Branch sync validation is solid.


84-91: Directory setup and environment change are fine.


92-108: Python version check now includes proper variable expansion.


111-119: Artifact build steps and wheel existence check are concise.


121-137: Bazel jar builds and file checks are clearly implemented.


151-168: GCP build block is complete and robust.


177-201: GCP upload function is implemented clearly.


248-249: Cleanup command is appropriate.

Comment on lines 206 to 223
function upload_to_aws() {
customer_ids_to_upload=("$@")
echo "Are you sure you want to upload to these customer ids: ${customer_ids_to_upload[*]}"
select yn in "Yes" "No"; do
case $yn in
Yes )
set -euxo pipefail
for element in "${customer_ids_to_upload[@]}"
do
ELEMENT_JAR_PATH=s3://zipline-artifacts-$element/jars
aws s3 cp "$CLOUD_AWS_JAR" "$ELEMENT_JAR_PATH" --metadata="zipline_user=$USER,updated_date=$(date),commit=$(git rev-parse HEAD),branch=$(git rev-parse --abbrev-ref HEAD)"
aws s3 cp "$CLOUD_AWS_SUBMITTER_JAR" "$ELEMENT_JAR_PATH" --metadata="zipline_user=$USER,updated_date=$(date),commit=$(git rev-parse HEAD),branch=$(git rev-parse --abbrev-ref HEAD)"
aws s3 cp "$SERVICE_JAR" "$ELEMENT_JAR_PATH" --metadata="zipline_user=$USER,updated_date=$(date),commit=$(git rev-parse HEAD),branch=$(git rev-parse --abbrev-ref HEAD)"
aws s3 cp "$EXPECTED_ZIPLINE_WHEEL" "$ELEMENT_JAR_PATH" --metadata="zipline_user=$USER,updated_date=$(date),commit=$(git rev-parse HEAD),branch=$(git rev-parse --abbrev-ref HEAD)"
aws s3 cp "$FLINK_JAR" "$ELEMENT_JAR_PATH" --metadata="zipline_user=$USER,updated_date=$(date),commit=$(git rev-parse HEAD),branch=$(git rev-parse --abbrev-ref HEAD)"
done
echo "Succeeded"
break;;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

AWS upload function uses an undefined CLOUD_AWS_SUBMITTER_JAR.
Ensure the AWS submitter jar is built and its path is set (see AWS build block above).

Comment on lines 238 to 245
if [ "$BUILD_GCP" = true ]; then
if [ -z "$INPUT_GCP_CUSTOMER_IDS" ]; then
echo "No customer ids provided for GCP. Using default: ${GCP_CUSTOMER_IDS[*]}"
else
GCP_CUSTOMER_IDS=("${INPUT_GCP_CUSTOMER_IDS[@]}")
fi
upload_to_gcp "${GCP_CUSTOMER_IDS[@]}"
fi
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

GCP customer IDs check: use array length.
Replace [ -z "$INPUT_GCP_CUSTOMER_IDS" ] with:

-    if [ -z "$INPUT_GCP_CUSTOMER_IDS" ]; then
+    if [ ${#INPUT_GCP_CUSTOMER_IDS[@]} -eq 0 ]; then
📝 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
if [ "$BUILD_GCP" = true ]; then
if [ -z "$INPUT_GCP_CUSTOMER_IDS" ]; then
echo "No customer ids provided for GCP. Using default: ${GCP_CUSTOMER_IDS[*]}"
else
GCP_CUSTOMER_IDS=("${INPUT_GCP_CUSTOMER_IDS[@]}")
fi
upload_to_gcp "${GCP_CUSTOMER_IDS[@]}"
fi
if [ "$BUILD_GCP" = true ]; then
if [ ${#INPUT_GCP_CUSTOMER_IDS[@]} -eq 0 ]; then
echo "No customer ids provided for GCP. Using default: ${GCP_CUSTOMER_IDS[*]}"
else
GCP_CUSTOMER_IDS=("${INPUT_GCP_CUSTOMER_IDS[@]}")
fi
upload_to_gcp "${GCP_CUSTOMER_IDS[@]}"
fi
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 239-239: Expanding an array without an index only gives the first element.

(SC2128)

Comment on lines 230 to 237
if [ "$BUILD_AWS" = true ]; then
if [ -z "$INPUT_AWS_CUSTOMER_IDS" ]; then
echo "No customer ids provided for AWS. Using default: ${AWS_CUSTOMER_IDS[*]}"
else
AWS_CUSTOMER_IDS=("${INPUT_AWS_CUSTOMER_IDS[@]}")
fi
upload_to_aws "${AWS_CUSTOMER_IDS[@]}"
fi
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

AWS customer IDs check: use array length.
Instead of [ -z "$INPUT_AWS_CUSTOMER_IDS" ], consider using:

-    if [ -z "$INPUT_AWS_CUSTOMER_IDS" ]; then
+    if [ ${#INPUT_AWS_CUSTOMER_IDS[@]} -eq 0 ]; then
📝 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
if [ "$BUILD_AWS" = true ]; then
if [ -z "$INPUT_AWS_CUSTOMER_IDS" ]; then
echo "No customer ids provided for AWS. Using default: ${AWS_CUSTOMER_IDS[*]}"
else
AWS_CUSTOMER_IDS=("${INPUT_AWS_CUSTOMER_IDS[@]}")
fi
upload_to_aws "${AWS_CUSTOMER_IDS[@]}"
fi
if [ "$BUILD_AWS" = true ]; then
if [ ${#INPUT_AWS_CUSTOMER_IDS[@]} -eq 0 ]; then
echo "No customer ids provided for AWS. Using default: ${AWS_CUSTOMER_IDS[*]}"
else
AWS_CUSTOMER_IDS=("${INPUT_AWS_CUSTOMER_IDS[@]}")
fi
upload_to_aws "${AWS_CUSTOMER_IDS[@]}"
fi
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 231-231: Expanding an array without an index only gives the first element.

(SC2128)

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 (5)
distribution/build_and_upload_artifacts.sh (5)

20-63: Arg parsing is clear; consider distinct error texts for customer IDs.


177-201: upload_to_gcp function is clear; consider a non-interactive flag for automation.


229-236: For AWS IDs, use array length check to avoid SC2128.

-  if [ -z "$INPUT_AWS_CUSTOMER_IDS" ]; then
+  if [ ${#INPUT_AWS_CUSTOMER_IDS[@]} -eq 0 ]; then
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 230-230: Expanding an array without an index only gives the first element.

(SC2128)


237-244: For GCP IDs, use array length check to avoid SC2128.

-  if [ -z "$INPUT_GCP_CUSTOMER_IDS" ]; then
+  if [ ${#INPUT_GCP_CUSTOMER_IDS[@]} -eq 0 ]; then
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 238-238: Expanding an array without an index only gives the first element.

(SC2128)


247-248: Cleanup command works; ensure it targets the right directory.

📜 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 2402905 and 9e7ab67.

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

[warning] 230-230: Expanding an array without an index only gives the first element.

(SC2128)


[warning] 238-238: Expanding an array without an index only gives the first element.

(SC2128)

🔇 Additional comments (12)
distribution/build_and_upload_artifacts.sh (12)

1-12: Usage function is clear.


14-18: Empty-args check works.


66-69: Git diff check is proper.


71-82: Git sync check is solid.


86-91: Working directory setup is correct.


92-108: Python version check is implemented correctly.


111-119: Thrift generation & wheel build logic looks good.


121-137: Bazel jar builds and file checks are solid.


141-150: AWS jar build uses CLOUD_AWS_JAR; confirm no AWS submitter jar is needed.


151-168: GCP jar build and checks are good.


174-174: Default GCP customer IDs set as expected.


203-226: upload_to_aws function mirrors GCP well.

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 (2)
distribution/build_and_upload_artifacts.sh (2)

23-66: Argument Parsing:
Parsing works correctly. A minor nitpick: the error message for customer ID options could mention “--aws_customer_ids” or “--gcp_customer_ids” specifically.


250-251: Cleanup:
Use rm -f ./*.whl to prevent errors if no wheel files are present.

📜 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 9e7ab67 and e3091a0.

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

[warning] 233-233: Expanding an array without an index only gives the first element.

(SC2128)


[warning] 241-241: Expanding an array without an index only gives the first element.

(SC2128)

🔇 Additional comments (11)
distribution/build_and_upload_artifacts.sh (11)

1-12: Usage & Shebang:
Shebang and usage function look good. Consider clarifying in the usage message if multiple customer IDs can be supplied.


69-86: Git Checks:
The uncommitted change and remote-sync tests are smart and concise.


95-111: Python Version Check:
The major and minor version validations are clear and sufficient.


114-122: Wheel Build:
Wheel generation and file-existence checks are straightforward and clear.


124-140: JAR Build:
Bazel build commands and existence validations are well implemented.


144-153: AWS Build Block:
Building the AWS library is correct. Confirm if an AWS submitter jar is needed per design.


154-171: GCP Build Block:
Both the GCP libraries and submitter jar are built and verified properly.


180-204: GCP Upload Function:
The upload_to_gcp function is concise and uses a select prompt for confirmation effectively.


209-229: AWS Upload Function:
The function mirrors the GCP upload logic and is clearly implemented.


232-239: AWS Customer ID Check:
Using -z "$INPUT_AWS_CUSTOMER_IDS" only evaluates the first element.

-    if [ -z "$INPUT_AWS_CUSTOMER_IDS" ]; then
+    if [ ${#INPUT_AWS_CUSTOMER_IDS[@]} -eq 0 ]; then
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 233-233: Expanding an array without an index only gives the first element.

(SC2128)


240-247: GCP Customer ID Check:
Consider replacing the -z check with an array length check:

-    if [ -z "$INPUT_GCP_CUSTOMER_IDS" ]; then
+    if [ ${#INPUT_GCP_CUSTOMER_IDS[@]} -eq 0 ]; then
🧰 Tools
🪛 Shellcheck (0.10.0)

[warning] 241-241: Expanding an array without an index only gives the first element.

(SC2128)

@chewy-zlai chewy-zlai merged commit 33bfc75 into main Feb 24, 2025
5 checks passed
@chewy-zlai chewy-zlai deleted the chewy-zlai/aws_distribution branch February 24, 2025 20:39
kumar-zlai pushed a commit that referenced this pull request Feb 26, 2025
## Summary

Adds the ability to push artifacts to aws in addition to gcp. Also adds
ability to specify specific customer ids to push to.

## 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

- **New Features**
- Introduced a new automation script that streamlines the process of
building artifacts and deploying them to both AWS and GCP with improved
error handling and user confirmation.

- **Chores**
- Removed a legacy artifact upload script that previously handled only
GCP deployments.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@coderabbitai coderabbitai bot mentioned this pull request Mar 5, 2025
4 tasks
This was referenced Mar 20, 2025
kumar-zlai pushed a commit that referenced this pull request Apr 25, 2025
## Summary

Adds the ability to push artifacts to aws in addition to gcp. Also adds
ability to specify specific customer ids to push to.

## 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

- **New Features**
- Introduced a new automation script that streamlines the process of
building artifacts and deploying them to both AWS and GCP with improved
error handling and user confirmation.

- **Chores**
- Removed a legacy artifact upload script that previously handled only
GCP deployments.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
kumar-zlai pushed a commit that referenced this pull request Apr 29, 2025
## Summary

Adds the ability to push artifacts to aws in addition to gcp. Also adds
ability to specify specific customer ids to push to.

## 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

- **New Features**
- Introduced a new automation script that streamlines the process of
building artifacts and deploying them to both AWS and GCP with improved
error handling and user confirmation.

- **Chores**
- Removed a legacy artifact upload script that previously handled only
GCP deployments.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
chewy-zlai added a commit that referenced this pull request May 15, 2025
## Summary

Adds the ability to push artifacts to aws in addition to gcp. Also adds
ability to specify specific customer ids to push to.

## 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

- **New Features**
- Introduced a new automation script that streamlines the process of
building artifacts and deploying them to both AWS and GCP with improved
error handling and user confirmation.

- **Chores**
- Removed a legacy artifact upload script that previously handled only
GCP deployments.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
chewy-zlai added a commit that referenced this pull request May 15, 2025
## Summary

Adds the ability to push artifacts to aws in addition to gcp. Also adds
ability to specify specific customer ids to push to.

## 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

- **New Features**
- Introduced a new automation script that streamlines the process of
building artifacts and deploying them to both AWS and GCP with improved
error handling and user confirmation.

- **Chores**
- Removed a legacy artifact upload script that previously handled only
GCP deployments.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
chewy-zlai added a commit that referenced this pull request May 16, 2025
## Summary

Adds the ability to push artifacts to aws in addition to gcp. Also adds
ability to specify specific customer ids to push to.

## 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

- **New Features**
- Introduced a new automation script that streamlines the process of
building artifacts and deploying them to both AWS and GCP with improved
error handling and user confirmation.

- **Chores**
- Removed a legacy artifact upload script that previously handled only
GCP deployments.
<!-- 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