-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add ability to rebuild a specific build #6995
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
Conversation
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.
Its Amazing to see this go through. This will surely help the users a lot. 💯
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.
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'm not sure to understand the use case for this. What are the scenarios where you want to re-build the same commit? What would be different? I can see that the same commit could install different dependencies if they are not pinned for example, but that looks like an edge case to me.
I think the "rebuilding a build that failed because of RTD" --as the image shown, is kind of a hack and we should concentrate on having less of those.
I hit this pretty frequently when something weird happens with the PR builder. I think it's a useful enough thing to support, since other ways of supporting this are weird hacks. |
This is most useful for PR builds, but I've enabled it for all builds currently. It might make sense to only enable it for PR builds, or other builds where we care about rebuilding a specific commit. Fixes #6524
Co-authored-by: Maksudul Haque <[email protected]>
Co-authored-by: Maksudul Haque <[email protected]>
16fd3e7
to
a2c731a
Compare
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.
Button placement looks good! I'm -1 on repurposing command output for state display, but I think skipping UX on this interaction is absolutely fine. We can revisit polishing this up with new templates.
readthedocs/core/utils/__init__.py
Outdated
BuildCommandResult.objects.create( | ||
build=build, command='Rebuilding build', exit_code=0, | ||
start_time=datetime.utcnow(), end_time=datetime.utcnow(), | ||
) |
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 probably remove this entirely, I don't think it's worth introducing UI confusion in the command output. The best place to solve this would be either popping up a confirmation box for the user on click, or simply revert the state back to show the UI as "loading". Either would communicate to the user that the build is restarting
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'm more worried about other folks looking at it and being confused about why it was running again after it had already built. I think we don't do a great job of showing history on builds -- we hit this issue with failures & retries as well, so we need some kind of pattern for it.
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've updated this to use the new build status, which is a better solution 👍
This should be ready for a final review with the new status change 👍 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I took a look at this PR today trying to recover the feature and finish it. @ericholscher is there a strong reason why we are re-triggering the same build object instead of just trigger a new build with a specific commit? IMO, reading the code just makes it more complex passing the I'm thinking that we can just call I'll try opening a PR with this idea. |
I opened a PR at #8227 to show my idea but I'm still not convinced this is a good feature and I think it will create more problems than benefits. While it may be a good feature to "re-build the latest failed build from a PR", it will for sure create problems for all the other use cases that involve an old commit:
In all these cases, the user will be building and publishing an old version of their documentation, and they may not even notice that they just break their docs. They will end up with that version of their (now out-of-date) docs pointing to an old commit. Basically, there is going to be a discrepancy between what you have in your repository and what you have published, breaking one of the main benefits of RTD. Read the Docs' case is different from a regular CI because it does not only do checks but also generates and publishes assets. Considering the best use case for this feature the one I mentioned in the first paragraph, there are currently at least some workarounds that are not ideal but way safer from a user's perspective:
If any, it seems we should only allow to re-build on that particular case. Still, I don't think it adds a lot of value. |
I agree with the concerns raised by @humitos. I still think this is a good feature though, provided that we narrow down the scope.
Therefore, I think we could limit the feature as follows:
What do you think? Pinging @pllim , who probably has interest in this (I don't remember if we are discussing the feature in some other issue). |
I think the idea was to allow to re-build a PR or version from the latest commit. |
24 hours might not work for some. A commit can still be a latest commit but weeks old before a reviewer can get to it and realized a rebuild is needed, though I guess in that case, reviewer can open/close as usual and cancel the other CI (not pretty but it is a workaround). @astrojuanlu , I do vaguely recall talking about this though what I wanted more is the ability to skip building RTD entirely via |
Ah yes, that's #7660 :) |
Agreed with @astrojuanlu -- I think we probably only want to allow it for the last build on a PR branch. It should be simple enough to figure this out ( |
Allowing to re-build all the versions and all the past build could end up on publishing outdated docs for a stable/latest version. So, we are restricting this only to External Versions and only to its latest build object. See discussion in #6995 (comment)
I cannot wait to put this into good use. Thanks! 😸 |
In our case we have to rely on our package (https://pypi.org/project/primecountpy/) supplied via a wheel (it depends on an external C++ library, and the rtd builder Ideally, we would like to be able to install wheels on PyPI and only then trigger the rtd rebuild, but we'd be OK with rebuild |
@dimpase sorry it took so long to respond. Would an incoming webhook suit your use case? You can trigger builds externally https://docs.readthedocs.io/en/stable/integrations.html#using-the-generic-api-integration |
This is most useful for PR builds,
but I've enabled it for all builds currently.
It might make sense to only enable it for PR builds,
or other builds where we care about rebuilding a specific commit.
It definitely isn't the final UX, but it works reasonably well for now:
Fixes #6524