-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Safe symlink on version deletion #4937
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
Safe symlink on version deletion #4937
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4937 +/- ##
==========================================
+ Coverage 76.74% 76.97% +0.22%
==========================================
Files 158 158
Lines 9951 10032 +81
Branches 1244 1259 +15
==========================================
+ Hits 7637 7722 +85
+ Misses 1980 1976 -4
Partials 334 334
|
Not really sure how to test this one. And, Investigating more about this, we don't call delete if the version is active, so, if the user deletes the version on the repo and the version is active in rtd, the docs aren't deleted, which is good. If we deactivate the version, it deletes the docs. That happens here So, again, not sure if we need that code. |
We may want to check the git log to understand why/when that I suppose that we don't need it since we don't delete versions calling manually |
This was added here #1686, maybe this can be useful when deleting a version from the admin, not sure. |
I think it's safe to remove this The later is not exactly the same than |
We used to have a "Clean" button in the Inactive Versions listing to remove built and disabled versions of the documentation. This is not more possible, because when the version is disabled (mark as non active) we call `clean_artifacts` and remove all the HTML files for this version and mark it as `Version.build=False`. In the end, that button does not appear anymore. Related #4937
We used to have a "Clean" button in the Inactive Versions listing to remove built and disabled versions of the documentation. This is not more possible, because when the version is disabled (mark as non active) we call `clean_artifacts` and remove all the HTML files for this version and mark it as `Version.build=False`. In the end, that button does not appear anymore. Related #4937
OK, turns out we do use this in .com Actually, not sure, I'm not so familiar with that code, so not sure if it's dead code or what, if not, I can revert the latest commit and put the leave the initial fix :) |
Good point! We need to take a look into that before merging this PR and removing the |
@humitos that was added for you actually https://github.com/rtfd/readthedocs-corporate/commit/3b335f359efd4c5045c7b93d0e6f47bf159360ef, I guess we need to keep that code? |
Yes! I was thinking if we may want to migrate that code to .com, but I think it's correct to use the |
It looks like this patch is just a small linting change, is there more to it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see. We're just moving the symlinking to after the delete. Makes sense.
Fix #3743
Also, I think we don't use this in code. I thought we were using it when syncing versions, but we call
https://github.com/rtfd/readthedocs.org/blob/7f2b831ac18ee839535254e9b14e595621ebf653/readthedocs/restapi/utils.py#L172-L172
there, when doing a deletion in that way, django doesn't call the
delete
method.