-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Custom LFS integration has broken unexpectedly #8288
Comments
@eloquence Hi! Can you paste the link for your RTD project?
How did it break? Can you paste the link for a failing build? |
Definitely, something broke for some reason. The example from |
I updated git-lfs to its latest version and it didn't fix the issue. |
I don't have too much experience with git-lfs, but in any case, I don't think this is a bug/issue/problem of RTD --it seems the files are not properly checked out locally by git-lfs, since my test from that page shows the content as a text file:
when it should show the PNG content itself. |
@humitos If you add that test read of the file to |
I have the exact same problem and I can confirm what @rmol says. My log indicates that the LFS checkout was successful, still the files are pointers when the actual |
I think, that I am having the same issue here. Also, rebuilding an older version that had working LFS images breaks them, so this is almost certainly a regression. |
It looks like the extra This might all be a red herring, though, since I don't see any way for I think, that I might have figured out, what is wrong. I tried adding some
So the only questions that remain are:
|
Thanks for posting your analysis, I did a bit more digging.
I found
The description of #8263 states "In some places we were executing git commands outside the container" so, maybe above line was not actually used, but is now? Unfortunately, I am missing the code base knowledge to continue from here. |
So, I fixed this issue for me by playing around with the working directory of the |
Unfortunately, it doesn't seem, that GIT_DIR=/home/docs/checkouts/readthedocs.org/user_builds/<projectname>/checkouts/latest/.git and /home/docs/checkouts/readthedocs.org/user_builds/<projectname>/checkouts/latest/.git as expected. It's only the current /home/docs/checkouts/readthedocs.org/user_builds/<projectname>/checkouts/latest/docs The weirdest part is that according to /home/docs/checkouts/readthedocs.org/user_builds/<projectname>/checkouts/latest <sha> (detached HEAD) So at first glance it seems like the output of Okay. This is insane. I think, that I might have found the problem. And it might be a bug in # Setup example repo
mkdir /example
cd /example
git init .
mkdir docs
cd docs Then the following behaviour is clearly broken git rev-parse --show-toplevel # prints /example as expected
export GIT_DIR=/example/.git
git rev-parse --show-toplevel # prints /example/docs for some reason In fact, after exporting The only thing, that I don't understand is how/why did it work differently in the past. |
Ah, okay. I think, it makes sense now. The #8263 must be the cause after all. Although it is exporting the correct @humitos can we get a temporary quick fix for this regression, that doesn't push the Edit: actually, the correct solution would probably be to just export Here's a relevant extract from
Edit edit: I made a PR with the proposed fix. |
Nice detective work @RuRo I just build git master from source and your minimum example is still failing there. |
I still don't quite understand what broke here. It seems that #8263 wouldn't have changed the environment in the docker containers, and GIT_DIR has been passed for ~11 years into the containers. I'm worried about changing GIT_DIR, since it's been in the builders for so long. It seems like deleting it could cause lots of other issues with users code (eg. people calling Maybe @stsewd can chime in a bit more here -- I'd like to understand the issue a bit more so we can help fix it. |
Maybe I am wrong, but here is my reasoning, for why the environment wasn't passed into the build step previously. Look carefully at how After #8263, the VCS is now constructed with an explicit environment, that is shared between the steps in the doc builder. This also explain, why there are 2 new |
Yea -- but the build is failing on the (Also, thanks so much for diving into this code @RuRo -- we really appreciate the help). |
@ericholscher a wild guess, maybe the executing the git commands with - commit = self.commit or self.project.vcs_repo(self.version.slug).commit
+ commit = self.commit or self.get_vcs_repo(environment).commit |
(also replying to your comment on the PR)
|
The thing is that we execute the git-clone and sphinx-build commands inside a container (we always have). We also use gitpython to iterate over tags/branches or check if the repo exists, and we were executing the command |
Hmmm. I see your point now, but are you sure that the environment is actually shared between these steps? And I don't mean if they are both ran inside docker. Is the actual environment object shared between them. For example, it seems to me, that the checkout step is started from I am not 100% sure, but it doesn't seem to be the same object as |
@RuRo we actually just tracked this down to
|
@RuRo we have deployed the fix, git-lfs should be working now. Thanks for helping us debugging this! |
Details
The SecureDrop project uses https://github.com/freedomofpress/securedrop-docs as its documentation repo. It uses LFS because screenshots are updated with each release, which would otherwise balloon the repo size.
We are aware that LFS is not officially supported (#1846), but have so far relied on a commonly used method for installing
git-lfs
viaconf.py
(https://github.com/freedomofpress/securedrop-docs/blob/main/docs/conf.py#L21-L27). This method has stopped working unexpectedly approximately 2-3 days ago, causing all images in our documentation to break (they are served as LFS pointers).We would appreciate any light you can shed on changes to the RTD build environment that may have caused this breakage. We have attempted to resolve it using various strategies, e.g., by installing
git-lfs
as a package, to no avail so far. It appears to us that even when the LFS checkout is working as expected, at some point during the build process, the actual images are not copied correctly.Further notes on our technical investigation so far can be found at freedomofpress/securedrop-docs#234 . We can of course revert to a non-LFS repo, but if there is a straightforward fix or lead for us to pursue, we would appreciate any pointers.
The text was updated successfully, but these errors were encountered: