Skip to content

Git: .tar.gz only contains metadata.json if downloaded before #11

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

Closed
svengerlach opened this issue Jul 16, 2014 · 3 comments
Closed

Git: .tar.gz only contains metadata.json if downloaded before #11

svengerlach opened this issue Jul 16, 2014 · 3 comments

Comments

@svengerlach
Copy link

I've tried to run the gem versions 0.16.0, 0.15.0 and a checkout of master.

I configured puppet-library the following way:

require 'rubygems'
require 'puppet_library'

server = PuppetLibrary::Server.configure do
    forge :git_repository do
        source "https://github.com/jfryman/puppet-nginx.git"
        include_tags /[0-9.]+/
    end
end

run server

The first time the module is downloaded (/modules/jfryman-nginx-0.0.9.tar.gz), everything is working fine. Any subsequent downloaded .tar.gz file only contains the file metadata.json.

Some output from the log file:

D, [2014-07-16T10:05:40.387507 #3464] DEBUG -- PuppetLibrary::Util::Git: git --git-dir=/tmp/git-repo-cache20140716-3464-qgq4ff-0/.git --work-tree=/tmp/git20140716-3464-chpsnn-0 checkout v0.0.9
192.168.1.25 - - [16/Jul/2014 10:05:40] "GET /modules/jfryman-nginx-0.0.9.tar.gz HTTP/1.1" 200 33069 2.3113
D, [2014-07-16T10:05:47.987534 #3464] DEBUG -- PuppetLibrary::Util::Git: git --git-dir=/tmp/git-repo-cache20140716-3464-qgq4ff-0/.git --work-tree=/tmp/git20140716-3464-1va93a3-0 checkout v0.0.9
192.168.1.25 - - [16/Jul/2014 10:05:48] "GET /modules/jfryman-nginx-0.0.9.tar.gz HTTP/1.1" 200 366 0.0808
@drrb
Copy link
Owner

drrb commented Jul 16, 2014

Thanks for the report. I've reproduced this.

drrb added a commit that referenced this issue Jul 16, 2014
Checking out from local clone of remote Git repositories wasn't working
as expected. The first time, the working copy would be updated from the
tag because the clone would be checking out the tag. Subsequent times,
with a different (empty) working directory, Git would treat all the
files as deleted in the working copy, and not update them. Using `git
checkout -f <tag>` instead of `git checkout <tag>` fixed this, but
highlights a race condition that probably existed for reading from local
Git clones. Synchronized read access to Git repositories for now, until
we can work out how to use Git properly for this.
drrb added a commit that referenced this issue Jul 16, 2014
Avoid moving HEAD around in Git mirrors: see #11
drrb added a commit that referenced this issue Jul 16, 2014
@drrb drrb closed this as completed in babf5fd Jul 16, 2014
@drrb
Copy link
Owner

drrb commented Jul 16, 2014

Fixed in v0.17.0.

@svengerlach
Copy link
Author

Awesome - thank you!

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