-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Build: add a new "Cancelled" final state #9145
Conversation
This commit introduces a new build final state: "Cancelled". This state is shown in the build listing page and also in the build details page. The build will end up on this state when: - The user cancels the build by clicking on the button - The build is cancelled due to inactivity - The build is cancelled because it was duplicated Ther are a lot of changes required for this: - HTML template logic for build details and listing pages - API changes to add a new value - Knockout.js logic for build details page - `Build` model changes to support a new state - Update different places of core logic to change checking for `finished` state to `BUILD_FINAL_STATES` instead - Documentation changes to mention the new state - Celery build handler `after_return` to decide if it's `finished` or `cancelled` the ending state - Logic to decide if the build should be killed due to inactivity Reference #9100
124301c
to
ee3a3a9
Compare
I think overall this makes sense. I feel like @agjohnson had a bit more context in the discussion thread, so happy to let him take primary reviewer here. Happy to do a technical review if we're 👍 on the direction, if that's useful. |
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.
This does highlight why I want to centralize this logic. I don't have a great grasp on what could have been missed here, but this looks thorough enough to test.
@@ -138,9 +138,14 @@ | |||
{% trans "Build completed" %} | |||
</span> | |||
<span class="build-state-failed" | |||
data-bind="visible: finished() && !success()" | |||
data-bind="visible: finished() && !success() && !cancelled()" |
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.
This is the type of logic that I'll move to strictly JS and would like out of templates eventually. For now this is fine though.
@@ -77,6 +77,7 @@ <h3>{% trans "Projects" %}</h3> | |||
<span class="build-state build-state-passing">{% trans "passing" %}</span> | |||
{% else %} | |||
<span class="build-state build-state-failing">{% trans "failing" %}</span> | |||
{# TODO: What whould be show here when "not build.sucess and cancelled"? #} |
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 getting rid of this concept in the new templates. There is no singular status that makes sense here in any regard. That is, we are showing the status of the project based on the get_latest_build
-- a failure on some minor version can make the entire project look failing.
Instead, the new templates don't show this status at all, but show individual version statuses instead. Even in that case, I don't feel we show the version as "cancelled" though.
…mitos/build-cancelled-state
I updated the PR and fixed the tests. Note that this PR is touching different places and also touches the logic of the builds. It may be worth pinging another member to do a local QA of the different ways to generate the canceled state before deploying this feature. What do you think? |
This commit introduces a new build final state: "Cancelled".
This state is shown in the build listing page and also in the build details
page. The build will end up on this state when:
Ther are a lot of changes required for this:
Build
model changes to support a new statefinished
stateto
BUILD_FINAL_STATES
insteadafter_return
to decide if it'sfinished
orcancelled
the ending stateUI examples
Build ending up in a cancelled state
Build cancelled by the user immediately
Build cancelled shown on listing page
Reference #9100