voxpupuli / onceover

Your gateway drug to automated infrastructure testing with Puppet
Apache License 2.0
143 stars 46 forks source link

onceover not updating cached module tags #181

Open jessereynolds opened 6 years ago

jessereynolds commented 6 years ago

It seems that sometimes onceover is unable to pull the latest tags for a cached module that has a git url in the Puppetfile

Today I updated the vra_puppet_plugin_prep module and tagged it with 0.1.7. After bumping the tag in Puppetfile and re-running onceover it hit this issue.

The git checkout command errors out with:

fatal: empty string is not a valid pathspec. please use . instead if you meant to match all paths

2018-10-15T04:52:59.0427130Z Bundle complete! 5 Gemfile dependencies, 46 gems now installed.
2018-10-15T04:52:59.0442830Z Bundled gems are installed into `/apps/tfs_agent/tfs_puppet_agent/bundler_gems`
2018-10-15T04:53:00.3652180Z INFO     -> Updating module /apps/tfs_agent/tfs_puppet_agent/_work/4/s/.onceover/etc/puppetlabs/code/environments/production/modules/dsc
2018-10-15T04:53:01.5714750Z INFO     -> Updating module /apps/tfs_agent/tfs_puppet_agent/_work/4/s/.onceover/etc/puppetlabs/code/environments/production/modules/cacert_fingerprint
2018-10-15T04:53:01.6251680Z INFO     -> Updating module /apps/tfs_agent/tfs_puppet_agent/_work/4/s/.onceover/etc/puppetlabs/code/environments/production/modules/augeasproviders_core
2018-10-15T04:53:01.6769920Z INFO     -> Updating module /apps/tfs_agent/tfs_puppet_agent/_work/4/s/.onceover/etc/puppetlabs/code/environments/production/modules/augeasproviders_ssh
2018-10-15T04:53:01.7253840Z INFO     -> Updating module /apps/tfs_agent/tfs_puppet_agent/_work/4/s/.onceover/etc/puppetlabs/code/environments/production/modules/vra_puppet_plugin_prep
2018-10-15T04:53:01.7716070Z [31mERROR    -> Command exited with non-zero exit code:
2018-10-15T04:53:01.7746150Z Command: git --git-dir /apps/tfs_agent/tfs_puppet_agent/_work/4/s/.onceover/etc/puppetlabs/code/environments/production/modules/vra_puppet_plugin_prep/.git --work-tree /apps/tfs_agent/tfs_puppet_agent/_work/4/s/.onceover/etc/puppetlabs/code/environments/production/modules/vra_puppet_plugin_prep checkout 0b3b512d185c7a220a61cb8492b2d81c86f84ed1
2018-10-15T04:53:01.7762810Z Stderr:
2018-10-15T04:53:01.7780400Z fatal: empty string is not a valid pathspec. please use . instead if you meant to match all paths
2018-10-15T04:53:01.7795400Z Exit code: 128
2018-10-15T04:53:01.7844340Z [0mINFO          -> Updating module /apps/tfs_agent/tfs_puppet_agent/_work/4/s/.onceover/etc/puppetlabs/code/environments/production/modules/rbac
2018-10-15T04:53:01.8249060Z INFO     -> Updating module /apps/tfs_agent/tfs_puppet_agent/_work/4/s/.onceover/etc/puppetlabs/code/environments/production/modules/inifile
2018-10-15T04:53:01.8865720Z INFO     -> Updating module /apps/tfs_agent/tfs_puppet_agent/_work/4/s/.onceover/etc/puppetlabs/code/environments/production/modules/puppet_agent
2018-10-15T04:53:01.9454610Z INFO     -> Updating module /apps/tfs_agent/tfs_puppet_agent/_work/4/s/.onceover/etc/puppetlabs/code/environments/production/modules/stdlib
2018-10-15T04:53:02.0130950Z INFO     -> Updating module /apps/tfs_agent/tfs_puppet_agent/_work/4/s/.onceover/etc/puppetlabs/code/environments/production/modules/transition
2018-10-15T04:53:02.0775530Z [31m
2018-10-15T04:53:02.0792790Z Error while running: #<RuntimeError: r10k could not install all required modules>[0m

Delving in a bit to the cached module git shows that the latest commits have been fetched however HEAD is not pointing to the latest commit, and the latest tag 0.1.7 is missing.

[puppetbuild@boxa vra_puppet_plugin_prep]$ git status
HEAD detached at 6c2375b
nothing to commit, working tree clean
[puppetbuild@boxa vra_puppet_plugin_prep]$ git log
commit 6c2375b65f7a82a173d81c0b3d0a9c3c4fb273cc (HEAD, tag: 0.1.6)
Author: Jesse Reynolds <jesse@va.com.au>
Date:   Thu May 24 15:58:29 2018 +1000

    Update to pdk 1.5 templates
[puppetbuild@boxa vra_puppet_plugin_prep]$ git tag
0.1.0
0.1.1
0.1.2
0.1.3
0.1.4
0.1.5
0.1.6
[puppetbuild@boxa vra_puppet_plugin_prep]$ git log 0b3b512d185c7a220a61cb8492b2d81c86f84ed1
commit 0b3b512d185c7a220a61cb8492b2d81c86f84ed1
Author: Jesse Reynolds <jesse@va.com.au>
Date:   Mon Oct 15 15:19:31 2018 +1100

    include issues url in metadata

commit 948ca3ab5cdc0de7addec12da9b05848bdac9956
Author: Jesse Reynolds <jesse@va.com.au>
Date:   Mon Oct 15 15:18:07 2018 +1100

    bump version to 1.7.0

The workaround for this situation is to remove the cached module and re-run onceover.

dylanratcliffe commented 6 years ago

@jessereynolds If you just run r10k deploy puppetfile does it show the same behaviour? Smells like an r10k bug to me, unless there's something onceover can do to detect this, or if it's a problem with onceover's caching