Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The same version of a cookbook generates different identifier and dotted_decimal_identifier depending on Operating System #240

Open
onlyhavecans opened this issue Nov 20, 2024 · 1 comment
Labels
Status: Untriaged An issue that has yet to be triaged. Type: Bug Does not work as expected.

Comments

@onlyhavecans
Copy link
Contributor

onlyhavecans commented Nov 20, 2024

Version:

Chef Workstation version: 24.8.1068
Chef Infra Client version: 18.5.0
Chef InSpec version: 5.22.55
Chef CLI version: 5.6.14
Chef Habitat version: 1.6.1041
Test Kitchen version: 3.6.0
Cookstyle version: 7.32.8

Environment:

macOS & Ubuntu Linux

Scenario:

When a cookbook artifact has resource fork files (start with ._) the policies generated using these cookbooks differ based on the OS of the system generating them.

e.g. When a mac decompresses these files they are integrated into the filesystem, but when a Linux or Windows system decompresses them, they are left in the repo, and read for the sha

Steps to Reproduce:

  1. Create a policyfile that pulls https://supermarket.chef.io/cookbooks/dnsimple version 4.5.0
  2. chef install and chef update the on a Mac
  3. chef install and chef update on a Linux machine

Expected Result:

Expected the two policies to match exactly

Actual Result:

on a mac the policyfile.lock.json contains

    "dnsimple": {
      "version": "4.5.0",
      "identifier": "5ceaa29f4901161970750f5f71c83b5a239a4951",
      "dotted_decimal_identifier": "26153682035343638.7160522489164232.65258330409297",
      "cache_key": "dnsimple-4.5.0-supermarket.chef.io",
      "origin": "https://supermarket.chef.io:443/api/v1/cookbooks/dnsimple/versions/4.5.0/download",
      "source_options": {
        "artifactserver": "https://supermarket.chef.io:443/api/v1/cookbooks/dnsimple/versions/4.5.0/download",
        "version": "4.5.0"
      }
    },

on that system the cached cookbook looks like this

> cd ~/.chef-workstation/cache/cookbooks/dnsimple-4.5.0-supermarket.chef.io && find . | xargs shasum -a 1 | sort -k2
shasum: .: Is a directory
shasum: ./recipes: Is a directory
shasum: ./libraries: Is a directory
28ca784b82210f97d7bab4be123fc4ec86fd34f5  ./CHANGELOG.md
17d954e8a17b9105a9c48073ab19086e1dedf16b  ./chefignore
c387b3c83b36c75e2968ffa37a167c1791f5e8f6  ./.github_changelog_generator
ae43286ed356fb6e24080e2a80317bee4389f449  ./libraries/dnsimple_provider.rb
e426baa7640db42d51559242687c8beb60018cc7  ./libraries/dnsimple_resource.rb
263d74b08ca00e26e49bc7d15ee74dcc7b7f451b  ./libraries/provider_dnsimple_certificate.rb
3cb1637aa04bdf961caf2cc41c2e71da3ba2149a  ./libraries/provider_dnsimple_record.rb
a5e7b5de7d091fde3490edd0acaec679903f53be  ./libraries/resource_dnsimple_certificate.rb
26e25e0083e6f6a6f7b64cddf1ddd07c431b080f  ./libraries/resource_dnsimple_record.rb
43d5983e020268cd094339feb9314e9b5b47642c  ./LICENSE
3f796ca2ad89c094d80337c2d87f66794844eb36  ./.markdownlint.yaml
ee587623e295b67a8b8ac04e8e27478ddc1200e8  ./metadata.json
0d07e8fe99af3942803ebf9521e588fcfb26f70e  ./metadata.rb
cbe7595cff21e81c4fc49cdc6435728782c45c7e  ./README.md
12c89c2e34a598eec1af6c8ee10235e9873c8683  ./recipes/default.rb
605186cdff069ff9a4a1fb0a94a07b5e817947ab  ./RELEASE.md
e75aa4facce6a89a0fae5f1917a0699b3c94155e  ./.rubocop_todo.yml

on a linux system the policy contains

    "dnsimple": {
      "version": "4.5.0",
      "identifier": "f8be033c209aca01ecee072b339f18a58792def3",
      "dotted_decimal_identifier": "70014715327191754.541982043354015.27099223219955",
      "cache_key": "dnsimple-4.5.0-supermarket.chef.io",
      "origin": "https://supermarket.chef.io:443/api/v1/cookbooks/dnsimple/versions/4.5.0/download",
      "source_options": {
        "artifactserver": "https://supermarket.chef.io:443/api/v1/cookbooks/dnsimple/versions/4.5.0/download",
        "version": "4.5.0"
      }
    },

on linux the cached cookbook looks like this

> cd ~/.chef-workstation/cache/cookbooks/dnsimple-4.5.0-supermarket.chef.io && find . | xargs shasum -a 1 | sort -k2
shasum: .: Is a directory
shasum: ./recipes: Is a directory
shasum: ./libraries: Is a directory
28ca784b82210f97d7bab4be123fc4ec86fd34f5  ./CHANGELOG.md
038469698f62041b84f41c045e93264cdd94eeda  ./._chefignore
17d954e8a17b9105a9c48073ab19086e1dedf16b  ./chefignore
038469698f62041b84f41c045e93264cdd94eeda  ./._.github_changelog_generator
c387b3c83b36c75e2968ffa37a167c1791f5e8f6  ./.github_changelog_generator
ae43286ed356fb6e24080e2a80317bee4389f449  ./libraries/dnsimple_provider.rb
e426baa7640db42d51559242687c8beb60018cc7  ./libraries/dnsimple_resource.rb
263d74b08ca00e26e49bc7d15ee74dcc7b7f451b  ./libraries/provider_dnsimple_certificate.rb
3cb1637aa04bdf961caf2cc41c2e71da3ba2149a  ./libraries/provider_dnsimple_record.rb
a5e7b5de7d091fde3490edd0acaec679903f53be  ./libraries/resource_dnsimple_certificate.rb
26e25e0083e6f6a6f7b64cddf1ddd07c431b080f  ./libraries/resource_dnsimple_record.rb
038469698f62041b84f41c045e93264cdd94eeda  ./._LICENSE
43d5983e020268cd094339feb9314e9b5b47642c  ./LICENSE
3f796ca2ad89c094d80337c2d87f66794844eb36  ./.markdownlint.yaml
ee587623e295b67a8b8ac04e8e27478ddc1200e8  ./metadata.json
0d07e8fe99af3942803ebf9521e588fcfb26f70e  ./metadata.rb
cbe7595cff21e81c4fc49cdc6435728782c45c7e  ./README.md
12c89c2e34a598eec1af6c8ee10235e9873c8683  ./recipes/default.rb
605186cdff069ff9a4a1fb0a94a07b5e817947ab  ./RELEASE.md
e75aa4facce6a89a0fae5f1917a0699b3c94155e  ./.rubocop_todo.yml

the additional ._ files seem to be the cause

@onlyhavecans onlyhavecans added Status: Untriaged An issue that has yet to be triaged. Type: Bug Does not work as expected. labels Nov 20, 2024
@onlyhavecans
Copy link
Contributor Author

This may be related to #192
but the description is different enough I didn't want to take the ticket over

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Untriaged An issue that has yet to be triaged. Type: Bug Does not work as expected.
Projects
None yet
Development

No branches or pull requests

1 participant