Remove ProgressCallback / CancellationToken arguments where they aren't used#2525
Merged
robertbrignull merged 4 commits intomainfrom Jun 20, 2023
Merged
Conversation
aeisenberg
approved these changes
Jun 19, 2023
Contributor
aeisenberg
left a comment
There was a problem hiding this comment.
Thanks. This makes sense to me and I think is a good cleanup.
robertbrignull
commented
Jun 20, 2023
| tokenSource.token, | ||
| database, | ||
| ); | ||
| await this.showProgress({ |
Contributor
Author
There was a problem hiding this comment.
Upon re-reviewing my own PR, I think we should keep this one. I'm not 100% sure if it worked before, but the intention was to do a manual progress update to show that we're removing the database.
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The idea here is to remove
ProgressCallbackorCancellationTokenarguments where they ultimately aren't used. This involves tracing the execution into the query server. I did this by looking in the CodeQL CLI repository in theEvaluationServerclass, to see if either of those arguments are used in the implementation.The affected query server commands are:
clearCacheInDatabaseregisterDatabasederegisterDatabaseMy understanding is that the state of whether or not a query server command utilises progress reporting is unlikely to change in the foreseeable future. So these assumptions about whether commands use these arguments or not shouldn't go out of date too quickly.
Where they are not used, I've removed them from the
QueryRunnerinterface, and then followed the chain of removing unused variables as far as possible.I've tried testing this by running these three operations, and everything seems to be working just as before. In some cases we intentionally use
withProgressbut then don't make any progress updates to it. In the UI this works and it looks like a progress bar that animates to show activity but doesn't show a particular percentage.Checklist
ready-for-doc-reviewlabel there.