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

Please make g10k inform about missing branches in the sources #45

Closed
gdubicki opened this issue Mar 18, 2017 · 3 comments
Closed

Please make g10k inform about missing branches in the sources #45

gdubicki opened this issue Mar 18, 2017 · 3 comments

Comments

@gdubicki
Copy link
Contributor

gdubicki commented Mar 18, 2017

I am using v0.2.9b.

This is my config file:

---
cachedir: '/var/cache/g10k'
sources:
  hieradata:
    remote: git@git.mydomain.com:puppet/hiera.git
    basedir: /etc/puppet/hieradata
  envs:
    remote: git@git.mydomain.com:puppet/envs.git
    basedir: /etc/puppet/environments

...and this is the Puppetfile in g10k_test branch of envs repo:

mod 'puppetboard',
  :git => 'https://github.com/nibalizer/puppet-module-puppetboard.git',
  :ref => '2.7.1'

When I run g10k with:

g10k -config /etc/puppet/g10k.yaml -branch g10k_test

..while having g10k_test branch in envs repo but NOT in the hiera repo I get the following output:

# g10k -config /etc/puppet/g10k.yaml -branch g10k_test
Resolving Git modules (1/1)    0s [====================================================================] 100%
Synced /etc/puppet/g10k.yaml with branch g10k_test with 2 git repositories and 0 Forge modules in 2.0s with git (3.4s sync, I/O 0.0s) and Forge (0.0s query+download, I/O 0.0s)

It would be nice if g10k could inform (warn?) me about missing branch in hieradata source.

(r10k 2.5.1 also doesn't inform about missing branches, so this is definitely a feature request, not a bug report.)

PS I was also a bit surprised to see 2 git repos synced reported above. Which repos are counted here, the 2 sources repos?

@xorpaul
Copy link
Owner

xorpaul commented Mar 18, 2017

Hmm, I don't see always printing a warning being helpful, when only the hiera branch is missing.

In my environment I specified that the master hiera branch gets always evaluated with the option of there being a hiera branch with the same name as the environment branch.

So in my case a missing hiera branch is fully intended.

What I could do is adding a toggle to the config file:

---
cachedir: '/var/cache/g10k'
sources:
  hieradata:
    remote: git@git.mydomain.com:puppet/hiera.git
    basedir: /etc/puppet/hieradata
    warn_if_branch_is_missing: true
  envs:
    remote: git@git.mydomain.com:puppet/envs.git
    basedir: /etc/puppet/environments

or something with a better name. Then when you specify a branch via the -branch param and it doesn't exists in the hiera git repository, g10k could print a warning.

@gdubicki
Copy link
Contributor Author

Thanks. I would find it useful as I will check g10k logs as a way to monitor health of my puppet code deployments.

@xorpaul
Copy link
Owner

xorpaul commented Mar 21, 2017

Closed with #48

Renamed the setting to warn_if_branch_is_missing

I'll release v0.3 with the recent code changes later today.

@xorpaul xorpaul closed this as completed Mar 21, 2017
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