-
Notifications
You must be signed in to change notification settings - Fork 428
Set --expect-discarded-cache option #1540
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
This refactoring commit changes databaseRunQueries() to accept a list of flags instead of separate memory and threads flags.
aeisenberg
left a comment
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.
A question inline.
Also, can you think of any way of testing this? Probably a unit test or two would be fine. We are testing the runQueries command in this test: https://github.com/aeisenberg/codeql-action/blob/main/src/analyze.test.ts#L25 This test could be expanded, or a new test that focuses explicitly on this flag could be written.
We can pair on this if you like.
src/analyze.ts
Outdated
| const isLastLanguage = | ||
| language === config.languages[config.languages.length - 1]; |
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 sure how --expect-discarded-cache actually works, but does it affect all languages in a cluster at the same time? Ie- if you have a clustered db with java and javascript, will running with --expect-discarded-cache on java queries affect the cache for javascript?
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.
Based on discussions in the tracking issue, I think we should set --expect-discarded-cache for the last run-queries command of each language (as opposed to for all languages).
This refactoring commit changes runQueries() to calculate the set of indices with non-empty custom queries early. Doing so allows us to check early on whether there are any custom queries to run.
|
I made the suggested changes and added unit tests. PTAL. Thank you! |
aeisenberg
left a comment
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 work.
| }); | ||
| }); | ||
|
|
||
| test("optimizeForLastQueryRun for two languages, CliConfigFileEnabled", async (t) => { |
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.
Going forward, Feature.CliConfigFileEnabled should be enabled for all users (except some specific DCA repos).
This PR changes the action to pass
--expect-discarded-cacheto the lastcodeql database run-queriesinvocation to improve performance.Merge / deployment checklist