Add internal CI: task unit tests and Bolt plan smoke test - #57
Merged
Conversation
- rspec suite (no bundle needed) exercising Bolt tasks as standalone scripts: git_commit, configure_renovate, plus sanity checks over all task metadata, Hiera data files, and the latest.yaml symlinks - GHA workflow with two jobs: rspec on Ruby 3.2 (matching openbolt's bundled Ruby), and an openbolt job that runs the documented `./Rakefile install`, validates Puppet syntax, and smoke-tests plan loading via `bolt plan show` and list_pipeline_stages The workflow is deliberately named ci.yml and written as an internal file, distinct from the puppetsync-managed pr_tests.yml baseline that downstream repos receive. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
hcaballero2
approved these changes
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #54
Adds CI for puppetsync itself, written for what this repo actually is (a Bolt project), not derived from the downstream pupmod baseline.
What's in it
spec/— plain rspec, no bundle needed (rspecfrom the repo root):spec/tasks/git_commit_spec.rb— runs the task as a standalone script against throwaway git repos: commits pending changes, amends when the (multi-line) message matches, exits cleanly on a no-change repo, fails on missing params. This pins down current behavior ahead of the Full idempotency: repos that need no changes must pass through cleanly #49 idempotency work.spec/tasks/configure_renovate_spec.rb— preset injection,extendspreservation, Gemfile rewriting with the renovate manager comment, JSON5 rejection, and a full idempotency check (two runs produce identical output).spec/project_files_spec.rb—ruby -cover every task script, JSON validity of every task metadata file, YAML validity of every file underdata/plusbolt-project.yaml/hiera.yaml/inventory.yaml, and a check that thelatest.yamlsymlinks resolve..github/workflows/ci.yml— two jobs:spec: rspec on Ruby 3.2 (matching openbolt's bundled Ruby).bolt: installs openbolt from the Vox Pupuliopenvox8apt repo (matching the OpenVox migration direction), runs the documented./Rakefile installpath (sogem.deps.rb/module breakage is caught), validates Puppet syntax (--tasksmode for plans, normal mode for classes/functions), then smoke-testsbolt plan show puppetsyncand alist_pipeline_stagesdry run with dummy tokens.All of it verified locally before pushing: 139 examples / 0 failures, both parser-validate invocations clean, both bolt smoke tests green, and
./Rakefile installworks end-to-end against openbolt 5.6.0.Relationship to #24
Per the discussion about splitting #24 into puppetsync-internal files vs. puppetsync-managed files: this workflow is deliberately named
ci.ymland carries no "managed by puppetsync" header, so it stays clearly on the internal side. #24 can drop its template-derivedpr_tests.ymland keep the rubocop/lint cleanup; once #24's.rubocop.ymllands, a rubocop job can be added to this workflow as a follow-up (kept out of this PR to avoid entangling the two).Notes / out of scope
dist/puppetsync/spec/functions/parse_puppetfile_spec.rbtests a function that no longer exists (puppetsync::parse_puppetfile) and needs the full rspec-puppet stack; it's untouched here and worth removing or reviving separately.git_commit.rb(never fires for single-line messages becausegit log -1 --pretty=%Bkeeps a trailing newline) is documented by the new specs' use of multi-line messages; fixing it belongs with Full idempotency: repos that need no changes must pass through cleanly #49.🤖 Generated with Claude Code