readthedocs.org icon indicating copy to clipboard operation
readthedocs.org copied to clipboard

Add UI element for resyncing versions from VCS

Open ericholscher opened this issue 6 years ago • 5 comments

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//versions/) that lets users automatically trigger a resync. We usually try and resync versions whenever we get a new webhook from GitHub, but there are a few cases where this doesn't work:

  • 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 avatar Aug 21 '19 22:08 ericholscher

@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 avatar Sep 25 '19 14:09 saadmk11

@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.

stsewd avatar Sep 25 '19 15:09 stsewd

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.

ericholscher avatar Jun 17 '24 17:06 ericholscher

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

agjohnson avatar Jun 17 '24 17:06 agjohnson

Refs https://app.frontapp.com/open/cnv_nclep3b?key=ynhl4BBbPEPQUA3m1r8DTc9oWRq5xVvi

ericholscher avatar Jun 19 '24 20:06 ericholscher

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

ericholscher avatar Jul 18 '24 16:07 ericholscher

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.

humitos avatar Jul 18 '24 16:07 humitos