Build Storybook for a PR preview on `seven` branch
Do we build Storybook for a PR preview? It would be nice to have. https://volto--7150.org.readthedocs.build/7150/reference/storybook.html redirects to the stable version, and maybe we don't want that.
Originally posted by @stevepiercy in https://github.com/plone/volto/issues/7150#issuecomment-2920775687
@stevepiercy how do we do this? However, we always have the specific Storybook URL preview, right? Wasn't it necessary to enable something for rtd to do it if it detects any change on it?
If we change something in the specific add-on/package, the build should build, then the GHA should post the URL in the PR, like it does for the main docs, but for the others.
@sneridagh first, what do you actually want to do? I don't know, that's why I'm asking.
I assume for all PRs against seven, that you would want to build its storybook and visit its preview URL without getting redirected to the stable version at https://plone-storybook.readthedocs.io/. Is that right? We currently have it configured to redirect.
https://github.com/plone/volto/blob/d7b88643d519739cdf2d4205857441e2e75e1432/docs/conf.py#L313-L315
Detecting changes is done in a diff in the branch's https://github.com/plone/volto/blob/seven/.readthedocs.yaml#L22-L23.
https://github.com/plone/volto/blob/d7b88643d519739cdf2d4205857441e2e75e1432/.readthedocs.yaml#L22-L23
BTW, you're the only maintainer of https://plone-storybook.readthedocs.io/. Please add me to https://app.readthedocs.org/projects/plone-storybook/.
@stevepiercy no, the redirect we can live with the fact that it won't point to the PR build. I guess that would mean too much hassle.
I was refering to the preview URL in a PR comment. I will add you to the maintainers to all the builds.
I made you maintainer of the projects in RTD. I checked the "build PRs" config, let's see if that makes the trick.
@sneridagh maybe I misunderstand or you're overthinking it. What Storybook does Seven use?
I'm talking about this PR and preview on the seven branch.
- https://github.com/plone/volto/pull/7150
- https://volto--7150.org.readthedocs.build/7150/
The problem is this redirect:
The link Storybook redirects to https://plone-storybook.readthedocs.io/latest/. It's impossible to preview changes to the Storybook in any pull request to the seven branch because of that redirect configuration.
I think we also need to keep the redirect configuration for the official Seven docs. See https://volto.readthedocs.io/seven/ where the link to its Storybook is https://volto.readthedocs.io/seven/reference/storybook.html and redirects to https://plone-storybook.readthedocs.io/latest/.
I think what we want to do is conditionally disable the sphinx-reredirect configuration for pull requests to seven and possibly main, similar to the SO question at https://stackoverflow.com/q/61216495/2214933 and using the first comment's link (oh, hello, past me!) https://www.sphinx-doc.org/en/master/man/sphinx-build.html#cmdoption-sphinx-build-D.
@sneridagh what do you think?
I made you maintainer of the projects in RTD. I checked the "build PRs" config, let's see if that makes the trick.
Invites accepted. Thank you!