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

[FIX] runbot: avoid traceback when forcing a preparing batch #734

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

d-fence
Copy link
Contributor

@d-fence d-fence commented Feb 13, 2023

When forcing a new batch on a bundle the _force method does not return a batch leading to a traceback in the force_bundle route.

When forcing a new batch on a bundle the _force method does not return a
batch leading to a traceback in the force_bundle route.
Comment on lines +213 to +216
if batch:
batch._log('Batch forced by %s', request.env.user.name)
batch._prepare(auto_rebase)
return werkzeug.utils.redirect('/runbot/batch/%s' % batch.id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we should actually return self.last_batch in the _forcemethod.
in this case this will redirect to the existing batch, but also prepare it immediately without waiting the full time.

In this case, we will also need to check for the state in _prepare

if not self.state == "preparing":
    return

Or if you prefer to avoid to change this behaviour, we can also return the redirect in all case but fallbacking on last_batch if batch is None

@Xavier-Do Xavier-Do changed the base branch from 15.0 to 16.0 June 22, 2023 13:54
@C3POdoo C3POdoo requested a review from a team June 22, 2023 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants