-
Notifications
You must be signed in to change notification settings - Fork 3
Bugzilla adapter #7
Comments
https://api-dev.bugzilla.mozilla.org/latest/bug/1013525?include_fields=_default,comments Attachments with image content type could be embedded in description at the bottom.
Will need an optional link back to original report (probably just in the body somewhere)
So then build up an object from those parts and we'll need a new method to post comments from the
|
The new shiny API is at |
Thanks @karlcow. |
I took the freedom to edit the first comment and add a bit of structure and documentation.
I wonder if we need a
Or do we need to format in advance into the appropriate format for issue-importer.py. Aka if not in the right format, issue-importer is bailing out.
Or maybe you had a 3rd option in mind. :) |
Some progress going on. |
This is not yet operational but in good progress. I would say that there are a couple of details to fix.
The real data being returned by the mozilla_adapter are:
|
I think if we have some confidence about the UA string, we can add a browser label. We could map [sitewait], [contactready], to "sitewait" and "contactready" labels as well. We don't currently have a notion of "serversniff" and "clientsniff" on webcompat.com but we can discuss adding that, especially when we get to webcompat/webcompat.com#172. And +1 for "imported". We should make this a non-optional label (or add it ourselves if it's missing). |
Whoops, forgot to respond to #7 (comment). 😢
Hmm, it's hard to say which approach is better. I like the idea of having a standalone program to do the conversion, so you could just pipe or xargs in the transformed data, or use it as part of a workflow in other tools for exporting from bug sources/trackers. But I don't think it really matters--the other option is also good, we just have to pick one and document it. :)
I think this would have to be a requirement for either approach (the JSON schema validation should catch this). |
@miketaylr About labels. I wonder if a JSON schema can have predefined list of values. I need to study this :) I will get away from the hardcoded to have something more generic for the complete code. |
@miketaylr about import approach. I'm sticking for now with your original choice:
I decided to add a parameter The other strategy would have been to have a fixed format for the issue JSON and the responsibility of other companies to export in a specific format. |
It can, see https://github.com/webcompat/issue-importer/blob/master/importer/schema.py#L30 and https://github.com/webcompat/issue-importer/blob/master/importer/__init__.py#L110. Essentially if you have an "enum" key in the schema you can restrict the set of valid values (which is what I think you're asking). http://json-schema.org/example2.html has a few examples of this. |
OK. No matter I turn it. It's currently impossible to receive the bug and its comments in 1 HTTP request. On the good side of the news is that I can minimize the JSON I want from bugzilla to just what I need. For example, if we request:
Then the JSON we receive in return is:
Which is kind of cool. For getting the comment I need an additional request. All of this seem unrelated to the Adapter. So When writing the adapter I was wondering if I should take care of getting the description (aka getting the comments) of the bug in the adapter. After thinking about it for a little while I would prefer to have a more or less complete JSON file for a bug. Then the secondary question: Is the body mandatory aka description of the bug. If we consider yes, then we have an additional issue. Sometimes the description is not useful. It's why we created the tags "description" and "suggested fix" for simplebug. It means we will need to work on a bug exporter too. :) Opinions? There is another question about architecture. I will open a separate issue. |
Created the new issue about the architecture |
The comments have this format.
|
Yeah good point. Garbage in, garbage out. You could imagine something nice like a web app that gave you a preview of what your imported bug would look like with some contenteditable fields (or whatever) that allowed you to edit them and save the edited bug to disk. Maybe a cool student or intern project. :)~ |
A bugzilla adapter will take as an input a json bug from the HTTP api of bugzilla and convert it, prepare it for sending it to github. Example
This might depend on other issues: Let's put issue numbers beside
The current documentation of the API is documented in two places:
Some examples:
https://bugzilla.mozilla.org/rest/bug/35
The text was updated successfully, but these errors were encountered: