Add HTML Fragments Preprocessor function to build system
Categories
(Firefox Build System :: Toolchains, enhancement)
Tracking
(firefox102 fixed)
| Tracking | Status | |
|---|---|---|
| firefox102 | --- | fixed |
People
(Reporter: bigiri, Assigned: bigiri)
References
(Blocks 4 open bugs)
Details
Attachments
(1 file)
Implement a function in the mach build system that can be used on a per directory basis to convert XHTML files into a JS file that can load HTML fragment strings in JS. The generated JS file should take a string key and return an HTML string. It must be able to return strings that have no root element. Input XHTML files must support standard XHTML as defined in http://www.w3.org/1999/xhtml, and XUL as defined in http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul
The format for the key to retrieve the HTML strings must be consistent and easy to understand. The mach build function must take a set of XHTML files and generate this JS file with the HTML retrieval function. The generated JS file should be flexible enough to be combined with other such files if necessary, for consistent use within Firefox.
See: Bug 1768875 for details
| Assignee | ||
Comment 1•3 years ago
|
||
Created GeneratedFile method implementing HTML Fragment Preprocessor.
Usage in a moz.build file would be as follows
GeneratedFile(
"example.js",
script="/python/mozbuild/mozbuild/action/html_fragment_preprocesor.py",
entry_point="generate",
inputs=["example_a.xhtml", "example_b.xhtml"],
)
Example XHTML files for testing are in python/mozbuild/mozbuild/test/action/data/html_fragment_preprocesor/
Updated•3 years ago
|
Updated•3 years ago
|
| Assignee | ||
Updated•3 years ago
|
Comment 3•3 years ago
|
||
Backed out for causing python failures on test_html_fragment_preprocessor.py.
Failure log: https://treeherder.mozilla.org/logviewer?job_id=378875045&repo=autoland
Backout link: https://hg.mozilla.org/integration/autoland/rev/201e6aaf2fc800e42f668d8434b64e2749508ae0
[task 2022-05-21T18:54:56.810Z] python/mozbuild/mozbuild/test/action/test_html_fragment_preprocessor.py::TestNode::test_get_html_fragments_from_file_multiple_templates PASSED
[task 2022-05-21T18:54:56.810Z] python/mozbuild/mozbuild/test/action/test_html_fragment_preprocessor.py::TestNode::test_get_html_fragments_from_file_with_xul TEST-UNEXPECTED-FAIL
[task 2022-05-21T18:54:56.810Z] python/mozbuild/mozbuild/test/action/test_html_fragment_preprocessor.py::TestNode::test_get_html_fragments_from_named_template_with_html_element PASSED
[task 2022-05-21T18:54:56.810Z] python/mozbuild/mozbuild/test/action/test_html_fragment_preprocessor.py::TestNode::test_get_html_fragments_from_template_no_doctype_no_name PASSED
[task 2022-05-21T18:54:56.810Z] python/mozbuild/mozbuild/test/action/test_html_fragment_preprocessor.py::TestNode::test_get_html_fragments_from_template_with_doctype PASSED
[task 2022-05-21T18:54:56.810Z]
[task 2022-05-21T18:54:56.810Z] =================================== FAILURES ===================================
[task 2022-05-21T18:54:56.810Z] _____________ TestNode.test_get_html_fragments_from_file_with_xul ______________
[task 2022-05-21T18:54:56.810Z] python/mozbuild/mozbuild/test/action/test_html_fragment_preprocessor.py:135: in test_get_html_fragments_from_file_with_xul
[task 2022-05-21T18:54:56.810Z] + '<html:slot xmlns:html="http://www.w3.org/1999/xhtml" />',
[task 2022-05-21T18:54:56.810Z] E AssertionError: '<htm[179 chars]xul" flex="1" id="label-box" part="label-box" [251 chars]" />' != '<htm[179 chars]xul" id="label-box" part="label-box" flex="1" [251 chars]" />'
[task 2022-05-21T18:54:56.811Z] E - <html:link xmlns:html="http://www.w3.org/1999/xhtml" href="chrome://global/skin/example.css" rel="stylesheet" /><hbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" flex="1" id="label-box" part="label-box" role="none"><image part="icon" role="none" /><label crop="right" flex="1" id="label" part="label" role="none" /><label crop="right" flex="1" id="highlightable-label" part="label" role="none" /></hbox><html:slot xmlns:html="http://www.w3.org/1999/xhtml" />
[task 2022-05-21T18:54:56.811Z] E + <html:link xmlns:html="http://www.w3.org/1999/xhtml" href="chrome://global/skin/example.css" rel="stylesheet" /><hbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="label-box" part="label-box" flex="1" role="none"><image part="icon" role="none" /><label id="label" part="label" crop="right" flex="1" role="none" /><label id="highlightable-label" part="label" crop="right" flex="1" role="none" /></hbox><html:slot xmlns:html="http://www.w3.org/1999/xhtml" />
[task 2022-05-21T18:54:56.811Z] ========================= 1 failed, 8 passed in 0.14s ==========================
[task 2022-05-21T18:54:56.811Z]
[task 2022-05-21T18:54:56.811Z]
[task 2022-05-21T18:54:56.811Z] Tests Completed: 100%|██████████| 78/78 [04:23<00:00, 3.38s/Test]Return code from mach python-test: 1
[task 2022-05-21T18:54:56.861Z]
[taskcluster 2022-05-21T18:54:56.918Z] Exit Code: 1
[taskcluster 2022-05-21T18:54:56.918Z] User Time: 12m51.811477s
[taskcluster 2022-05-21T18:54:56.918Z] Kernel Time: 8m6.986146s
[taskcluster 2022-05-21T18:54:56.918Z] Wall Time: 7m24.131431s
[taskcluster 2022-05-21T18:54:56.918Z] Result: FAILED
[taskcluster 2022-05-21T18:54:56.918Z] === Task Finished ===
[taskcluster 2022-05-21T18:54:56.918Z] Task Duration: 7m24.136093s
[taskcluster 2022-05-21T18:54:56.918Z] [mounts] Preserving cache: Moving "/opt/worker/tasks/task_165315487733076/checkouts" to "/opt/worker/cache/OXZrN1zKQcSObWMlgApb0A"
[taskcluster 2022-05-21T18:54:56.983Z] Uploading redirect artifact public/logs/live.log to URL https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/U4H5aXRcRyCzwWq4cBUtsw/runs/0/artifacts/public%2Flogs%2Flive_backing.log with mime type "text/plain; charset=utf-8" and expiry 2023-05-21T18:46:48.214Z
[taskcluster:error] exit status 1
Updated•3 years ago
|
Updated•3 years ago
|
| Assignee | ||
Comment 4•3 years ago
|
||
The updated patch now passes in treeherder. https://treeherder.mozilla.org/jobs?repo=try&revision=2eaad58075629b17a569215ab4146b4f195f9eae
Updated•3 years ago
|
Comment 6•3 years ago
|
||
| bugherder | ||
Description
•