User talk:Charley.wang.gmail.com

From Eclipsepedia

Jump to: navigation, search

Contents

How do I make Mylyn work with custom status transitions?

Pending bugs 259291 and 311966, Mylyn will have the ability to work with Bugzilla custom status transitions.

There are two ways to use this feature. The following screenshot shows both of the custom status transition options, 'Autodetect workflow' and 'Workflow description file' in the Repository preference page.

Eclipse mylyn usexmlrpc.png

Please note that for both options, tasks may have to be refreshed for the change to take effect.


Autodetect workflow (requires Bugzilla 3.6 or greater)

Using the XMLRPC API, Mylyn can automatically fetch information about valid transitions from the host Bugzilla. To enable this option, just check the Autodetect Workflow box in the Repository's preference page.

Tasks should now reflect the new status workflow. The limitation of this approach is that there is currently no way to identify the Duplicate Status or valid Start Statuses from XMLRPC alone.

Workflow description file

Using a workflow description file, it is possible to get full control over the workflow, duplicate status and start statuses. For descriptor file formatting, please see Mylyn/Bugzilla_Connector#Custom_Transitions

To enable this option, enter or browse the path to a valid descriptor file in the Repository's preferences page. Currently the workflow description file will supercede any information received from Bugzilla XMLRPC.

EGIt/JGit ignore testing


Successfully ignored


Tested Pattern
Target
Notes
x /*.st?
/test.stp

x /*.sta[0-9]
/test.sta1

x /*/*.c
/src/a.c

x /src/
/src
Where /src is a directory
x /src/
/src/new/a.c

x /src/
/src/a.c

x .stp
/test.stp
No "/" in pattern, match filename
x .stp
/src/test.stp
No "/" in pattern, match filename

 !/test.stp
/test.stp
/test.stp

x /src/new
/src/new/
Ignore folder
x /src/new
/src/new/a.c
Ignore contents of folder
x /src/new/
/src/new/a.c

x src
/src/a.c

x src
/src/new/a.c

x src /new/src/a.c
x new /src/new/a.c Ignore folder (name-only match)
x  ?rc /src/a.c
x  ?rc /src/new/a.c

/new/a/b1 /src/new/a/b1/*
x b1 /a/b1/*
x b? /a/b1/*
x

/a
/a.c (in /a)

/a/a.c Normally the negation in /a would
have higher priority, but the folder
ignore takes special priority.


Successfully not ignored (File added to parent's .gitignore)


Tested Pattern Target Notes
x /*.c /src/a.c * should not expand to '/'
x /src/new/asdf/ /src/new/asdf Ends with "/", only match dirs

/*.st?
!/test.stp

/test.stp Pattern + higher priority negation
x #/test.stp /test.stp Comment

 !/a.c

/src/a.c

/src/a.c Where !/a.c is in src/.gitignore

 !/test.stp

/test.stp
!/test.stp

/test.stp Negation chaining

Mylyn Custom Transitions

Principle: As per contributor guidelines, avoid changing Mylyn code whereever possible. In case of failure, fall back on Mylyn's original behaviour (even if that behaviour will not work)


Customization cases:

1. User changes workflow only (via editworkflow.cgi)

    - Can use original BugzillaOperation enum

    - Certain transitions are version-specific (e.g. reassignbycomponent) -- will have to add verifiers

2. User changes name of statuses in bug_status table

3. Other special user-settings -- e.g. the DUPLICATE action can have different end bug_statuses, unconfirmed status may or may not exist


'Proposed 'Workflow:

Front-end: User has selection box in Repository Preferences to choose a Transition Descriptor File (TDF), and a checkbox to specify that custom workflows are in use. By default, none of these are checked.

Back-end: If custom workflows are in use, Mylyn checks if TDF exists & is valid. If not, Mylyn then checks if XMLRPC is available & is valid. If either the TDF or XMLRPC are valid, parse their output and figure out the transition table. Render everything according to the transition table. If no custom transition table is available, use Mylyn's original default behaviour.


Plan:

Add IBugzillaOperation with two implementations -- the default BugzillaOperation enum that is already in use, and a new CustomBugzillaOperation. In addition to the current fields in BugzillaOperation, CustomBugzillaOperation needs to contain: Server String (i.e. operation that must be sent to the server when the user hits Submit), Version Verifier.

Use a TransitionManager that checks if a transition descriptor file or xmlrpc Bug.fields is available and uses available information to create a list of valid transitions. If the file or xmlrpc Bug.fields are not available, fall back on Mylyn default behaviour.


Approaching completion:

Patch for customization case #1


Next step:

JUnit testing of current patch. Fix existing issues. Add Transition Descriptor File selection box to Repository Preferences. Add XMLRPC communication.


Future:

I have a plan and a half-implemented patch for case #2, after which I will work on case #3.