#329 Fetch just container.yaml and content_sets.yml instead of cloning whole dist-git repo.
Merged by lucarval. Opened by jkaluza.
jkaluza/freshmaker fast-git  into  master

Download 329.patch

Currently, Freshmaker is cloning the git repository of every image it is going
to rebuild to find out the content of container.yaml and content_sets.yml to
decide whether it needs to generate Pulp composes itself or if the OSBS can
do it iself.

Cloning whole repository is slow and downloads unnecessary files.

In this commit, new get_distgit_files method is introduce which uses
"git archive" instead of "git clone" to get only particular files which
are needed by Freshmaker from the dist-git repository.

This is much faster and also does not consume any extra resources.

rebased onto 51cc2ec85b880ca3bb8cb3be29429e089557b4f0

I can't seem to get this to work with https only. It seems to require ssh.

UPDATE: That's because https is not supported. But that's ok, our configuration specifies the git base URL with the git:// protocol which is just fine.

You could fetch all the files at once. git archive accepts multiple path values.

:+1: Minor nitpick comment, but nothing that should block it from being merged.

@cqi, could you take a look?

Is this using PyYAML? I cannot find it in requirements.txt.

More importantly: yaml.safe_load() should be used instead if you don't trust source or don't need to load any fancy Python objects. [1]

[1] https://pyyaml.org/wiki/PyYAMLDocumentation

@lholecek, I'll follow up with a different PR for that, thanks!

Commit e61f115e fixes this pull-request

Pull-Request has been merged by lucarval

Pull-Request has been merged by lucarval

Metadata