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

Git LFS is not supported #869

Closed
remilapeyre opened this issue Dec 2, 2019 · 6 comments · Fixed by #872 or #1054
Closed

Git LFS is not supported #869

remilapeyre opened this issue Dec 2, 2019 · 6 comments · Fixed by #872 or #1054
Labels
feature New functionality/enhancement

Comments

@remilapeyre
Copy link
Contributor

It seems to me that Git LFS is not supported by Atlantis. We are using it to save zip files for aws_lambda_function resources and Atlantis fail to send the correct file as the file it gets from the git pull is:

version https://git-lfs.github.com/spec/v1
oid sha256:30735d2053525417ac398890661758f99a139895d3da6e7e56f432b188671e55
size 101749

Git LFS is pretty standard so maybe we should add it to the base image and run git lfs pull when we fetch the changes?

@lkysow lkysow added the feature New functionality/enhancement label Dec 2, 2019
@lkysow
Copy link
Member

lkysow commented Dec 2, 2019

Sure, please open a PR to the atlantis-base Docker image. Do we have to run git lfs pull or can we just run git pull?

@remilapeyre
Copy link
Contributor Author

Without hooks git lfs pull will be needed after git pull.

@remilapeyre
Copy link
Contributor Author

I see that you are using github.com/hashicorp/go-getter so I will first need to add this in Go-getter and theen update the dependencies of Atlantis, right?

@lkysow
Copy link
Member

lkysow commented Dec 3, 2019

go-getter isn't used for cloning. We just shell out to git:

if w.CheckoutMerge {
// NOTE: We can't do a shallow clone when we're merging because we'll
// get merge conflicts if our clone doesn't have the commits that the
// branch we're merging branched off at.
// See https://groups.google.com/forum/#!topic/git-users/v3MkuuiDJ98.
cmds = [][]string{
{
"git", "clone", "--branch", p.BaseBranch, "--single-branch", baseCloneURL, cloneDir,
},
{
"git", "remote", "add", "head", headCloneURL,
},
{
"git", "fetch", "head", fmt.Sprintf("+refs/heads/%s:", p.HeadBranch),
},
// We use --no-ff because we always want there to be a merge commit.
// This way, our branch will look the same regardless if the merge
// could be fast forwarded. This is useful later when we run
// git rev-parse HEAD^2 to get the head commit because it will
// always succeed whereas without --no-ff, if the merge was fast
// forwarded then git rev-parse HEAD^2 would fail.
{
"git", "merge", "-q", "--no-ff", "-m", "atlantis-merge", "FETCH_HEAD",
},
}
} else {
cmds = [][]string{
{
"git", "clone", "--branch", p.HeadBranch, "--depth=1", "--single-branch", headCloneURL, cloneDir,
},
}
}

@iakat
Copy link

iakat commented May 25, 2020

Could you please push to the docker registry either 0.12.0 or latest with this change?

Neither images have git-lfs installed and installing it from a custom workflow with apk add git-lfs results in an error, seemingly because the command is understandably not run as root.

Thanks!

@lkysow
Copy link
Member

lkysow commented May 26, 2020

Oh weird. Okay yeah maybe I didn't push the base image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality/enhancement
Projects
None yet
3 participants