Open jankeromnes opened 6 years ago
Exciting! I've requested a PR deployment (it should be active for 5 days since the last push).
Give me a heads up when you think this is closer to being ready to be reviewed.
Find a cleaner way to differentiate between "file" and "directory" (than relying on the final
/
)
This would be for free when you do:
Use Bastien's new https://coverage.staging.moz.tools/v2/path endpoint
Thanks for the feedback!
Instead of re-implementing a full separate DirectoryViewerContainer
component (with similar sub-components as FileViewerContainer
), I think there is a way to make FileViewerContainer
also fetch https://coverage.staging.moz.tools/v2/path, and then differentiate between file and directory in the render()
method directly.
This would address the first three items in the checklist.
This new commit is still very much work-in-progress, but it makes FileViewerContainer
fetch the new /v2/path
endpoint, and adds a bit of UI according to the results:
This could allow comparing ActiveData results with our new backend (but today, I don't think they are any revisions in common between both, so instead I'm fetching /v2/path
without a revision, which I believe gives me the latest available data).
EDIT: Note that I'll soon remove the pointless "raw file" view of the directory. I just kept it temporarily in order to compare results between hg.m.o / ActiveData / coverage.moz.tools (and for example, /v2/path
is missing some folders/files for which it has no data. Maybe we still want to list them in our view?)
Fixes #176.
This is a rough prototype showing per-directory coverage data:
It hijacks
Routes
by replacingFileViewerContainer
with a newDirectoryViewerContainer
component when the requested file path ends with/
(I'd like to find a cleaner solution to identify directories from files), and it uses an ActiveData query to aggregate coverage by sub-file and sub-folder (I'd like to switch to the faster https://coverage.staging.moz.tools/v2/path endpoint).TODO:
/
)fileViewer.jsx
anddirectoryViewer.jsx
This change is