-
Notifications
You must be signed in to change notification settings - Fork 193
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
Move language and pack to top level of variant analysis object #3287
Conversation
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.
Makes sense to pull them up a bit! Thanks.
@@ -42,7 +42,7 @@ interface VariantAnalysisMarkdown { | |||
* Generates markdown files with variant analysis results. | |||
*/ | |||
export async function generateVariantAnalysisMarkdown( | |||
variantAnalysis: Pick<VariantAnalysis, "query">, | |||
variantAnalysis: Pick<VariantAnalysis, "language" | "query">, |
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.
Not a problem necessarily introduced in this PR, but I would prefer to not use Pick
if we're going to be getting more than 1 item, as it gradually becomes silly (e.g. https://github.com/github/vscode-codeql/pull/3287/files#diff-ba6fe1916e2a1bce3900880797ea49539e39f9f76c431c2742a4ca5926643b26R50)
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.
For this PR I'll just keep it simple and add the extra field. I don't feel this PR crosses any new silliness-thresholds that weren't already crossed.
I'm not really sure why we're using Pick
here (or the place you linked). I'm not sure what benefit it gives us in terms of ease of writing or maintainability, over taking the whole object. Perhaps it makes craft data in the tests easier, but we have createMockX
methods for that generally.
I dug into the CI failure and uncovered a existing bug in the tests that we just didn't notice until now. I've opened #3290 to separate the test fix from this change. |
I found another case of us mixing internal and DTO types in the tests. I've opened #3293 for this one. |
At last the tests are green! 🎉 |
A slimmed down version of #3285 that doesn't modify the
query
object. The idea being to split up that change and make it easier if we do want to do it or something similar to it in the future.My reasoning on
pack
andlanguage
is that they're really properties of the variant analysis rather than properties of the query. This becomes more true when you consider multiple queries, but I think it's still true now.I'm deliberately not modifying the query history format in this PR. We could do, but since it's a lossless transformation in both directions we can just leave it. Or we could save the query history update for when we add in multiple query support and batch those changes together.
Checklist
ready-for-doc-review
label there.