Skip to content

fix: harden gem source commands#94

Open
damacus wants to merge 1 commit into
mainfrom
fix/harden-gem-source-shell-commands
Open

fix: harden gem source commands#94
damacus wants to merge 1 commit into
mainfrom
fix/harden-gem-source-shell-commands

Conversation

@damacus

@damacus damacus commented Jun 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Escape packagecloud gem source add/remove commands
  • Replace grep and xargs gem-source removal with Ruby-native URI matching
  • Update resource specs for the new Ruby block removal path

Verification

  • cookstyle resources/repo.rb spec/unit/resources/repo_spec.rb
  • /opt/chef-workstation/embedded/bin/rspec spec/unit/resources/repo_spec.rb --format progress

Replace gem-source grep/xargs pipelines with Ruby-native matching and escaped gem commands.\n\nVerification:\n- cookstyle resources/repo.rb spec/unit/resources/repo_spec.rb\n- /opt/chef-workstation/embedded/bin/rspec spec/unit/resources/repo_spec.rb --format progress
@damacus damacus requested a review from a team as a code owner June 8, 2026 14:56
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Slowest examples

Top 10 slowest examples (0.54 seconds, 67% of total time)
Example Description Time in seconds
spec/unit/resources/repo_spec.rb:42 packagecloud_repo on ubuntu with default properties is expected not to run execute "apt-key-add-test_repo" 0.06533
spec/unit/resources/repo_spec.rb:71 packagecloud_repo on almalinux with rpm defaults is expected to create template "/etc/yum.repos.d/test_repo.repo" 0.06398
spec/unit/resources/repo_spec.rb:38 packagecloud_repo on ubuntu with default properties is expected to install package "wget" 0.06097
spec/unit/resources/repo_spec.rb:104 packagecloud_repo with gem source with action :add is expected to run execute "install packagecloud test/repo repo as gem source" 0.05416
spec/unit/resources/repo_spec.rb:84 packagecloud_repo on almalinux with action :remove is expected to delete file "/etc/yum.repos.d/test_repo.repo" 0.05337
spec/unit/resources/repo_spec.rb:119 packagecloud_repo with gem source with action :remove is expected to run ruby_block "remove packagecloud test/repo repo as gem source" 0.04985
spec/unit/resources/repo_spec.rb:41 packagecloud_repo on ubuntu with default properties is expected to create template "/etc/apt/sources.list.d/test_repo.list" 0.04946
spec/unit/resources/repo_spec.rb:43 packagecloud_repo on ubuntu with default properties is expected not to run execute "apt-get-update-test_repo" 0.0484
spec/unit/resources/repo_spec.rb:40 packagecloud_repo on ubuntu with default properties is expected to install package "lsb-release" 0.04825
spec/unit/resources/repo_spec.rb:39 packagecloud_repo on ubuntu with default properties is expected to install package "apt-transport-https" 0.0476

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.

1 participant