-
Notifications
You must be signed in to change notification settings - Fork 202
MRVA: Export results to local markdown files #1344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
`Variant analysis results exported to \"${basePath}\".`, | ||
'Open exported results' | ||
); | ||
if (shouldOpenSummary) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an obvious way for a user to get access to the file itself? Presumably, if they create this file, they want to send it to someone. What is the simplest process for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, that's a good point. You can currently access the results files in the "query directory" from here:
That isn't at all obvious though 😅 Perhaps we could put all the results in a "exported results" subdirectory of the query directory, and then open that directory instead of just opening the summary file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would work. Could you do both? ie- open the markdown file as an editor as well as open the exported results directory? I think it's nice to see the prettified markdown version of the results.
queryHistoryManager: QueryHistoryManager, | ||
queryHistoryItem: QueryHistoryInfo, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: I see you are passing in two parameters here, queryHistoryManager
and queryHistoryItem
, only being used to get the basePath
. It might be simpler to get the basePath
outside of this function and pass it in as a parameter.
It cuts down on the # of parameters to this function by one, avoids an import
); | ||
for (const markdownFile of markdownFiles) { | ||
const filePath = path.join(basePath, `${markdownFile.fileName}.md`); | ||
await fs.writeFile(filePath, markdownFile.content.join('\n'), 'utf8'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested whether this works if you export multiple times? I think it should, but can't be bothered checking the docs 😬
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, right...one thing we're going to need to think about is exporting multiple times with different selections. Presumably, we are going to want to delete the old results before creating new ones. Is this something we can implement later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think we can worry about that a bit later on!
I specifically meant running the export multiple times e.g. maybe I forgot I already exported stuff and I tried it again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exporting the same thing multiple times works fine!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we technically overwrite the markdown files every time though 🤔 Would that be a problem? Perhaps we should check if the files exist first?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exporting the same thing multiple times works fine!
My concern is about exporting a slightly different selection each time. Since selection isn't implemented yet, we don't need to worry about it until later, but this is something we should keep in mind.
); | ||
for (const markdownFile of markdownFiles) { | ||
const filePath = path.join(basePath, `${markdownFile.fileName}.md`); | ||
await fs.writeFile(filePath, markdownFile.content.join('\n'), 'utf8'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exporting the same thing multiple times works fine!
My concern is about exporting a slightly different selection each time. Since selection isn't implemented yet, we don't need to worry about it until later, but this is something we should keep in mind.
for (const markdownFile of markdownFiles) { | ||
const filePath = path.join(basePath, `${markdownFile.fileName}.md`); | ||
const filePath = path.join(exportedResultsPath, `${markdownFile.fileName}.md`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice...so now all markdown files will live in a single directory. This will make it easier to manage and delete across exports.
Expands on the exporting functionality from #1341 to allow exporting to local markdown instead of gist. A pop-up gives you the location of the saved markdown, and lets you open the summary file. (You can also find the markdown files later, via the "Open query directory" command in the query history.)
Here's a little GIF:
(See internal issue for more info 🔍 )
Checklist
N/A - internal only 🦔
ready-for-doc-review
label there.