FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Set --expect-discarded-cache option by cklin · Pull Request #1540 · github/codeql-action · GitHub

Set --expect-discarded-cache option - #1540

Merged
cklin merged 5 commits into
github:mainfrom
cklin:expect-discarded-cache
Feb 17, 2023
Merged

cklin merged 5 commits into
github:mainfrom
cklin:expect-discarded-cache

Conversation

cklin commented Feb 14, 2023

Copy link
Copy Markdown
Contributor

This PR changes the action to pass --expect-discarded-cache to the last codeql database run-queries invocation to improve performance.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Confirm the readme has been updated if necessary.
  • Confirm the changelog has been updated if necessary.

This refactoring commit changes databaseRunQueries() to accept a list of
flags instead of separate memory and threads flags.
Comment thread src/analyze.ts Outdated
cklin marked this pull request as ready for review February 15, 2023 17:42
cklin requested a review from a team as a code owner February 15, 2023 17:42
cklin requested a review from aeisenberg February 15, 2023 17:42

aeisenberg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Comment thread src/analyze.ts Outdated
Comment thread src/analyze.ts Outdated
Comment thread src/analyze.ts Outdated
Comment on lines +226 to +227
const isLastLanguage =
language === config.languages[config.languages.length - 1];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

cklin commented Feb 17, 2023

Copy link
Copy Markdown
Contributor Author

I made the suggested changes and added unit tests. PTAL. Thank you!

cklin requested a review from aeisenberg February 17, 2023 19:26

aeisenberg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nice work.

Comment thread src/analyze.test.ts
});
});

test("optimizeForLastQueryRun for two languages, CliConfigFileEnabled", async (t) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Going forward, Feature.CliConfigFileEnabled should be enabled for all users (except some specific DCA repos).

cklin merged commit 3dde1f3 into github:main Feb 17, 2023
github-actions Bot mentioned this pull request Feb 24, 2023
6 tasks
cklin deleted the expect-discarded-cache branch February 27, 2023 17:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL