Edgewall Software
Modify

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:

  1. Select the builds status view
  2. Select a build result
  3. Invalidate the build
  4. 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

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.

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:

  1. it would provide a better user experience
  2. 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  
    507507                                                step)
    508508            })
    509509        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)
    511512
    512513        repos = self.env.get_repository(req.authname)
    513514        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.

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain osimons.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.