Closed Bug 920242 Opened 11 years ago Closed 11 years ago

Ember.show's flags field isn't honouring inclusion/exclusion

Categories

(bugzilla.mozilla.org :: API, defect)

Development
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: erik.bryn, Assigned: glob)

Details

Attachments

(1 file, 1 obsolete file)

Example API response: https://bugzilla-dev.allizom.org/rest/ember/show/843627 Existing UI: https://bugzilla-dev.allizom.org/show_bug.cgi?id=843627 There are several flags (7 by my count) with names prefixed by `flashplayer` that don't display in the existing Bugzilla UI but are being returned in the `values` array of the `flags` field.
Assignee: nobody → glob
Summary: More flags returned in Ember.show API response than are selectable in existing UI → Ember.show's flags field isn't honouring inclusion/exclusion
Attached patch 920242_1.patch (obsolete) — Splinter Review
for /show, this was reasonable straight forward. for /create we have to return all flags valid for the product, along with inclusions and exclusions so ember can filter the list when a component is selected. /create's flag struct has been updated, there's now an optional "inclusions" and "exclusions" property. if "inclusions" is not returned, this can be treated as "include any components". if "exclusions" is not returned, this can be treated as "exclude no components". the structure of both inclusions and exclusions is the same: an array of hashs, with the component name in "component", and the component id in "component_id". example: { "can_request_flag" : true, "can_set_flag" : true, "description" : "Bug reviewed by the engineering team", "id" : 439, "inclusions" : [ { "component" : "Nanojit", "component_id" : "892" } ], "is_multiplicable" : false, "is_requestable" : true, "is_requesteeble" : false, "name" : "flashplayer-qrb", "type" : "bug", "values" : [ "?", "+", "-" ] }, in this case the "flashplayer-qrb" is only valid when the "Nanojit" component is selected. erik - i'm not sure if the component_id is useful to return .. let me know if you don't need it and i'll remove it, just returning an array of component names.
Attachment #809671 - Flags: review?(dkl)
Flags: needinfo?(erik.bryn)
Status: UNCONFIRMED → NEW
Ever confirmed: true
component_id is useless to the frontend since it doesn't receive a component_id anywhere else. Can you provide me with examples bugs with both `inclusions` and `exclusions` in the response? Not sure I'm totally following how they work.
Flags: needinfo?(erik.bryn)
Attachment #809671 - Attachment is obsolete: true
Attachment #809671 - Flags: review?(dkl)
as this information is only returned by the create call, i can't provide example bugs. the product 'mozilla.org' has a nice mix of flags with inclusions and exclusions at a component level. example showing the updated structure (just an array of component names): { "can_request_flag" : true, "can_set_flag" : true, "description" : "Used to ask the security team to look over a feature or bug.", "exclusions" : [ "Security Assurance: Applications", "Security Assurance: Incident", "Security Assurance: Operations", "Security Assurance", "Security Assurance: Review Request" ], "id" : 791, "is_multiplicable" : false, "is_requestable" : true, "is_requesteeble" : true, "name" : "sec-review", "type" : "bug", "values" : [ "?", "+", "-" ] }, at a component level (which is where we're working here) it doesn't make any sense to return _both_ inclusions and exclusions, as that's the same as just inclusions. i'll address that in a revised patch. so the possible combinations will be: neither inclusions or exclusions: - flag is applicable to all components inclusions but not exclusions: - flag is applicable to the included components only exclusions but not inclusions: - flag is applicable to all components, except the excluded ones
Attached patch 920242_2.patchSplinter Review
Attachment #809988 - Flags: review?(dkl)
Comment on attachment 809988 [details] [diff] [review] 920242_2.patch Review of attachment 809988 [details] [diff] [review]: ----------------------------------------------------------------- r=dkl
Attachment #809988 - Flags: review?(dkl) → review+
Pushed to bugzilla-dev so Erik can start banging on it: Committing to: bzr+ssh://dlawrence%40mozilla.com@bzr.mozilla.org/bmo/4.2-dev modified extensions/Ember/lib/WebService.pm Committed revision 8563. Will let you do the prod commit when ready. dkl
Committing to: bzr+ssh://bjones%40mozilla.com@bzr.mozilla.org/bmo/4.2/ modified extensions/Ember/lib/WebService.pm Committed revision 9041.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: