The "TypeError: Cu.import(...).RecipeRunner.checkFilter is not a function" error is returned when testing Normandy filters
Categories
(Firefox :: Normandy Client, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | unaffected |
firefox69 | --- | unaffected |
firefox70 | --- | unaffected |
People
(Reporter: cmuresan, Unassigned)
References
Details
(Keywords: regression)
Attachments
(1 file)
15.54 KB,
image/png
|
Details |
[Affected Platforms]:
- All Windows
- All Mac
- All Linux
[Affected Versions]:
- Firefox Nightly 70.0a1, Build ID 20190822095439
[Prerequisites]:
- Have the
devtools.chrome.enabled
set totrue
.
[Steps to reproduce]:
- Open the browser with the profile from prerequisites.
- Open the Browser Console and paste the following snippet:
Cu.import("resource://normandy/lib/RecipeRunner.jsm", {})
.RecipeRunner.checkFilter({
id: 1,
arguments: {},
filter_expression:( normandy.country == 'RO' && normandy.channel == 'nightly' && normandy.locale in ['en-US'] )
,
})
.then(result => console.log(result)) - Press enter and observe the output.
[Expected result]:
- The snippet returns
true
orfalse
depending if the profile meets the filters.
[Actual result]:
TypeError: Cu.import(...).RecipeRunner.checkFilter is not a function
is displayed instead.
[Regression Window]:
13:57.51 INFO: Narrowed inbound regression window from [6385ede0, 3e0d79dd] (3 builds) to [8db08682, 3e0d79dd] (2 builds) (~1 steps left)
13:57.52 INFO: No more inbound revisions, bisection finished.
13:57.52 INFO: Last good revision: 8db0868227e62019577296789fea5952810fe7c0
13:57.52 INFO: First bad revision: 3e0d79dd1de284de827b372abd0e89ac0c87eb09
13:57.52 INFO: Pushlog:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=8db0868227e62019577296789fea5952810fe7c0&tochange=3e0d79dd1de284de827b372abd0e89ac0c87eb09
I wasn't able to get to a single bug, but bug 1548631 seems to be related.
[Notes]:
- I have attached a screenshot of the issue:
@mythmon, could you please take a look at this?
Reporter | ||
Updated•5 years ago
|
Comment 1•5 years ago
|
||
:cmuresan, since this bug is a regression, could you fill (if possible) the regressed_by field?
For more information, please visit auto_nag documentation.
Comment 2•5 years ago
|
||
The pasted code is incorrect. As of bug 1431533, Cu.import
should be replaced with ChromeUtils.import
.
Comment 3•5 years ago
•
|
||
Sorry, my last message was a but hasty.
The problem is not the ChromeUtils
/Cu
, like I said in my last comment. The problem is that in bug 1548631, the checking of if a recipe should run got more complicated. The function that should be run is now shouldRunRecipe
. Here is a full, modern example:
await ChromeUtils.import("resource://normandy/lib/RecipeRunner.jsm").RecipeRunner.shouldRunRecipe({
id: 1,
arguments: {},
filter_expression: "( normandy.country == 'RO' && normandy.channel == 'nightly' && normandy.locale in ['en-US'] )",
})
Comment 4•5 years ago
|
||
Can you take this on? Happy to take a patch for 70.
Comment 5•5 years ago
|
||
I don't believe there is a problem with the code here, but with the code sample that Ciprian used. If that's not the case, I'd be happy to reopen this. Ciprian, can you test the code I wrote in comment 3?
Reporter | ||
Comment 6•5 years ago
|
||
Yes the new code sample works. Thanks! Sorry for not responding sooner, it slipped my mind.
We'll update our docs with this new one.
Updated•5 years ago
|
Description
•