Closed Bug 1517510 Opened 6 years ago Closed 6 years ago

Capstone: Update browser_all_files_referenced.js to check all shipped fluent files are referenced

Categories

(Firefox :: General, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
Firefox 67
Tracking Status
firefox66 --- wontfix
firefox67 --- fixed

People

(Reporter: Gijs, Assigned: berning5, Mentored)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

To do this, the following steps should help: 1. add `.ftl` to the list at https://searchfox.org/mozilla-central/rev/0ee0b63732d35d16ba22d5a1120622e2e8d58c29/browser/base/content/test/static/browser_all_files_referenced.js#600 . Probably worth indenting the list a bit nicer while we're there instead of having such a long line. (You could just run the test as a sanity check after this step - I'd expect it to flag up every single packaged .ftl file we have.) 2. add a block to `parseCodeFile` that checks for .ftl paths. That is, somewhere in this loop that does per-line checks: https://searchfox.org/mozilla-central/rev/0ee0b63732d35d16ba22d5a1120622e2e8d58c29/browser/base/content/test/static/browser_all_files_referenced.js#404 we need to add a regular expression looking for `/[a-z0-9_\/-]+\.ftl/i`, and set `urls` to an array of any found string, prefixed with "resource:///localization/en-US/". (or maybe `resource://app/localization/en-US/`, I'm not 100% sure) 3. Test, and add any unreferenced .ftl files to the list of exceptions at the top of the file. Note that in theory, there shouldn't be any unreferenced ftl files. I haven't tested this plan. I'm fairly confident that it's correct in the rough steps, but you'll probably run into issues which you'll need to debug. You can use the `info` helper function to log things (`info("Hello from the test")`). You can also add a `debugger;` statement in the JS and run the test as `./mach mochitest browser/base/content/test/static/browser_all_files_referenced.js --jsdebugger` . It'll break into the debugger when it hits the `debugger;` statement, at which point you can inspect variables etc. One more point of note is that after getting this to work, you'll need to also check that it works against a packaged build, which is what the test will run against on our test infrastructure. You can do this locally by first running: ./mach package and then running the test using: ./mach mochitest browser/base/content/test/static/browser_all_files_referenced.js --appname=dist to run against the packaged 'dist' build.
Priority: -- → P3
Assignee: nobody → berning5
Status: NEW → ASSIGNED
Pushed by gijskruitbosch@gmail.com: https://hg.mozilla.org/integration/autoland/rev/777d4b26e0b1 Checking if all shipped fluent files are referenced, r=Gijs
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 67
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: