Modify

Opened 8 years ago

Last modified 7 years ago

#625 assigned enhancement

Integrate Trac tickets with Perforce jobs

Reported by: lewisbaker Owned by: ttressieres
Priority: normal Component: PerforcePlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

It would be quite useful to be able to replicate ticket information from Trac in Perforce's builtin jobs so that developers can use the standard p4 command line tools to:

  • update ticket information (p4 jobs)
  • associate changes with tickets (p4 fix)
  • query whether the fix for a ticket is present on a specified branch (p4 fixes)

Perforce already supports altering the status of a job when an associated change is submitted. Hooking into this would reduce the need for developers to remember to enter information in two different systems (Trac and Perforce).

Attachments (2)

__init__.py (1.5 KB) - added by ttressieres 8 years ago.
init file of PyPerforce patch
objects.py (30.5 KB) - added by ttressieres 8 years ago.
objects.py file of PyPerforce patch

Download all attachments as: .zip

Change History (10)

comment:1 Changed 8 years ago by ttressieres

  • Owner changed from lewisbaker to anonymous
  • Status changed from new to assigned
  • Trac Release changed from 0.9 to 0.10

i'm near from a solution

comment:2 Changed 8 years ago by ttressieres

  • Owner changed from anonymous to ttressieres
  • Status changed from assigned to new

comment:3 Changed 8 years ago by ttressieres

see first version here

comment:4 follow-up: Changed 8 years ago by ttressieres

  • Status changed from new to assigned

comment:5 in reply to: ↑ 4 Changed 8 years ago by ybrygas@…

Replying to ttressieres:
Hi.
I've tried to use this scripts and I've been expiriencing some problem. I've got this error while running this script:

Traceback (most recent call last):
  File "p4_trac_jobs.py", line 415, in ?
    ticket.mainLoop()
  File "p4_trac_jobs.py", line 380, in mainLoop
    self.tktperforce.updateTicket(p, self.mergedTickets[p])
  File "p4_trac_jobs.py", line 183, in updateTicket
    job = perforce.Job(self.p4, jobname)
AttributeError: 'module' object has no attribute 'Job'

It seems to me this error is related to this words:

Requirements

  • PyPerforce 0.3a1 with a patch for jobs

You can find this requirements here: http://trac-hacks.org/wiki/PerforceJobScript

I dont know where I should get this patch for jobs. Maybe I'm not right with this idea about PyPerforce patch, so tell me please what wrong with this script.

P.S.

My configuration:

  • python-2.4.3
  • Trac 0.10
  • PyPerforce-0.3a1-py2.4
  • TracPerforce-0.4.2-py2.4
  • perforceplugin-632.patch
  • PyProtocols-0.9.3-py2.4

comment:6 Changed 8 years ago by ttressieres

Hi, I've sent a mail to lewis baker to update the PyPerforce library. But by now it is not available, so i will attach the two files necessary for this script.

Changed 8 years ago by ttressieres

init file of PyPerforce patch

Changed 8 years ago by ttressieres

objects.py file of PyPerforce patch

comment:7 Changed 7 years ago by lewisbaker

The trunk of PyPerforce now has these changes integrated.

There is also a fix for the "'p4 jobs' outputs 2nd and subsequent jobs to 'records' instead of 'forms'" issue in there.

comment:8 Changed 7 years ago by lewisbaker

I would like to have a look at the new P4 Defect Tracking Gateway to see how easy it is to implement using that framework. It seems that a lot of the hard work might already be done by Perforce.

Add Comment

Modify Ticket

Action
as assigned The owner will remain ttressieres.
Author


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

 
Note: See TracTickets for help on using tickets.