Skip to content

Cleanup .fixtures.yml file in puppet modules #48

@bastelfreak

Description

@bastelfreak

Explanation

the .fixtures.yml file is used to list dependencies that we use in rspec-puppet tests. Some of the files use legacy elements that aren't required anymore. This needs to be cleaned up.

Implementation

A basic and good example:

---
fixtures:
  repositories:
    stdlib: https://github.com/puppetlabs/puppetlabs-stdlib

A bad example:

fixtures:
  repositories:
    ssh: "https://github.com/saz/puppet-ssh.git"
    stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
    concat: "https://github.com/puppetlabs/puppetlabs-concat.git"
    sshkeys_core:
      repo: https://github.com/puppetlabs/puppetlabs-sshkeys_core.git
      puppet_version: ">= 6.0.0"
  symlinks:
    bacula: "#{source_dir}"

Things that should be fixed:

  • Ensure the --- in the first line
  • We don't need to list the repo key for a dependency
  • Some modules have a puppet_version constraint for puppet 6 and newer. We only test on openvox 7 and 8, the constraint has to be removed
  • The symlinks key isn't required if it just adds a symlink to the module itself.
  • modules aren't sorted alphabetically

Cleaned up example:

---
fixtures:
  repositories:
    concat: 'https://github.com/puppetlabs/puppetlabs-concat.git'
    ssh: 'https://github.com/saz/puppet-ssh.git'
    sshkeys_core: 'https://github.com/puppetlabs/puppetlabs-sshkeys_core.git'
    stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'

The goal is to implement a script that will rewrite the fixtures.yml (similar to https://github.com/voxpupuli/modulesync_config/blob/master/bin/add_openvox_to_metadata_json) and roll the changes out to all modules

Validation

~/code/modulesync_config/modules/voxpupuli $ grep puppet_version puppet-*/.fixtures.yml | wc -l
25

Further information

This came up during voxpupuli/puppet_fixtures#6

Metadata

Metadata

Assignees

Labels

bountyThis issue is part of the bounty process

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions