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
Version sync: exclude external versions when deleting #7742
Conversation
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.
I'm not sure to understand what's the issue we want to fix here. What was happening? What should happen? What are these scenarios?
Also, I think this should have a test so we don't hit this again and we are sure that we are doing what we expect here.
The problem is explained in the linked issue, when a PR is closed and the branch is deleted we delete the external version, but we need to keep it. I'll add a test. |
We weren't hitting this before bc we were excluding active versions. But now, external versions can also be inactive.
9fa8904
to
7ada88a
Compare
@stsewd hrm, this is tricky. It makes me think that we probably want to keep Version objects around for non-external versions too? I feel like we probably want to think more about this, and not delete any versions that have Builds, or that are |
We want to keep the build log of normal versions, keeping the versions will lead to have weird slugs like
This doesn't delete active versions, only inactive ones. readthedocs.org/readthedocs/api/v2/utils.py Lines 176 to 179 in 7ada88a
|
So external versions are not marked as active when they are built? Or is there some other bug that is causing this? I don't fully understand why this behavior is only necessary for external versions. |
External versions are marked as active and built as normal versions, but we want to delete external version after 90 days, not immediately, so we exclude external versions from this query set |
Sure, but won't we still end up deleting normal versions that have
|
@ericholscher we want to keep build logs for both, but that's another PR #7679, this is to fix a bug in the first part of the implementation (delete external versions after 90 days) |
We weren't hitting this before bc we were excluding active versions.
But now, external versions can also be inactive.
Close #7738