GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - One-com/chef_diff: Chef context aware Git repo diff tool

BranchesTags
Open more actions menu

Latest commit

 

History

41 Commits
41 Commits

Folders and files

NameName
Last commit message
Last commit date
bin
bin
 
 
lib/chef_diff
lib/chef_diff
 
 
spec
spec
 
 
.gitignore
.gitignore
 
 
.rubocop.yml
.rubocop.yml
 
 
Gemfile
Gemfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
Rakefile
Rakefile
 
 
chef_diff.gemspec
chef_diff.gemspec
 
 

Repository files navigation

Chef Diff

Intro

Chef Diff is a library for calculating what Chef objects were modified between two revisions in Chef Git repo. Chef Diff is a derivative/extension of Between Meals.

Chef Diff calculates changes for nodes, clients, users, environments, databags, roles, environment-specific roles and cookbooks between revisions in a Chef repo.

Chef Diff allows subdirs in nodes, clients and environments to enable the Chef repo layout to match a clustered multi Chef server infrastructure.

Environment-specific roles (roles_local)

In addition to the standard roles/ directory, Chef Diff supports a second roles directory for environment-specific role overrides. By convention this directory is called roles_local/, and subdirectories within it are part of the role name — for example roles_local/cluster/web.json is reported as the role cluster/web.

This is useful when running a multi-environment or multi-cluster Chef setup where some roles differ per environment but you do not want to pollute the shared roles/ tree.

When using Chef Diff as a library, pass role_local_dir to Changeset.new:

changeset = ChefDiff::Changeset.new(
  logger, repo, start_ref, end_ref,
  role_dir:       'roles',
  role_local_dir: 'roles_local',   # default used by chef-diff binary
  # … other dirs …
)
changeset.roles_local  # => array of ChefDiff::Changes::RoleLocal objects

The chef-diff binary uses roles_local as the default directory name and reports changes under the heading Roles_local changed:.

Usage

Cheff Diff is mainly intended to be used as a gem by other tools but provides a commandline inspection tool:

$ chef-diff
Usage: chef-diff [options] <repo_path>
    -v, --verbose                    Run verbosely
    -s, --start_ref REF              Git start reference
    -e, --end_ref REF                Git end reference (default HEAD)

The logger passed to Changeset.new must be ::Logger-compatible: info and debug are called with a block that builds the message, so the string is only made when that level is on. A logger whose info(msg) ignores blocks logs nil instead.

SVN support

Chef Diff includes an SVN backend (ChefDiff::Repo::Svn) inherited from Between Meals. It is experimental — its specs run against stubbed svn commands only, and it has not been validated against a real SVN repository. Use at your own risk.

Dependencies

  • JSON
  • Mixlib::ShellOut

Testing

docker run --rm -v "$(pwd)":/app -w /app ruby:3.3 \
  sh -c "bundle install && bundle exec rake"

About

Chef context aware Git repo diff tool

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

1 star

Watchers

13 watching

Forks

4 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.