Skip to content

Bug 1428647: disable BMO-specific extensions - #196

Open
topunix wants to merge 1 commit into
bugzilla:mainfrom
topunix:bug-1428647
Open

topunix wants to merge 1 commit into
bugzilla:mainfrom
topunix:bug-1428647

Conversation

@topunix

@topunix topunix commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Bug 1428647: disable BMO-specific extensions

Disables the extensions that only make sense on bugzilla.mozilla.org by adding a 'disabled' marker, per comment 0: BMO, GuidedBugEntry, MozProjectReview, REMO, OrangeFactor, PhabBugz, ZPushNotify, ContributorEngagement.

Kept enabled (generic or depended on by generic extensions): Push (Webhooks depends on it), TrackingFlags (BugModal and BugmailFilter depend on it), Review, UserStory, and the remaining generic extensions. TagNewUsers, Profanivore, Bitly and BzAPI are borderline and left enabled; happy to disable any of them.

Core decoupling required to run without BMO

BMO monkey-patches methods onto core classes in its BEGIN block (Extension.pm lines 89-110), and several core call sites used them unconditionally. Each call site now checks ->can() first, following the same pattern as the secure_mail guard in PR #183:

  • Bugzilla/Bug.pm: per-product default hw/os on create; group_always_settable at both call sites. With BMO off, the fallback is exactly upstream behavior (only group_is_settable is checked), so no access is widened.
  • enter_bug.cgi: default_platform/default_op_sys. Without this, Enter Bug returned a 500 with BMO disabled.
  • Bugzilla/WebService/Product.pm: default_platform, default_op_sys and default_security_group are only included in Product.get output when available.
  • extensions/BugModal/lib/WebService.pm and bug_modal/groups.html.tmpl: skip the default security group logic and the "Restrict access" checkbox when there is no default security group.

The alternative would be core default stubs for these methods, with BMO overriding them under no warnings 'redefine'. I went with call-site guards to avoid adding new core API, but can switch if you prefer that approach.

Other fixes uncovered by disabling BMO

  • Profanivore used HTML::Tree without importing it (it was only loaded as a side effect of BMO). Added the import; Config.pm already declares the dependency.
  • report_invalid_date is thrown by core Bugzilla/Util/DateTime.pm but was only defined in BMO's error hook. Moved the definition into core user-error.html.tmpl.
  • WebService/User.pm: avoid an uninitialized warning when phabricator_base_uri is unset.
  • The guided-entry links on the core create page pointed at BMO and GuidedBugEntry pages. Moved them into BMO's bug/create/create-end hook so they only appear when BMO is enabled.

Test infrastructure

  • scripts/entrypoint.pl: skip generate_bmo_data.pl when BMO is disabled.
  • qa/config/generate_test_data.pl: made idempotent for priority/platform values, dropped the BMO-only product columns from the insert (the values passed were always NULL), guarded the security_group_id update, and set useclassification (previously only set by the BMO seed).
  • Bugzilla/Test/MockDB.pm: only insert the BMO product columns when they exist.
  • t/mock-params.t: use core params instead of PhabBugz params.
  • Selenium: BMO-only product form fields are only set when present (test_default_groups, test_edit_products_properties, test_votes); test_bmo_autolinkification and test_bmo_enter_new_bug skip when BMO is disabled.

Results

Merge-order notes

Not addressed (separate follow-ups if wanted)

  • search/search-instant.html.tmpl loads GuidedBugEntry's Mozilla product list and defaults to Firefox. A proper fix needs a rewrite to pull products from the API, which overlaps bug 1472565.
  • t/bmo/bounced-emails.t calls BAIL_OUT without importing it, and test_sanity does not wait for the database. Both pre-existing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant