readthedocs.org
readthedocs.org copied to clipboard
Add UI element for resyncing versions from VCS
Currently we have a task that resyncs Versions from VCS:
https://github.com/readthedocs/readthedocs.org/blob/7fda1c0c36f3a498d55f503a09780fbe78928a88/readthedocs/projects/tasks.py#L217
We should create a button on the Versions page (/projects/
- A user doesn't have a webhook setup for their repo (eg. non-supported VCS)
- The users webhook isn't configured to send us pings when they push a new tag/branch
- A random failure happens either in the webhook code from the provider, or on our side to process it
Normally we tell users to just do a build of their docs to fix this, but I think we should add a UI element to resync them, so it's more obvious how to handle this situation.
@ericholscher Do we want this to behave same as build list page Build Version button?
https://github.com/readthedocs/readthedocs.org/blob/3f3488f594c986c86246c686d587cac463c519e8/readthedocs/builds/views.py#L50-L80
And Will this Resync Button be available for all the version or only the active versions?
@saadmk11 the Resync button is only one for each project. The task only clones the repo and parse the tags and branches, so the versions are in sync.
I had a user request resyncing via API, so they could ensure branches were synced in their CI. This could be a good first step towards an implementation, which the frontend UI element could just hit.
Yeah, an API endpoint would be perfect.
See https://github.com/readthedocs/ext-theme/issues/65 for the dashboard implementation:
- https://github.com/readthedocs/ext-theme/issues/65
Refs https://app.frontapp.com/open/cnv_nclep3b?key=ynhl4BBbPEPQUA3m1r8DTc9oWRq5xVvi
Looking into this, we already have an API endpoint for this:
https://github.com/readthedocs/readthedocs.org/blob/bf023534b0a49aca1e0336ffb077ace502fc5b63/readthedocs/api/v2/views/task_views.py#L38-L52
Yes, we have this button in the old dashboard. This endpoint does not work because it requires Celery storing the results and we removed that feature because of... Celery-reasons.
The current button in the old dashboard just fakes it and waits ~3s, IIRC.