-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
feat: support git-lfs
#707
Conversation
Hi @Russman12 ! Could you help us by testing this PR locally with the repo with LFS files and tell us if it works please ? You can follow those steps to install this PR locally and test it |
git-lfs
copy supportgit-lfs
file copy
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #707 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 34 35 +1
Lines 974 988 +14
Branches 96 97 +1
=========================================
+ Hits 974 988 +14
☔ View full report in Codecov by Sentry. |
798e76e
to
fe4a11f
Compare
I have followed the steps mentioned in the CONTRIBUTING.md file and tested that non LFS files results in a delta directory creation as expected. One note is that I could not find a "test" branch, so I checked out the feature branch instead. After confirming it was working properly, I tested an LFS file by performing the following:
After the last command completes, the directory does not contain the LFS file at all, and the terminal is outputs the following error message:
I also tested creating a new file that was LFS tracked upon creation. In that scenario, I am getting the previous error as well as the following:
|
Hi @Russman12, thanks for testing. What is your environment please ? (os, node version, git version, lfs version, yarn version, sfdx version) And can you send us the Also, could you retry with the latest version of this PR please ? Let us know the result please |
f939723
to
f463307
Compare
Weekly Sync Minutes:Compare (a) copying file efficiently without storing the content in memory context: Metadata deployment (a) pros and cons (commit)
(b) pros and cons (commit)
(Mix of a and b) pros and cons
For now we think we can go with option (b). |
f463307
to
eed449f
Compare
After pulling the latest version of this feature branch repackaging/relinking the commands, I was able to get it working when making existing files LFS tracked. However, when creating a new file and adding it to LFS at the same time, it still gives me an error. Below are the commands I ran to reproduce the new file scenario: git lfs track force-app/main/default/staticresources/my-file.txt echo "this is a large file" > force-app/main/default/staticresources/my-file.txt echo "<?xml version="1.0" encoding="UTF-8"?>
<StaticResource xmlns="http://soap.sforce.com/2006/04/metadata">
<cacheControl>Private</cacheControl>
<contentType>text/plain</contentType>
</StaticResource>" > force-app/main/default/staticresources/my-file.resource-meta.xml git add . && git commit -m "added my-file.txt" sfdx sgd:source:delta --from "HEAD~1" --to "HEAD" -d This is the output after the last command completes:
Despite this error message, the output directory contains all the expected files and subdirectories (my-file.resource-meta.xml, my-file.txt, and package.xml) and the content of each file is correct as well. Based on the error message, I think something may be appending a redundant "resource-meta" to the .xml file. Windows 10 v10.0.19044.3448 Hope this helps! |
Thanks for this feedback @Russman12 |
10b4bb3
to
4de6f08
Compare
Thanks for the quick resolution @scolladon! Yes, this has fixed all the issues I encountered. Great work! |
Thank you very much for your help here @Russman12, great contribution. One more thing, what do you think about the design choice we made here ? Do you agree with it, considering the metadata API limitation ? |
Forgive me, but I don't quite understand what you mean by "does not work with inFile metadata as they will not be resolved when introspected". Are you saying that for option "A" if a "meta.xml" file is tracked as LFS, that won't build the package properly since the content can't be read? |
It means for metadata contained in file (like per exemple CustomLabels). it won't be able to detect the actual changes inside the file because option (a) does not get the content. |
Oh, I see. Good catch! Yeah, I mean unless you were to write something that treats files like that different, than I think option B is the better solution. |
4de6f08
to
bb05f30
Compare
bb05f30
to
91bee3d
Compare
Code Climate has analyzed commit 91bee3d and detected 0 issues on this pull request. View more on Code Climate. |
Shipped in release $ sfdx plugins:install sfdx-git-delta@latest-rc
$ sfdx plugins:install sfdx-git-delta@v5.27.0 Happy incremental deployment! |
Explain your changes
Implement a way to find real content of
git lfs
filesNo E2E test have been added yet,
git-lfs
seems to have different behavior depending the OS architecture.Does this close any currently open issues?
closes #704
Any particular element that can be tested locally
Any other comments