Skip to content
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

Project.has_valid_clone is not really used/useful #4106

Closed
humitos opened this issue May 17, 2018 · 2 comments
Closed

Project.has_valid_clone is not really used/useful #4106

humitos opened this issue May 17, 2018 · 2 comments
Assignees
Labels
Bug A bug

Comments

@humitos
Copy link
Member

humitos commented May 17, 2018

While debugging a different issue (https://github.com/readthedocs/readthedocs-corporate/issues/332) I found that Project.has_valid_clone is present in just 3 places in the whole codebase and it's not really used/useful.

Besides, we making an extra API call (https://github.com/rtfd/readthedocs.org/blob/10b6d53cbcdb33d9241a885e730784ba13da35e8/readthedocs/projects/tasks.py#L404) to set this to True on each build triggered after the setup step is done but since it's not present in the serializer (https://github.com/rtfd/readthedocs.org/blob/10b6d53cbcdb33d9241a885e730784ba13da35e8/readthedocs/restapi/serializers.py#L47) we are always making that PUT request which in fact it doesn't update anything because that value is lost.

I did a quick query in production and there is 0 project with a valid clone :)

In [1]: Project.objects.filter(has_valid_clone=True).count()
Out[1]: 0

So,

  1. we can remove this field from our database without problem and also the related code
  2. we can add this field to the ProjectAdminSerializer and make it happen (PR Add has_valid_clone and has_valid_webhook to ProjectAdminSerializer #4107)
@humitos
Copy link
Member Author

humitos commented May 23, 2018

@ericholscher can you take a look at this and decide if I should remove the field or make it useful?

@ericholscher
Copy link
Member

I think it's useful data to have. We originally added it to have basic stats, and the ability to query projects that aren't hooked up to a valid git repo. So I think adding it is probably useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug
Projects
None yet
Development

No branches or pull requests

3 participants