Opened 16 years ago
Closed 15 years ago
#332 closed defect (fixed)
Viewing a previously-invalidated build shows it as "Pending"
Reported by: | manu.blot@… | Owned by: | osimons |
---|---|---|---|
Priority: | major | Milestone: | 0.6 |
Component: | General | Version: | dev |
Keywords: | Cc: | ||
Operating System: | BSD |
Description (last modified by dfraser)
from branches/experimental/trac-0.11
How to Reproduce
While doing a GET operation on /build/pocket_demo-release/419, Trac used to issue an internal error (as originally reported: KeyError: 'P'). Since r580, it simply shows the build as "Pending", which is not entirely true...
Web action sequence to reproduce:
- Select the builds status view
- Select a build result
- Invalidate the build
- Click the back button on the browser to revert to the builds status overview
-> the build is displayed as Pending
Request parameters:
{'config': u'pocket_demo-release', 'id': u'419'}
Attachments (0)
Change History (7)
comment:1 Changed 16 years ago by ebray
comment:2 Changed 16 years ago by manu.blot@…
But it might be a good idea to provide a nicer error message.
I think it would be better to redirect to the build overview page:
- it would provide a better user experience
- it would be somewhat consistent with other parts of Trac: for example, if a user deletes a wiki page, he does not end up on an error page, but on the wiki start page.
comment:3 Changed 16 years ago by ebray
But when you invalidate a build, at least in my instance, it redirects to the build list for that configuration. You only get the error if you click the back button the build itself, and only if your browser hasn't cached the page and tries to reload it. If the build hasn't started, it should just say as much instead of giving an obscure-looking error message.
comment:4 Changed 16 years ago by manu.blot@…
Yeah, I think you're right, I'm trying to address an issue at the wrong level:
I would not have to click on the back button if it was possible to invalidate a build without requesting the build details - this is unfortunately not yet possible. This is a usability issue, which is already tracked with another ticket.
comment:5 Changed 16 years ago by dfraser
- Description modified (diff)
- Summary changed from KeyError: u'P' to Viewing a previously-invalidated build shows it as "Pending"
Not having seen this issue, I committed a patch which simply shows the status as "Pending" (see r580). This also lets you click on Invalidate this build, which of course does nothing ...
This is still an improvement on getting the crazy error message, so I'll leave it in for now, but adjust the summary
comment:6 Changed 15 years ago by osimons
- Owner changed from cmlenz to osimons
I've looked at this, and the current logic seems mostly fine by me. Invalidate a build and you are now redirected to the overview page.
However, if you access the build anyway directly (no link for it will show in UI) it still has the 'Invalidate build' button that should not really be displayed for builds that have not yet been started or already have been invalidated (as mentioned in comment:5).
I suggest just removing the button, and then this ticket looks ready to close as far as I can tell:
-
bitten/web_ui.py
a b 507 507 step) 508 508 }) 509 509 data['build']['steps'] = steps 510 data['build']['can_delete'] = ('BUILD_DELETE' in req.perm) 510 data['build']['can_delete'] = ('BUILD_DELETE' in req.perm \ 511 and build.status != build.PENDING) 511 512 512 513 repos = self.env.get_repository(req.authname) 513 514 repos.authz.assert_permission(config.path)
Anything I've missed?
comment:7 Changed 15 years ago by osimons
- Resolution set to fixed
- Status changed from new to closed
I've committed the small patch in [666] (scary), and don't think there is more to do with this ticket. Closing.
Ah, I've seen this happen sometimes. It's in some sense the expected behavior, since you're trying to view the status of a build that hasn't started yet (which is essentially the state it reverts to when you invalidate it). But it might be a good idea to provide a nicer error message.