-
Notifications
You must be signed in to change notification settings - Fork 15
fileViewer: Create a directory view to navigate a report #176
Comments
Depends on mozilla/release-services#1161. |
There was a previous project that worked on this: https://github.com/mozilla/moz-coco/blob/master/src/queries/10-DirectoryDrillDown-Cov.js It used the |
On the front-end, this could be achieved by hooking into these lines: firefox-code-coverage-frontend/src/containers/fileViewer.jsx Lines 88 to 89 in 2695903
and implementing a new firefox-code-coverage-frontend/src/containers/fileViewer.jsx Lines 100 to 121 in 2695903
with table headers like, e.g.: <tr>
<th>Sub-Directory/File</th>
<th>Coverage</th>
</tr> |
And the back-end can provide a flat view of coverage for all files under a certain path, like so: https://activedata.allizom.org/tools/query.html#query_id=R3XCygfE Maybe the front-end can calculate per-immediate-subdirectory coverage by aggregating the coverage of all files under a given sub-directory. Or, if that's too compute-intensive on the client-side, maybe we could build another query that already groups by sub-directory instead of returning all the files recursively. |
There may be easier ways to do this: {
"from":"coverage",
"groupby":[{
"name":"subdir",
"value":{
"when":{"find":{"source.file.name":"/"},"start":5},
"then":{"between":{"source.file.name":[5,"/"]}},
"else":{"not_left":{"source.file.name":5}}
}
}],
"where":{"and":[
{"prefix":{"source.file.name":"mfbt/"}},
{"eq":{"repo.changeset.id12":"96f7c7e518ce"}}
]}
} https://activedata.allizom.org/tools/query.html#query_id=6e8tvR7z The |
The backend could also retrieve the list of directories from hgmo if it's not easy/clean to do it via a query. |
Thank you for this query! So I see that it returns: "data":[
["double-conversion",37],
["decimal",12],
["GuardObjects.h",6],
["MathAlgorithms.h",6],
["RefPtr.h",6],
["ThreadLocal.h",6],
["Vector.h",6],
["AlreadyAddRefed.h",5],
["Casting.h",5],
["DoublyLinkedList.h",5],
[null,310]
] How should I interpret this data to get a code coverage percentage? Additionally, codecov.io seems to have a lot more coverage data for mfbt/. Why are we missing so many files in ActiveData? Could the |
Sorry, that query was not meant to provide all the data you want, just to show we can do some string manipulation to get "directories" and files. Furthermore, it looks like it is incomplete; I missed the [null,310] line; and you are correct to assume it is showing all the records my |
We must add a |
@klahnakoski Thanks! I'll try that (but please feel free to post the amended query here if you have it mind, in case I haven't managed to guess it yet). |
Ok, I've gotten to this: "select":[
"subdir",
{
"name":"total_covered",
"value":"source.file.total_covered",
"aggregate":"sum"
},
{
"name":"total_uncovered",
"value":"source.file.total_uncovered",
"aggregate":"sum"
}
] https://activedata.allizom.org/tools/query.html#query_id=_dYkLjYt The result looks like this: "data":[
["double-conversion",null,83621,110451],
["decimal",null,15961,53534],
["RefPtr.h",null,25156,6746],
["ThreadLocal.h",null,2228,490],
["UniquePtrExtensions.h",null,559,38],
["AllocPolicy.h",null,1972,365],
["ArrayUtils.h",null,1889,40],
["BinarySearch.h",null,3992,782],
["GuardObjects.h",null,2316,0],
["Variant.h",null,17227,5582],
[null,null,558819,393875]
] Not sure where the second column comes from (it's all |
The
is asking for the "subdir" column in the coverage table, which there is none, so it is |
This query adds a https://activedata.allizom.org/tools/query.html#query_id=SAVvrgte |
Always add a https://activedata.allizom.org/tools/query.html#query_id=teAuwVKw |
Awesome, thanks @klahnakoski! |
The one thing that concerns me is the last row, the "null row", which catches everything not not covered by the https://activedata.allizom.org/tools/query.html#query_id=KoJZ8osX |
... but the last row is simply the sum of the others, which suggests the ES query responsible for counting the |
Note: Since the example revision https://activedata.allizom.org/tools/query.html#query_id=2lq0AhNB |
I integrated a new endpoint into the code coverage backend, using the ES cluster. To view a sub-directory/file: https://coverage.staging.moz.tools/v2/path?path=js/src/ You can also specify another changeset by using the |
@jankeromnes could you make the frontend use the staging endpoint just for this for now? |
Awesome, thanks! I've cleaned up my prototype and will try making it use the new staging endpoint. |
No description provided.
The text was updated successfully, but these errors were encountered: