-
-
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
Create better status for concurrency-limited & duplicated builds #9100
Comments
So, I actually think "Triggered" isn't too bad. To the user, "Triggered" vs "Queued" is still effectively "Your build will be attempted soon". To me, this doesn't feel like an important designation as we've mostly reduced the time builds sit around before being accepted by a builder. So, "Triggered" feels like it's mostly gone away and "Queued" is the state we're talking about here. And it feels safe to lump both into one state. I would agree that "Triggered" is not ideal though. I've advocated for "Queued" instead of "Triggered" for a few of the reasons here. I am treating "Triggered" as "Queued" visually for now in fact, and will soon release something closer to: I agree surfacing build metadata would be a UX improvement though, but I think that our previous conversations here were on the right track: The issue that we have with errors now is that the logic to determine if a build had an error is template logic 😬. These really should be some model state so that I can include basic conditional elements in multiple templates. For example, if we wanted to show some error states on the build listing, I would inspect the build error objects attached to the build:
I actually noticed that after a minute, concurrency limited builds are failed: Notice the timeframes on the right, it seems to happen after a minute or two. That's definitely not a great designation for a build that will be retried.
Agreed, this also feels odd. I would probably want to show this as "Cancelled". With attached build error metadata, we could visually show a project that failed because of a user build error vs one that failed because of an application error, all by inspecting the build error classes attached: So immediately, I feel like work might be:
|
I agree with @agjohnson that One thing that I'd like to simplify and unify is the usage of
This won't require checking
We talked about where and why (state, and status) in #7123 (comment) which could help to have some context here. Basically, I'm proposing to expand |
I agree with all of that! 👍 Edit: I thought there was a naming discrepancy with the above plan wrt state/status, but I think we actually have differing plans here. I do agree that there are some more immediate fixes we can make on this issue though. But given the above discussion, maybe we just pick solutions that aren't at odds with our more complete vision. So, perhaps let's find a middle ground for the fixes for this issue first? I'll open up an issue to continue this particular conversation, and let's revisit this in a sprint. I think we have really good plans here, and think we just need to formulate a plan to bring everything together. Perhaps it makes sense to talk through new build errors and build status all at once?
|
I'm not sure what's the immediate change wanted on this issue. It seems the change required will be dictated by the decision made in the linked issues about the new states. I think we have two separate issues here:
It seems that we are all in agreement about renaming
This issue won't be solved by renaming @agjohnson @ericholscher what's the wanted/required next action for this issue? |
I think we jumped right into refactoring where are refactor really isn't needed right now. To add a duplicated status, we only need to add |
@agjohnson I'm not sure to follow you here. We are already setting the
That code makes the UI show the message "Error: Duplicated build". However, @ericholscher's concern is about marking a duplicated build as failed ( |
Whoops, I wasn't paying close attention, my example was not the full example I meant to give 🙃
I meant to say add a `Build.state = "cancelled", so:
I think So eventually, there is also:
etc |
This is just a POC to show some of the work involved in #9100
I'm still confused and I'm not sure what's the work expected. In particular, because this involves UI changes and I'm not sure how we want to visualize them.
That said, do we want to do this work now and discard it in the next months when we release ext-theme? Is there a big difference between "Build cancelled. Duplicated build" (this change proposed) vs. "Build failed. Error: Duplicated build" (current implementation) that is worth this effort? I opened a POC showing some of the changes required as an example, but I wasn't able to make the JS work, tho. See #9145 |
Also, note that "duplicated builds" feature is under a feature flag and we weren't able to remove it yet because #7306 (comment). So, I think the easiest path to move forward is to remove duplicated builds for all users until it works properly and we have the UI implemented in the ext-theme properly. |
Long term, this is sort of close to what I'm describing too, but I think that refactor is either far out or just a straight up no-go. Short term, I think we work with what we have and don't change any patterns around. So for that, I don't think we should use a different pattern to describe build state. We use Also, The main issue is the Long term, we can continue discussion about whether it makes sense to move
Do we want to wait until the old dashboard templates are deprecated? I'm guessing no, and would probably lean towards just surfacing the state in a beta of the new templates. But we still need to add the model field value and store it in the builder code. Our old templates will need to compensate for this and skip the state. This is where I would point back to abstracting Build data through an abstract class or using Build model methods to translate Build data. The check for finished builds should almost certainly be a model method at this point, and would allow for: class Build:
def is_finished(self):
if settings.RTD_EXT_THEME_ENABLED:
return self.state == "finished"
else:
return self.state in ["finished", "cancelled"] Either way, it would be incredibly wise to discontinue hard coding values in templates, which is another reason this change is more complicated than it needs to be. |
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
I updated my initial draft PR in #9145 which covers this. Let's continue the conversation for the details on that PR. |
I'm closing this issue because the actionable from it was already done in #9145. Besides, there are other issues opened to track the other parts required in the backend and in the frontend. Feel free to re-open if you consider there is more work required here. |
Currently when a build is concurrency limited it looks like this:
And on the list screen:
This is not communicating to the user the actual state of things. This build isn't waiting to run, it's delayed because of a concurrency limit. We should be communicating this more clearly to users.
Similarly, duplicated builds are marked as failed:
This makes the user think something went wrong, but the build was actually just cancelled. This should be communicated to the user in a nicer way as well.
Implementation
We could either add new statuses for these outcomes, or just change the display of the status based on the failure message. I don't feel strongly here, but it seems like an actual status is the most clear.
The text was updated successfully, but these errors were encountered: