Skip to content
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

missing dependency in metdata.json (theforeman-git) #815

Open
term1n4l opened this issue Nov 5, 2021 · 3 comments
Open

missing dependency in metdata.json (theforeman-git) #815

term1n4l opened this issue Nov 5, 2021 · 3 comments

Comments

@term1n4l
Copy link

term1n4l commented Nov 5, 2021

Based on puppet::server::config we are missing 'git':

manifests/server/config.pp, Line 253 says 'include git'

going back through the version history to 1.4.0, this is a reference to 'theforeman-git' as specified in 'Modulefile':

Modulefile, Line 12

As this is intended to be here still for managing git repos, I suggest adding the following to the dependencies:

    {
      "name": "theforeman/git",
      "version_requirement": ">= 6.3.0 < 8.0.0"
    },

This will cover Puppet 5, 6, 7, however if you would rather deprecate 5 like most other modules have done so far then:

    {
      "name": "theforeman/git",
      "version_requirement": ">= 7.0.0 < 8.0.0"
    },

This will provide the missing dependency specification in the module data on the forge. the below is an example of the updated metadata.json

metadata.json

@term1n4l term1n4l changed the title missing dependency missing dependency in metdata.json (theforeman-git) Nov 5, 2021
@term1n4l
Copy link
Author

term1n4l commented Nov 5, 2021

given time, I may be able to create a PR for this, but putting the issue in here for awareness while I am thinking of it

@ekohl
Copy link
Member

ekohl commented Nov 5, 2021

It's mentioned in https://github.com/theforeman/puppet-puppet#git-repo-support that it's needed. Soft dependencies in Puppet aren't great to say the least.

Perhaps it would be better to have something like extlib::has_module. So we can change this part here:

if $puppet::server::git_repo {
include git

To

  if $puppet::server::git_repo {
    unless extlib::has_module('theforeman/git') {
      fail('theforeman/git module is not present')
    }
    include git

Alternatively you could use load_module_metadata to load the metadata and verify the version is compatible. I can also imagine has_module could be extended with another argument to verify the version.

@term1n4l
Copy link
Author

Making it a hard dependency means it should to be visible to the end user also. Without having it visible in the dependencies on the forge it might be missed. By all means make it a hard dependency, but please consider adding it to the module metadata so it's picked up by the forge as well as some people will only do a cursory scan of the README and still miss that it has undefined dependencies.

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

No branches or pull requests

2 participants