Skip to content

feat(puppetcore): Add puppetcore gem source switch capability #282

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

Merged
merged 3 commits into from
Apr 1, 2025

Conversation

gavindidrichsen
Copy link
Contributor

@gavindidrichsen gavindidrichsen commented Mar 25, 2025

Overview

This PR introduces puppetcore gem source integration to the provision module. When PUPPET_FORGE_TOKEN environment variable is set, the module will use authenticated puppetcore gem sources; otherwise, it will default to public gem sources. This implementation follows the "switch" design pattern to ensure all modules work correctly regardless of whether puppetcore is used or not.

Changes

  • Gemfile: Implemented conditional logic to use puppetcore gem source when PUPPET_FORGE_TOKEN is set
  • ci.yml workflow: Updated to use Ruby 3.1+ which is required for puppetcore gems. This workflow "uses" the shared cat-github-actions workflow that was updated in this PR: Add PuppetCore gem source support to module_ci workflow cat-github-actions#129
  • metadata.json: Updated Puppet version requirement to 8.0.0+ to align with puppetcore
  • spec/integration/puppetcore_spec.rb: Added integration tests to verify correct gem sources are used

@gavindidrichsen gavindidrichsen requested a review from a team as a code owner March 25, 2025 14:35
jordanbreen28
jordanbreen28 previously approved these changes Mar 25, 2025
Puppetcore only works with ruby >= 3.x, so puppet must also be >= 8.  This is inline with other changes being rolled out across the repositories.

Signed-off-by: Gavin Didrichsen <[email protected]>
Add puppetcore switch to Gemfile.

This ensures that when the PUPPET_FORGE_TOKEN is set, then the puppetcore gems are used. If this variable is not set, the bundle install will still work as normal with the public puppet and facter gems. NOTE, however, that the corresponding tests will only pass if the puppetcore gems are present on CI and used.

Signed-off-by: Gavin Didrichsen <[email protected]>
One of the cat-github-actions re-usable workflows has been updated to switch on the puppetcore.  For reference see <puppetlabs/cat-github-actions#129>.  This means a minor admustment is required on any modules that also need to run against puppetcore.  One, `ruby_version` must be passed in and be >= 3.1; and two, the `PUPPET_FORGE_TOKEN` must be a secret on the repository.

Signed-off-by: Gavin Didrichsen <[email protected]>
@gavindidrichsen gavindidrichsen changed the title Add puppetcore validation workflow feat(puppetcore): Add puppetcore gem source switch capability Apr 1, 2025
@gavindidrichsen gavindidrichsen marked this pull request as ready for review April 1, 2025 10:59
@jordanbreen28 jordanbreen28 merged commit fdeded9 into main Apr 1, 2025
4 checks passed
@jordanbreen28 jordanbreen28 deleted the OSPTE-198 branch April 1, 2025 11:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants