Skip to content

Cleanup packaging scripts#2782

Merged
aramprice merged 5 commits into
mainfrom
cleanup-packaging-scripts
Jul 16, 2026
Merged

Cleanup packaging scripts#2782
aramprice merged 5 commits into
mainfrom
cleanup-packaging-scripts

Conversation

@aramprice

Copy link
Copy Markdown
Member

No description provided.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The director, health monitor, and NATS packaging scripts now discover gemspecs with glob-based loops, build gems from their package directories, and move generated gems into vendor/cache. Install-target paths use quoted variable expansion. Generated Gemfiles remove explicit json constraints where applicable, and staged Bundler inputs now include .bundle alongside Gemfile and Gemfile.lock. The NATS package also installs its server binary under the install target.

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning No PR description was provided, so the required template sections and release-note context are missing. Add the template sections: change summary, context, tests run, release note blurb, breaking-change status, team tags, and AI review feedback.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the packaging-script cleanup across the changed packages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cleanup-packaging-scripts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 15, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/director/packaging (1)

10-16: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Pass the gemspec file to gem build in all three packaging scripts.

RubyGems expects a gemspec argument, so these loops will exit on the first iteration with set -e.

  • packages/director/packaging#L10-L16: gem build "$(basename "$gemspec")"
  • packages/health_monitor/packaging#L7-L13: gem build "$(basename "$gemspec")"
  • packages/nats/packaging#L11-L17: gem build "$(basename "$gemspec")"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/director/packaging` around lines 10 - 16, Update the gem build loops
in packages/director/packaging lines 10-16, packages/health_monitor/packaging
lines 7-13, and packages/nats/packaging lines 11-17 to pass the current gemspec
filename to gem build using the existing gemspec variable and basename handling.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@packages/director/packaging`:
- Around line 10-16: Update the gem build loops in packages/director/packaging
lines 10-16, packages/health_monitor/packaging lines 7-13, and
packages/nats/packaging lines 11-17 to pass the current gemspec filename to gem
build using the existing gemspec variable and basename handling.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3590585f-42e8-4bca-aeff-8b42a02de434

📥 Commits

Reviewing files that changed from the base of the PR and between 6da5d39 and c2e482c.

📒 Files selected for processing (3)
  • packages/director/packaging
  • packages/health_monitor/packaging
  • packages/nats/packaging

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR cleans up BOSH release package packaging scripts for nats, health_monitor, and director, aiming to simplify directory creation, gem building, and what gets copied into ${BOSH_INSTALL_TARGET}.

Changes:

  • Consolidate install-target directory creation and improve quoting.
  • Refactor gem build loop to iterate over gemspecs and populate vendor/cache.
  • Copy Gemfile, Gemfile.lock, and .bundle into ${BOSH_INSTALL_TARGET} in one command.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
packages/nats/packaging Refactors gem build + caching flow; adjusts install target setup and file copying.
packages/health_monitor/packaging Refactors gem build + caching flow; adjusts install target setup and file copying.
packages/director/packaging Refactors gem build + caching flow; adjusts install target setup and file copying.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/health_monitor/packaging Outdated
Comment thread packages/nats/packaging Outdated
Comment thread packages/director/packaging Outdated
@aramprice aramprice moved this from Pending Merge | Prioritized to Pending Review | Discussion in Foundational Infrastructure Working Group Jul 16, 2026
@aramprice
aramprice force-pushed the cleanup-packaging-scripts branch from c2e482c to dee39a1 Compare July 16, 2026 19:35
This file is created by the `bosh_bundle_local` function used to
install gems during packaging, but because the function is not executed
while in `$BOSH_INSTALL_TARGET` the `.bundle/` directory is not present
in the package.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/director/packaging`:
- Around line 11-14: Update the gem build loops in packages/director/packaging
(lines 11-14), packages/health_monitor/packaging (lines 8-11), and
packages/nats/packaging (lines 12-15) to run gem build from each gemspec’s
directory before moving the generated artifact into vendor/cache; preserve the
existing gemspec iteration and destination behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b1e98116-63d5-4da8-9eb7-d83d000a48f5

📥 Commits

Reviewing files that changed from the base of the PR and between c2e482c and 5165b78.

📒 Files selected for processing (3)
  • packages/director/packaging
  • packages/health_monitor/packaging
  • packages/nats/packaging

Comment thread packages/director/packaging
@github-project-automation github-project-automation Bot moved this from Pending Review | Discussion to Waiting for Changes | Open for Contribution in Foundational Infrastructure Working Group Jul 16, 2026
This appears to be a vestage from when Ruby shipped with a default json
gem that was > 2.0. This is no longer the case.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
packages/director/packaging (1)

11-14: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Incorrect gem build working directory context.

While updating the mv command to search in the current directory (./*.gem) resolves the immediate "file not found" error during the script run, gem build is still being executed from the parent directory (working_dir).

Gemspec files are designed to be evaluated from their own directory. Building from a parent directory causes relative path resolutions inside the gemspec (like Dir.glob("lib/**/*") or File.read("VERSION")) to evaluate against the parent directory context instead of the gem's source tree. This can silently produce a broken or completely empty .gem artifact.

Change into the gemspec's directory before executing the build to ensure the Ruby code inside the spec resolves paths accurately.

  • packages/director/packaging#L11-L14: run gem build from the gemspec's directory inside a subshell.
  • packages/health_monitor/packaging#L8-L11: run gem build from the gemspec's directory inside a subshell.
  • packages/nats/packaging#L12-L15: run gem build from the gemspec's directory inside a subshell.
🛠️ Proposed fix

Wrap the loop body in a subshell (...) so the directory context is cleanly isolated per iteration (which also safely works with set -e). Apply this pattern across all three packaging files:

 for gemspec in ./bosh-*/*.gemspec; do
-  gem build "${gemspec}"
-  mv ./*.gem "${working_dir}/vendor/cache/"
+  (
+    cd "$(dirname "${gemspec}")"
+    gem build "$(basename "${gemspec}")"
+    mv ./*.gem "${working_dir}/vendor/cache/"
+  )
 done
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/director/packaging` around lines 11 - 14, The packaging loops build
each gemspec from the parent directory, so relative paths resolve incorrectly.
In packages/director/packaging lines 11-14, packages/health_monitor/packaging
lines 8-11, and packages/nats/packaging lines 12-15, wrap each loop body in a
subshell, change into the gemspec’s directory before running gem build, and move
the resulting .gem artifact to the existing vendor/cache destination while
preserving isolated directory context per iteration.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@packages/director/packaging`:
- Around line 11-14: The packaging loops build each gemspec from the parent
directory, so relative paths resolve incorrectly. In packages/director/packaging
lines 11-14, packages/health_monitor/packaging lines 8-11, and
packages/nats/packaging lines 12-15, wrap each loop body in a subshell, change
into the gemspec’s directory before running gem build, and move the resulting
.gem artifact to the existing vendor/cache destination while preserving isolated
directory context per iteration.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: cdd07c16-b3dd-4ffe-a9e8-9838d3864786

📥 Commits

Reviewing files that changed from the base of the PR and between 5165b78 and 1e00b83.

📒 Files selected for processing (3)
  • packages/director/packaging
  • packages/health_monitor/packaging
  • packages/nats/packaging

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 16, 2026
@github-project-automation github-project-automation Bot moved this from Waiting for Changes | Open for Contribution to Pending Merge | Prioritized in Foundational Infrastructure Working Group Jul 16, 2026
@aramprice
aramprice requested a review from Copilot July 16, 2026 21:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread packages/nats/packaging
Comment thread packages/health_monitor/packaging
Comment thread packages/director/packaging

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread packages/nats/packaging
Comment thread packages/health_monitor/packaging
Comment thread packages/director/packaging

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/director/packaging`:
- Around line 10-16: Harden the gem-building loops in
packages/director/packaging lines 10-16, packages/health_monitor/packaging lines
7-13, and packages/nats/packaging lines 11-17: skip unmatched gemspec globs with
a file-existence guard, create vendor/cache before building, pass each gemspec
basename explicitly to gem build, and redirect pushd/popd output to /dev/null.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f88bf786-d5ff-4f3a-b55f-35e1e6641665

📥 Commits

Reviewing files that changed from the base of the PR and between 1e00b83 and 3664332.

📒 Files selected for processing (3)
  • packages/director/packaging
  • packages/health_monitor/packaging
  • packages/nats/packaging

Comment thread packages/director/packaging
@github-project-automation github-project-automation Bot moved this from Pending Merge | Prioritized to Waiting for Changes | Open for Contribution in Foundational Infrastructure Working Group Jul 16, 2026
@github-project-automation github-project-automation Bot moved this from Waiting for Changes | Open for Contribution to Pending Merge | Prioritized in Foundational Infrastructure Working Group Jul 16, 2026
@aramprice
aramprice merged commit faff727 into main Jul 16, 2026
23 checks passed
@aramprice
aramprice deleted the cleanup-packaging-scripts branch July 16, 2026 21:34
@github-project-automation github-project-automation Bot moved this from Pending Merge | Prioritized to Done in Foundational Infrastructure Working Group Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants