-
-
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
Fix the failing domain deletion task #4891
Fix the failing domain deletion task #4891
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4891 +/- ##
==========================================
- Coverage 76.87% 76.65% -0.23%
==========================================
Files 158 158
Lines 9997 10056 +59
Branches 1255 1269 +14
==========================================
+ Hits 7685 7708 +23
- Misses 1980 2007 +27
- Partials 332 341 +9
|
@humitos Please review. |
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.
Looks good. Thanks!
I just left a question about a refactor that I think it's not needed.
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'd prefer this doesn't change function signatures, which seems mostly avoidable. Our commercial hosting code also has code that calls some of these tasks, and the change here would require cleanup on that codebase as well.
readthedocs/projects/tasks.py
Outdated
@@ -1002,15 +1002,14 @@ def symlink_project(project_pk): | |||
|
|||
|
|||
@app.task(queue='web') | |||
def symlink_domain(project_pk, domain_pk, delete=False): | |||
def symlink_domain(project_pk, domain_str, delete=False): |
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.
Same note able annotating variable name with type. domain
is probably best, as domain_pk
doesn't make sense here anymore. Is there a strong reason to change this call either way? Why not change the call to sym.remove_symlink_cname(domain.domain)
instead? We have calls from our commercial hosting fork that might break because of the signature change.
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.
@agjohnson
I think we can't call like this sym.remove_symlink_cname(domain.domain)
because as mentioned in the issue ( #4789 ).
This task tries to get the Domain object using the pk from the database and it fails because the object was already removed.
So it needs to depend only on the string domain.domain
, which is being passed as argument from the 'delete
and save
method of the 'Domain' class.
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.
Would it be worth it to make a similar function for the deletion?
And not touching this function.
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 don't know if that is necessary, seems like the current methods are all we need. domain_str
can be domain
either way however, no need for type annotation on variable names.
This PR has some conflicts to resolve and I think it's close to be merged. It would be good to fix these and merge. |
@humitos |
Bleh, github doesn't know what it's doing. Tried to dismiss requested review on me and it rejects my previous review 👍 Still blocking on variable name nitpick. Update there makes this mergable |
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 already reviewed this github! 👍
@agjohnson |
Looks good. 👍 |
Fixes #4789