Skip to content

Fix do_after cleanup path for Appbundler gem layout in Linux Habitat plan#171

Merged
nikhil2611 merged 1 commit into
mainfrom
nikhil/security-scan-fixes
Jun 8, 2026
Merged

Fix do_after cleanup path for Appbundler gem layout in Linux Habitat plan#171
nikhil2611 merged 1 commit into
mainfrom
nikhil/security-scan-fixes

Conversation

@nikhil2611

Copy link
Copy Markdown
Contributor

Summary

Fixes the do_after() cleanup step in habitat/plan.sh so that .github directories shipped inside vendored gem sources are properly removed from the final Habitat package.

Background

After the Appbundler migration (#168), Bundler installs gems into vendor/ruby/$VERSION/gems/ rather than the old flat vendor/gems/ path. The existing do_after() function searched the old path ($pkg_prefix/vendor/gems) which no longer exists, so the cleanup was silently a no-op and gem-shipped workflow files remained in the package.

Changes Made

  • Updated find path in do_after() from $pkg_prefix/vendor/gems to $pkg_prefix/vendor to match the Appbundler-era directory layout
  • Switched to -exec rm -rf {} + for safer and more efficient deletion

Files Modified

  • habitat/plan.sh — corrected cleanup path in do_after()

Testing

  • Built the Habitat package and confirmed no gem-shipped workflow files are present under $pkg_prefix/vendor in the artifact
  • Verified the Windows plan (habitat/plan.ps1) already uses the correct path and was not affected

@nikhil2611 nikhil2611 requested review from a team and jaymzh as code owners June 8, 2026 10:48
@nikhil2611 nikhil2611 added the ai-assisted Work completed with AI assistance following Progress AI policies label Jun 8, 2026
After the Appbundler migration, bundler installs gems under
vendor/ruby/$VERSION/gems/ instead of vendor/gems/. The existing
do_after() search path was stale and never matched any directories,
leaving workflow files from gem sources in the final package.

Update the find path to search the full vendor/ tree so all
gem-shipped .github directories are removed before packaging.

Signed-off-by: nikhil2611 <ngupta@progress.com>
@nikhil2611 nikhil2611 force-pushed the nikhil/security-scan-fixes branch from 99d843d to 57030bd Compare June 8, 2026 10:56
@nikhil2611 nikhil2611 merged commit 6b6cf42 into main Jun 8, 2026
47 checks passed
@nikhil2611 nikhil2611 deleted the nikhil/security-scan-fixes branch June 8, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Work completed with AI assistance following Progress AI policies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants