Skip to content

feat!: migrate mingw to custom resources#63

Open
damacus wants to merge 3 commits into
mainfrom
custom-resource-migration
Open

feat!: migrate mingw to custom resources#63
damacus wants to merge 3 commits into
mainfrom
custom-resource-migration

Conversation

@damacus

@damacus damacus commented Apr 30, 2026

Copy link
Copy Markdown
Member

Summary

  • Removes mingw::default recipe and node['msys2'] attributes; the cookbook now ships custom resources only.
  • Adds source_url / checksum properties to msys2_package and mingw_get to replace the dropped node attributes.
  • Modernizes all three resources (mingw_get, msys2_package, mingw_tdm_gcc) with provides, frozen_string_literal, unified_mode true, missing :remove action on mingw_tdm_gcc, and Mingw::Helpers included via action_class.
  • Replaces seven_zip_archive with built-in remote_file + archive_file (drops the seven_zip cookbook dependency).
  • Bumps chef_version floor to >= 16.0.
  • Consolidates Kitchen for Windows-only: deletes kitchen.dokken.yml and kitchen.global.yml; rewrites kitchen.yml for Vagrant on Windows Server 2019/2022 and kitchen.exec.yml for CI on windows-latest (Server 2022).
  • Replaces serverspec dirs with full InSpec profiles under test/integration/<suite>/{inspec.yml,controls/} and replaces fixture cookbooks with test/cookbooks/test/recipes/<suite>.rb.
  • Pins all sous-chefs reusable workflows to @6.0.0, swaps actionshub/chef-install for sous-chefs/.github/.github/actions/install-workstation@6.0.0, and adds slack_bot_token / slack_channel_id secrets to release.yml.
  • Aligns CI matrix instance regex to the dashed Kitchen-normalized name (msys2-tools64).

Breaking changes

  • mingw::default recipe removed.
  • node['msys2']['url'] and node['msys2']['checksum'] removed; use msys2_package's source_url and checksum properties.
  • seven_zip cookbook is no longer a dependency.
  • chef_version minimum is now >= 16.0.

See migration.md for upgrade examples.

Verification done in-session

  • cookstyle — 21 files inspected, 0 offenses.
  • chef exec rspec --format documentation24 examples, 0 failures. Every resource has step_into coverage; helpers have unit tests.
  • KITCHEN_LOCAL_YAML=kitchen.exec.yml kitchen list — all 4 instances visible (default-windows-2022, tools32-windows-2022, tools64-windows-2022, msys2-tools64-windows-2022).
  • Final structural audit (ls -R) confirms recipes/, attributes/, files/, libraries/_helper.rb, test/fixtures/, and test/integration/*/serverspec/ are all gone.

Verification deferred to CI

This is a Windows-only cookbook and the local dev host is macOS, so kitchen test cannot run from the dev session. CI on windows-latest (using KITCHEN_LOCAL_YAML=kitchen.exec.yml) is the integration verifier — that's the gate this PR needs to clear before merge.

Test plan

  • lint-unit workflow passes (cookstyle + ChefSpec on the org runner)
  • integration matrix passes for all 4 suites on windows-latest:
    • default (smoke MSYS2 base + base-devel)
    • tools32 (legacy 32-bit TDM-GCC + mingw_get packages)
    • tools64 (legacy 64-bit TDM-GCC + mingw_get packages)
    • msys2-tools64 (MSYS2 64-bit MinGW toolchain)
  • prevent-file-change passes
  • On merge, release-please opens a release PR bumping mingw to 5.0.0 (driven by feat!: / BREAKING CHANGE)

damacus added 2 commits April 30, 2026 13:31
Migrates the cookbook to a custom-resource-only API. Removes the
`mingw::default` recipe and `node['msys2']` attributes; their behavior
moves to `source_url` / `checksum` properties on `msys2_package` and
`mingw_get`. Replaces `seven_zip_archive` with built-in `remote_file` +
`archive_file` (drops `seven_zip` dependency). Adds `:remove` action to
`mingw_tdm_gcc` and aligns all three resources on `unified_mode true`,
`provides`, `frozen_string_literal`, and modern `Mingw::Helpers` via
`action_class`.

CI pinned to sous-chefs reusable workflows @6.0.0; uses
install-workstation@6.0.0; release.yml passes Slack secrets. Kitchen
files consolidated to Windows-only (kitchen.yml for Vagrant, kitchen.exec.yml
for `windows-latest` CI). Old serverspec dirs and fixture cookbooks
removed in favor of InSpec profiles (`test/integration/<suite>/inspec.yml`
+ `controls/`) and the new `test::*` test cookbook recipes.

Bumps `chef_version` floor to `>= 16.0`.

BREAKING CHANGE: `mingw::default` recipe and `node['msys2']` attributes
are gone. See `migration.md` for the upgrade path.
@damacus damacus force-pushed the custom-resource-migration branch from 63ebeb9 to be5df4c Compare April 30, 2026 12:33
@github-actions

Copy link
Copy Markdown

Slowest examples

Top 10 slowest examples (0.25 seconds, 51.86% of total time)
Example Description Time in seconds
spec/unit/resources/get_spec.rb:16 mingw_get installing a package is expected to create directory "C:\mingw32.cache" 0.02981
spec/unit/resources/msys2_package_spec.rb:18 msys2_package installing a package with defaults is expected to extract archive_file "extract msys2 base archive to C:\msys2.cache" 0.02833
spec/unit/resources/msys2_package_spec.rb:24 msys2_package installing a package with defaults is expected to run execute "installing base-devel" 0.02695
spec/unit/resources/msys2_package_spec.rb:41 msys2_package installing with a custom base archive is expected to create remote_file "cache msys2 base to C:\msys2.cache" 0.02603
spec/unit/resources/tdm_gcc_spec.rb:30 mingw_tdm_gcc installing 32-bit TDM-GCC is expected to install mingw_get "install binutils-bin=2.25.1 at C:\mingw32" 0.02588
spec/unit/resources/get_spec.rb:17 mingw_get installing a package is expected to create remote_file "cache mingw-get to C:\mingw32.cache" 0.02554
spec/unit/resources/tdm_gcc_spec.rb:19 mingw_tdm_gcc installing 64-bit TDM-GCC is expected to extract archive_file "extract gcc-5.1.0-tdm64-1-core.tar to C:\mingw64" 0.02489
spec/unit/resources/msys2_package_spec.rb:19 msys2_package installing a package with defaults is expected to create directory "C:\msys2\bin" 0.02426
spec/unit/resources/msys2_package_spec.rb:16 msys2_package installing a package with defaults is expected to create directory "C:\msys2.cache" 0.02401
spec/unit/resources/msys2_package_spec.rb:22 msys2_package installing a package with defaults is expected to create template "C:\msys2\etc\profile.d\custom_prefix.sh" 0.02381

@damacus damacus marked this pull request as ready for review April 30, 2026 13:16
@damacus damacus requested a review from a team as a code owner April 30, 2026 13:16
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