Skip to content

fix: stop tracking Policyfile.lock.json - #320

Closed
ramereth wants to merge 1 commit into
mainfrom
fix/untrack-policyfile-lock
Closed

fix: stop tracking Policyfile.lock.json#320
ramereth wants to merge 1 commit into
mainfrom
fix/untrack-policyfile-lock

Conversation

@ramereth

Copy link
Copy Markdown
Contributor

Problem

Policyfile.lock.json is tracked and pins nodejs to an exact version (11.0.0), while release-please only bumps metadata.rb (currently 11.0.1). Whenever the two disagree, ChefSpec's policyfile install aborts the entire RSpec suite before a single example runs:

CookbookOmnifetch::CookbookValidationFailure:
  The cookbook downloaded for Cookbook 'nodejs' = 11.0.0 {:path=>"."}
  did not satisfy the constraint.

Fix

Untrack the lock. It is a generated artifact — chefignore already excludes it from the published cookbook, and 171 of 179 sous-chefs repos do not track it.

Bumping the version inside the lock is not a viable alternative: it also carries identifier and dotted_decimal_identifier fields derived from cookbook content.

Same fix as sous-chefs/logrotate#226.

The lock pins the cookbook to an exact version, but release-please only
bumps metadata.rb. When the two disagree, ChefSpec's policyfile install
aborts the whole RSpec suite before any example runs:

  CookbookOmnifetch::CookbookValidationFailure: The cookbook downloaded
  for Cookbook 'nodejs' = 11.0.0 {:path=>"."} did not satisfy the constraint.

The lock cannot simply be version-bumped either, since it also carries
content-derived identifier and dotted_decimal_identifier fields.

chefignore already excludes it from the published artifact, and 171 of 179
sous-chefs repos do not track it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Lance Albertson <[email protected]>
@ramereth
ramereth requested a review from a team as a code owner August 16, 2026 03:44
@github-actions

Copy link
Copy Markdown

Slowest examples

Top 10 slowest examples (1.05 seconds, 39.09% of total time)
Example Description Time in seconds
spec/unit/library/helper_spec.rb:18 helper methods npm_dist should return a url based on the version 0.29788
spec/unit/resources/nodejs_repository_spec.rb:16 nodejs_repository on ubuntu is expected to create directory "/etc/apt/keyrings" 0.14284
spec/unit/resources/nodejs_install_spec.rb:16 nodejs_install package install on ubuntu is expected to install package "nodejs" 0.12711
spec/unit/resources/nodejs_install_spec.rb:15 nodejs_install package install on ubuntu is expected to create nodejs_repository "nodesource" 0.09518
spec/unit/resources/npm_package_spec.rb:25 npm_package install a versioned package is expected to run execute "install NPM package async" 0.06699
spec/unit/resources/nodejs_install_spec.rb:33 nodejs_install package install on rocky linux is expected to disable dnf_module "nodejs" 0.06662
spec/unit/resources/nodejs_install_spec.rb:88 nodejs_install source install is expected to install package "python3" 0.06523
spec/unit/resources/nodejs_install_spec.rb:113 nodejs_install source install on rocky linux is expected to run execute "install python3 build package" 0.06498
spec/unit/resources/nodejs_repository_spec.rb:18 nodejs_repository on ubuntu is expected to add apt_preference "nodesource" 0.06471
spec/unit/resources/nodejs_repository_spec.rb:17 nodejs_repository on ubuntu is expected to create remote_file "/etc/apt/keyrings/nodesource.asc" 0.06466

@ramereth

Copy link
Copy Markdown
Contributor Author

Closing in favor of #319

@ramereth ramereth closed this Aug 16, 2026
@ramereth
ramereth deleted the fix/untrack-policyfile-lock branch August 16, 2026 04:38
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