chef / cookstyle

A linting tool that helps you to write better Chef Infra cookbooks and InSpec profiles by detecting and automatically correcting style, syntax, and logic mistakes in your code.
Apache License 2.0
107 stars 54 forks source link

Chef/Deprecations/Delivery triggers without dot-delivery directory existing #942

Closed lordkage closed 2 years ago

lordkage commented 2 years ago

Version:

Cookstyle 7.31.1
  * RuboCop 1.25.0

Environment:

OS: Mac OS 10.15 Chef Workstation version: 22.1.778

Scenario:

Just upgraded Chef Workstation, removing delivery to get green tests, still getting warning I am using it.

Steps to Reproduce:

  1. Remove the .delivery directory
  2. Commit the removal
  3. Run chef exec cookstyle
  4. Cop throws warning about using delivery
  5. All linked testing stops

Expected Result:

No warning because the .delivery directory is gone. Linked testing to continue.

Actual Result:

>ls -l .delivery
ls: .delivery: No such file or directory
>chef exec cookstyle
Inspecting 53 files
...............W.....................................

Offenses:

metadata.rb:1:1: W: Chef/Deprecations/Delivery: Do not include a .delivery directory for the delivery command in your cookbooks. Chef Delivery (Workflow) went EOL Dec 31st 2021 and the delivery command was removed from Chef Workstation Feb 2022. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_delivery)
name 'omitted'
^

53 files inspected, 1 offense detected
lordkage commented 2 years ago

Well, that was fun. I kept digging and debugging, and I found I needed to nuke my cache directory. This isn't a real solution, but I thought I should note it incase others got stuck like I did.

fernandoaleman commented 2 years ago

Well, that was fun. I kept digging and debugging, and I found I needed to nuke my cache directory. This isn't a real solution, but I thought I should note it incase others got stuck like I did.

@lordkage Which cache directory did you nuke? I removed the one listed in my chef config syntax_check_cache_path but still getting the error.

tward800 commented 2 years ago

I think this is the cache. ~/.cache/rubocop_cache/*

fernandoaleman commented 2 years ago

I think this is the cache. ~/.cache/rubocop_cache/*

That was it. Thanks for pointing that out @tward800 👍

karmix commented 2 years ago

We started running into this problem when we updated Chef Workstation in our pipeline, yesterday. #951 will fix the issue so long as nobody objects to the monkey patch that works around a deficiency in RuboCop's rspec helper. A workaround while waiting for GA is to use the --cache false option with cookstyle.