Skip to content

feat!: migrate git to custom resources#210

Merged
damacus merged 1 commit into
mainfrom
feat/git-custom-resource-migration
May 7, 2026
Merged

feat!: migrate git to custom resources#210
damacus merged 1 commit into
mainfrom
feat/git-custom-resource-migration

Conversation

@damacus
Copy link
Copy Markdown
Member

@damacus damacus commented May 7, 2026

Summary

  • migrate git from recipe/attribute API to custom resources
  • add primary git_client resource and modernize git_config
  • add LIMITATIONS, migration, and resource documentation
  • update sous-chefs workflow baseline and tests

Verification

  • berks install
  • chef exec ruby -c resources/*.rb
  • cookstyle
  • chef exec rspec --format documentation
  • KITCHEN_LOCAL_YAML=kitchen.dokken.yml kitchen test default-ubuntu-2404 --destroy=always
  • final structural audit confirmed cookbook-root recipes/ and attributes/ are absent

@damacus damacus requested a review from a team as a code owner May 7, 2026 11:06
@damacus damacus force-pushed the feat/git-custom-resource-migration branch 9 times, most recently from 9cc6141 to 54e2f5a Compare May 7, 2026 12:59
@damacus damacus force-pushed the feat/git-custom-resource-migration branch from 54e2f5a to 3449594 Compare May 7, 2026 13:23
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Slowest examples

Top 10 slowest examples (0.69 seconds, 92.46% of total time)
Example Description Time in seconds
spec/unit/resources/client_spec.rb:52 git_client on windows is expected to install windows_package "Git version 2.54.0" 0.13051
spec/unit/resources/client_spec.rb:15 git_client on ubuntu is expected to install package "default :install git" 0.07975
spec/unit/resources/client_spec.rb:29 git_client from source on ubuntu is expected to install package "["libcurl4-gnutls-dev", "libexpat1-dev", "gettext", "libz-dev", "libssl-dev"]" 0.06805
spec/unit/resources/config_spec.rb:34 git_config unset a system value is expected to run execute "git config --system --unset-all user.name" 0.06539
spec/unit/resources/client_spec.rb:30 git_client from source on ubuntu is expected to install_with_make ark "git" 0.06426
spec/unit/resources/client_spec.rb:65 git_client remove on ubuntu is expected to remove package "default :remove git" 0.06119
spec/unit/resources/config_spec.rb:51 git_config set a file-scoped value with a home-relative config path is expected to run execute "git config --file "/root/.gitconfig.key" user.signingkey "FA2D8E280A6DD5"" 0.05928
spec/unit/resources/client_spec.rb:28 git_client from source on ubuntu is expected to install build_essential "install compilation tools for git" 0.05594
spec/unit/resources/config_spec.rb:23 git_config set a global value is expected to run execute "git config --global user.name "Jane Doe"" 0.0558
spec/unit/resources/client_spec.rb:40 git_client on macos is expected to install package "default :install git" 0.05404

@damacus damacus merged commit 196a4cd into main May 7, 2026
48 of 49 checks passed
@damacus damacus deleted the feat/git-custom-resource-migration branch May 7, 2026 13:53
johnmccrae added a commit to chef/chef that referenced this pull request May 12, 2026
git cookbook v13.0.0 (released 2026-05-07) is a breaking change that
removed the default recipe in favour of custom resources (sous-chefs/git#210).
Policyfile was resolving the latest version, causing:
  Chef::Exceptions::RecipeNotFound: could not find recipe default for cookbook git

Replace include_recipe 'git' with the new custom resource call git_client 'default'.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: John McCrae <john.mccrae@progress.com>
johnmccrae added a commit to chef/chef that referenced this pull request May 13, 2026
git cookbook v13.0.0 (released 2026-05-07) is a breaking change that
removed the default recipe in favour of custom resources (sous-chefs/git#210).
Policyfile was resolving the latest version, causing:
  Chef::Exceptions::RecipeNotFound: could not find recipe default for cookbook git

Replace include_recipe 'git' with the new custom resource call git_client 'default'.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: John McCrae <john.mccrae@progress.com>
johnmccrae added a commit to chef/chef that referenced this pull request May 15, 2026
git cookbook v13.0.0 removed the default recipe in favour of custom
resources (sous-chefs/git#210). Replace include_recipe 'git' with
git_client 'default' in the macOS recipe, matching the fix already
applied to the Linux recipe.

Signed-off-by: John McCrae <john.mccrae@progress.com>
johnmccrae added a commit to chef/chef that referenced this pull request May 15, 2026
* fix(kitchen-tests): fix nscd exclusion for AL2023 and git workaround on Windows

- Add Amazon Linux 2023 to the nscd exclusion guard in linux.rb.
  AL2023 uses platform_family 'amazon' (not 'rhel'), so the existing
  RHEL >= 10 guard did not apply, causing nscd install failures since
  the package is not available on AL2023.
  Also removed the redundant platform?(almalinux/rocky/oracle) sub-condition
  as platform_family?('rhel') already covers those platforms.

- Replace the fragile path-based git uninstall workaround and
  include_recipe 'git' in windows.rb with chocolatey_package 'git'
  (action :upgrade). The previous FIXME band-aid hard-coded install
  paths that do not cover Windows 2025 runners and caused version
  conflicts. Using chocolatey_package is idempotent, installs the
  latest available git version, and avoids the downgrade issue.

- Update metadata.rb supports to include all platforms actually tested
  in CI: almalinux, rocky, oracle, windows, freebsd, mac_os_x.

Signed-off-by: John McCrae <john.mccrae@progress.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: John McCrae <john.mccrae@progress.com>

* fix(kitchen-tests): migrate to nscd v7 custom resource API

nscd cookbook v7.0.0 (released 2026-05-06) is a breaking change that
removed the default recipe in favour of custom resources (sous-chefs/nscd#61).
Policyfile was resolving the latest version, causing:
  Chef::Exceptions::RecipeNotFound: could not find recipe default for cookbook nscd

Replace include_recipe 'nscd' with the new custom resource call and
restore the depends 'nscd' entry in metadata.rb that was accidentally
dropped in a prior commit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: John McCrae <john.mccrae@progress.com>

* fix(kitchen-tests): migrate to git v13 custom resource API

git cookbook v13.0.0 (released 2026-05-07) is a breaking change that
removed the default recipe in favour of custom resources (sous-chefs/git#210).
Policyfile was resolving the latest version, causing:
  Chef::Exceptions::RecipeNotFound: could not find recipe default for cookbook git

Replace include_recipe 'git' with the new custom resource call git_client 'default'.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: John McCrae <john.mccrae@progress.com>

* fix(kitchen-tests): migrate macos recipe to git v13 custom resource API

git cookbook v13.0.0 removed the default recipe in favour of custom
resources (sous-chefs/git#210). Replace include_recipe 'git' with
git_client 'default' in the macOS recipe, matching the fix already
applied to the Linux recipe.

Signed-off-by: John McCrae <john.mccrae@progress.com>

* Correctiung a lint problem

Signed-off-by: John McCrae <john.mccrae@progress.com>

* fix(kitchen-tests): exclude openSUSE from nscd resource

nscd service fails to start on openSUSE Leap 15 in Dokken containers
with 'Job for nscd.service failed because the control process exited
with error code'. Add platform_family?('suse') to the exclusion guard
alongside the existing fedora, AL2023, and RHEL 10+ exclusions.

Signed-off-by: John McCrae <john.mccrae@progress.com>

---------

Signed-off-by: John McCrae <john.mccrae@progress.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
cinc-bot pushed a commit to cinc-project/chef that referenced this pull request May 17, 2026
* fix(kitchen-tests): fix nscd exclusion for AL2023 and git workaround on Windows

- Add Amazon Linux 2023 to the nscd exclusion guard in linux.rb.
  AL2023 uses platform_family 'amazon' (not 'rhel'), so the existing
  RHEL >= 10 guard did not apply, causing nscd install failures since
  the package is not available on AL2023.
  Also removed the redundant platform?(almalinux/rocky/oracle) sub-condition
  as platform_family?('rhel') already covers those platforms.

- Replace the fragile path-based git uninstall workaround and
  include_recipe 'git' in windows.rb with chocolatey_package 'git'
  (action :upgrade). The previous FIXME band-aid hard-coded install
  paths that do not cover Windows 2025 runners and caused version
  conflicts. Using chocolatey_package is idempotent, installs the
  latest available git version, and avoids the downgrade issue.

- Update metadata.rb supports to include all platforms actually tested
  in CI: almalinux, rocky, oracle, windows, freebsd, mac_os_x.

Signed-off-by: John McCrae <john.mccrae@progress.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: John McCrae <john.mccrae@progress.com>

* fix(kitchen-tests): migrate to nscd v7 custom resource API

nscd cookbook v7.0.0 (released 2026-05-06) is a breaking change that
removed the default recipe in favour of custom resources (sous-chefs/nscd#61).
Policyfile was resolving the latest version, causing:
  Chef::Exceptions::RecipeNotFound: could not find recipe default for cookbook nscd

Replace include_recipe 'nscd' with the new custom resource call and
restore the depends 'nscd' entry in metadata.rb that was accidentally
dropped in a prior commit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: John McCrae <john.mccrae@progress.com>

* fix(kitchen-tests): migrate to git v13 custom resource API

git cookbook v13.0.0 (released 2026-05-07) is a breaking change that
removed the default recipe in favour of custom resources (sous-chefs/git#210).
Policyfile was resolving the latest version, causing:
  Chef::Exceptions::RecipeNotFound: could not find recipe default for cookbook git

Replace include_recipe 'git' with the new custom resource call git_client 'default'.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: John McCrae <john.mccrae@progress.com>

* fix(kitchen-tests): migrate macos recipe to git v13 custom resource API

git cookbook v13.0.0 removed the default recipe in favour of custom
resources (sous-chefs/git#210). Replace include_recipe 'git' with
git_client 'default' in the macOS recipe, matching the fix already
applied to the Linux recipe.

Signed-off-by: John McCrae <john.mccrae@progress.com>

* Correctiung a lint problem

Signed-off-by: John McCrae <john.mccrae@progress.com>

* fix(kitchen-tests): exclude openSUSE from nscd resource

nscd service fails to start on openSUSE Leap 15 in Dokken containers
with 'Job for nscd.service failed because the control process exited
with error code'. Add platform_family?('suse') to the exclusion guard
alongside the existing fedora, AL2023, and RHEL 10+ exclusions.

Signed-off-by: John McCrae <john.mccrae@progress.com>

---------

Signed-off-by: John McCrae <john.mccrae@progress.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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