Skip to content

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

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

fix: stop tracking Policyfile.lock.json#614
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 haproxy to an exact version (12.4.13), while release-please only bumps metadata.rb (currently 12.4.14). 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 'haproxy' = 12.4.13 {: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 'haproxy' = 12.4.13 {: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) <noreply@anthropic.com>
Signed-off-by: Lance Albertson <lance@osuosl.org>
@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.21 seconds, 46.21% of total time)
Example Description Time in seconds
spec/unit/recipes/mailer_spec.rb:48 haproxy_mailer create a mailer, frontend and backend and verify config is created properly is expected to render file "/etc/haproxy/haproxy.cfg" 0.17806
spec/unit/recipes/cache_spec.rb:45 haproxy_cache create a cache, frontend and backend and verify config is created properly is expected to render file "/etc/haproxy/haproxy.cfg" 0.14605
spec/unit/recipes/defaults_spec.rb:26 haproxy_config_defaults create a cache, frontend and backend and verify config is created properly is expected to render file "/etc/haproxy/haproxy.cfg" 0.14343
spec/unit/recipes/install_spec.rb:59 haproxy_install compile HAProxy on AlmaLinux 10 (uses PCRE2) is expected not to install package "pcre-devel" 0.13575
spec/unit/recipes/install_spec.rb:30 haproxy_install compile HAProxy on Ubuntu is expected to install package "["libpcre3-dev", "libssl-dev", "zlib1g-dev", "libsystemd-dev"]" 0.13222
spec/unit/recipes/listen_spec.rb:105 haproxy_listen extra options http-request rule should be placed before use_backend rule is expected to render file "/etc/haproxy/haproxy.cfg" 0.09709
spec/unit/recipes/listen_spec.rb:106 haproxy_listen extra options http-request rule should be placed before use_backend rule is expected not to render file "/etc/haproxy/haproxy.cfg" with content /use_backend admin0 if path_beg /admin0.*http-request add-header Test Value/m 0.09545
spec/unit/recipes/listen_spec.rb:61 haproxy_listen option parameter with array of options is expected to render file "/etc/haproxy/haproxy.cfg" 0.09499
spec/unit/recipes/peer_spec.rb:45 haproxy_peer create a peers section, frontend and backend and verify config is created properly is expected to render file "/etc/haproxy/haproxy.cfg" 0.09433
spec/unit/recipes/listen_spec.rb:39 haproxy_listen create template with a listen resource is expected to render file "/etc/haproxy/haproxy.cfg" 0.09392

@ramereth

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate of #613, which does the same Policyfile.lock.json untracking plus .gitignore, and additionally updates the test node fixtures. Ours was the strict subset — #613 is the better change.

For context on why this matters beyond haproxy: the tracked lock pins the cookbook version while release-please only bumps metadata.rb, so every release PR diverges the two and ChefSpec's policyfile install aborts the whole RSpec suite. Same fix landed in sous-chefs/logrotate#226, sous-chefs/dnsmasq#128 and sous-chefs/yum-fedora#45; mariadb, ruby_build and varnish still have theirs open.

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