-
Notifications
You must be signed in to change notification settings - Fork 60
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
Added template support for bug creation #103
base: master
Are you sure you want to change the base?
Conversation
A new bug can now be created using the supplied template file. The template file needs to contain all the required parameters needed by bugzilla. Optional fields can also be supplied.
I really like this feature, but I have a couple of suggestions. Please avoid bare except clauses, e.g. not "except:" but "except foo:" or "except foo as error:". Look at configfile.py for examples of this. You might document the template handling code a bit more. Why are you using RawConfigParser instead of ConfigParser? What is going on with the lambda (I'm not really familiar with lambda, so documenting this in particular would be useful). Thanks much. |
Thanks William, The RawConfigParser was used under the assumption that the custom fields can be in upper case. The default parser converts everything to lower case. The lambda just specifies that the key from the config should be kept as is. |
- Cleaned up exception handling code. - Added comment on config parsing code.
I traced the bug you cited above to the Bugzilla 3.0 release notes [1]. It looks like custom field names must be in lower case, so I think we can get away with using ConfigParser instead of RawConfigParser unless that has changed in newer releases. You might want to check the newer Bugzilla releases and update this p/r. Thanks for working on this. :-) [1] https://www.bugzilla.org/releases/3.0/release-notes.html |
Sure. Let me check with the owners on bz irc/mailing lists. |
According to https://www.bugzilla.org/docs/4.4/en/html/api/Bugzilla/WebService/Bug.html#search The fields themselves seem to be case insensitive. I'll revert it to regular ConfigParser. |
Bugzilla fields are always lowercased, so a raw parser to retain the case is not needed.
Hi William,
|
The [Default] section of the template seems a bit unclear. What is going on with the type setting? |
Typically bugs for the features/components have different owners, qa etc (infra/platform/os/ui/cli). There could have been two approaches to this:
In the type setting, one would just refer to the type/component of the bug they are going to create. And the same file will have multiple sections for the type of the bug. |
What happens if there are multiple sections in the template file? Do I have to edit the default section every time I want to use a different section? Also, what happens if there is no default section? |
Yes, default section have to be edited every time you want to use a different section. The file has to be edited each time to change the description and summary also. If the file doesn't have a default section, then it'll exit out. |
Please let me know if this patch works for you. |
ef36aef
to
2d8da16
Compare
This adds support for custom parameters in bugzilla modify. This needs to be given in form: key1=val:key2=val:...
A new bug can now be created using the supplied
template file. The template file needs to contain
all the required parameters needed by bugzilla.
Optional fields can also be supplied.