Skip to content
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

Resurrect patches from unstable branch #44

Closed
wants to merge 19 commits into from

Conversation

CyberShadow
Copy link
Member

I ran a git filter-branch on a part of the old unstable branch to make cherry-picking easier. I'm including mostly my own commits, but more commits from the unstable branch can thus be resurrected from here (let me know if you would like me to add any particular ones):
https://github.com/CyberShadow/bmo/commits/unstable-reformatted

The commits here have all been previously reviewed (see the pull request references added by GitHub in the commit messages) and theoretically don't need further review but practically need to be retested due to bitrot (or e.g. mistakes during merge conflict resolution).

Opening as draft until I can test this as part of a full test deployment.

CyberShadow and others added 19 commits June 24, 2020 00:35
Fix a hard dependency on the BMO extension.

order_columns is set in Bugzilla::Extension::BMO, which might not be
present / loaded.
The default_platform and default_op_sys Bugzilla::Product methods are
installed by the BMO extension, so don't attempt to invoke them when
it isn't present.
* instant-search.js: Don't fail if product map isn't loaded

getProduct had a hard dependency on the 'products' object, which is
provided by products.js from the GuidedBugEntry extension.

Check if the products variable exists before attempting to use
it. This can happen when loading products.js fails, which in turn can
happen when the GuidedBugEntry extension isn't present.

* Instant search: Don't load products.js without GuidedBugEntry

Fixes a 404 if the GuidedBugEntry extension is not present.

* instant-search.js: Use throbber.gif from core

Fixes remaining dependency on GuidedBugEntry.
@CyberShadow
Copy link
Member Author

Basic functionality seems to be working.

@CyberShadow CyberShadow marked this pull request as ready for review June 24, 2020 21:09
@CyberShadow
Copy link
Member Author

I'm seeing some test failures (some caused by patches in this PR, some not), will go through those first.

Copy link
Member

@dylanwh dylanwh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`Found one small bug

@@ -7,5 +7,5 @@
#%]

[% PROCESS global/redirect.html.tmpl
url = "https://developer.mozilla.org/docs/Mozilla/QA/Bug_writing_guidelines"
url = "[% terms.BugWritingGuidelinesURL %]"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
url = "[% terms.BugWritingGuidelinesURL %]"
url = terms.BugWritingGuidelinesURL

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I saw you fixed this previously in 01732ce :) I will apply that here.

Copy link
Member

@dylanwh dylanwh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The guard on extensions is wrong. $recurse doesn't get reset when we early-return from the function. I've suggested changing this to a package-scoped localized variable, which should work better.

@@ -124,6 +125,14 @@ sub template_inner {
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
our $in_extensions = 0;

# (through this method or has_extension).
# The extension list is not fully populated at that point,
# so the results would not be meaningful.
state $recursive = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
state $recursive = 0;

# The extension list is not fully populated at that point,
# so the results would not be meaningful.
state $recursive = 0;
die "Recursive attempt to load/query extensions" if $recursive;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
die "Recursive attempt to load/query extensions" if $recursive;
die "Recursive attempt to load/query extensions" if $in_extensions > 0;

@@ -133,9 +142,20 @@ sub extensions {
push @$extensions, $package;
}
}
$recursive = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$recursive = 0;

# so the results would not be meaningful.
state $recursive = 0;
die "Recursive attempt to load/query extensions" if $recursive;
$recursive = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$recursive = 1;
local $in_extensions = $in_extensions + 1;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, applied these in #66

@CyberShadow
Copy link
Member Author

I have now resubmitted some of these as individual pull requests, and will resubmit the rest once their prerequisites are merged (#65 and #66).

@CyberShadow CyberShadow closed this Oct 4, 2020
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.

2 participants