Skip to content

Conversation

@nikhil2611
Copy link

Summary

This PR fixes broken Ruby builds in the main branch and adds support for generating Gemfile.lock at runtime for projects that don't commit their lockfiles.

Changes Made

1. Fixed Broken Ruby Build (ci-build job)

  • Added Ruby setup before Ruby build step (lines 735-739)
  • Removed --deployment flag when Gemfile.lock doesn't exist (line 748)

2. Added Runtime Gemfile.lock Generation (sbom.yml)

  • Added run-bundle-install parameter to ci-main-pull-request.yml (lines 343-347)
  • Modified sbom.yml to generate Gemfile.lock at runtime (lines 198-203)

Testing

✅ Tested on chef-cli repository
✅ BlackDuck scan: RUBYGEMS: SUCCESS
✅ Gemfile.lock successfully created at runtime

TODO Before Merging

  • Change sbom.yml reference from @nikhil/create-lock-file-runtime to @main at line 1289
  • Update chef-cli stub file with run-bundle-install: true

Signed-off-by: nikhil2611 <[email protected]>
- Add run-bundle-install parameter to enable bundle install before SBOM scan
- Products without committed Gemfile.lock can now generate it at runtime
- Add Ruby setup step in ci-build job for Ruby projects
- Pass run-bundle-install parameter through workflow chain
…step

- Change condition from language/build-profile to run-bundle-install parameter
- Remove --deployment and --path flags that require existing lockfile
- Remove bundle exec rake build - only need lockfile for SBOM scan
- Rename step to clarify purpose: Generate Gemfile.lock for SBOM scanning
- Added new input parameter run-bundle-install to support generating Gemfile.lock at runtime
- This enables BlackDuck SCA scanning for projects like chef-cli that don't commit lockfiles
- Parameter passed through to sbom.yml workflow for lockfile generation before scanning
…d error

- Install Ruby 3.4 using ruby/setup-ruby@v1 before running bundle commands
- Fixes broken Ruby build in ci-build job that has existed since main branch creation
- Enables build to complete successfully so SBOM job can run
- Works in conjunction with run-bundle-install parameter for runtime Gemfile.lock generation
- Remove --deployment flag from bundle install when no Gemfile.lock exists
- --deployment flag requires existing Gemfile.lock, causing exit code 16
- Fix typo: .gemlock -> Gemfile.lock in echo message
Signed-off-by: nikhil2611 <[email protected]>
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