Azure-pipelines-agent: Custom GIT LFS Server not supported after v2.141

Created on 14 Nov 2019  路  11Comments  路  Source: microsoft/azure-pipelines-agent

Agent Version and Platform

Version v2.142
Windows

Azure DevOps Type and Version

On Premise TFS

What's not working?

With Version 2.142 of the agent the following pull request was issued: https://github.com/microsoft/azure-pipelines-agent/pull/1901
In this request the GIT_LFS_SKIP_SMUDGE - Filter is used whenever the Option "Checkout files from lfs or the Variable $agent.source.git.lfs is not set.
This however has the following side effect. If you are NOT using the TFS built in GIT LFS and you are relying on the .lfsconfig to tell git/git-lfs where to find the source files you are not able to work with tfs anymore.
If "Checkout files from lfs or the Variable $agent.source.git.lfs is set - the agent will construct the url to the git lfs repository itself which will result in a non-existing path to an tfs git lfs repository.

bug no-stale

All 11 comments

Git LFS Tutorial suggests to add a custom .lfsconfig file to a git repository in case of an external lfs server. In such a case, the current agent implementation cannot work correctly, because git lfs fetch is done before git checkout. But without git checkout, the required file .lfsconfig is not available for git lfs client and thus it does not get any files tracked by lfs.

A solution could be to retrieve file .lfsconfig before doing git lfs fetch, using command git checkout {refSpec} -- .lfsconfig.

I have applied necessary changes to a local compiled version of the build agent and it seemed to work. The only drawback i see is in case of not using an external lfs server, in which no .lfsconfig exists at all. This will cause a message to appear in the log:

error: pathspec '.lfsconfig' did not match any file(s) known to git

@jtpetty
I am sorry, but i think that this issue is not resolved/closed by the changes you made.
I just pulled the newest agent sources, did a "dev l" and a "dev b" and tested the agent with our git lfs environment.

Although the used git version is now 2.24.0.windows.2, the files from lfs are not downloaded, as you can see in the logs: git.log

The folder C:/GIT/External/azure-pipelines-agent/_layout/win-x64/_work/1/s is still empty (except the .git subfolder), no file .lfsconfig has been pulled from git repository, which is necessary to let git lfs know from where to pull the lfs files.

I apologize, I believe I linked the PR to the wrong issue. I will take a look at this issue again.

@tmisch - Would you mind publishing your changes that you have working as a PR?

@jtpetty
I would do that, but it seems that i do not have the permission to push my local branch to the remote repo.

@tmisch - you would have to create a fork and do a pull request that way. Here is some docs on how to do that: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork

@jtpetty
I have now created PR #2706

@tmisch - Thanks! We will review the PR in the next few days and see if we can get this issue fixed for you.

@mjroghelia - This is the issue I was talking with you about offline that we need to look at regarding improving our support for Git LFS

This issue has had no activity in 180 days. Please comment if it is not actually stale

@jtpetty
Is there still any chance to get this fixed?

Was this page helpful?
0 / 5 - 0 ratings