Skip to content

Remove legacy messages#3172

Merged
koesie10 merged 5 commits intomainfrom
koesie10/remove-legacy-messages
Dec 22, 2023
Merged

Remove legacy messages#3172
koesie10 merged 5 commits intomainfrom
koesie10/remove-legacy-messages

Conversation

@koesie10
Copy link
Copy Markdown
Member

This removes all remaining usages of legacy messages. The first commit changes the most: It removes the result on a QueryHistoryItem, which was populated based on information that is already present in CompletedQueryInfo anyway. Old history items which only have the legacy result populated have not been created for at least 30 days now since the legacy query runner hasn't been used for quite a while now. Therefore, we can safely remove it.

Checklist

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

The legacy result was populated based on information that is already
present in `CompletedQueryInfo` anyway. Old history items which only
have the legacy result populated have not been created for at least 30
days now since the legacy query runner hasn't been used for quite a
while now.
@koesie10 koesie10 force-pushed the koesie10/remove-legacy-messages branch from 6ff0f93 to 2ba3964 Compare December 21, 2023 15:59
@koesie10 koesie10 marked this pull request as ready for review December 21, 2023 16:13
@koesie10 koesie10 requested a review from a team as a code owner December 21, 2023 16:13
@charisk
Copy link
Copy Markdown
Contributor

charisk commented Dec 22, 2023

What is the significance of the 30 days? Is that the default query history item expiry time? I believe that's configurable so someone may have changed it. What would happen in that case (I've not looked at the code changes yet)?

@koesie10
Copy link
Copy Markdown
Member Author

What is the significance of the 30 days? Is that the default query history item expiry time? I believe that's configurable so someone may have changed it. What would happen in that case (I've not looked at the code changes yet)?

Yes, exactly. However, I think this should actually be fine for all query history items created in the extension in at least the last year. When we enabled the new query server by default, we were already setting successful and message. So, even for those items it should work correctly. Only for items which are even older (created in extension versions before v1.7.1, #1498), would users now not be able to see the status or view results. However, the extension doesn't crash since there's a default for these. They would also still be able to retrieve the BQRS and SARIF files.

Copy link
Copy Markdown
Contributor

@charisk charisk left a comment

Choose a reason for hiding this comment

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

Thanks! It's great to see this cleaned up. I can't think of anything wrong with these changes.

/**
* A compilation message for a test message (either an error or a warning)
*/
export interface CompilationMessage {
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.

Should this go in new-messages.ts?

Also should we rename new-messages.ts (and I guess new-query-runner.ts)? Happy for that to be a follow up.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not really, since this is not a message that is produced by the query server. This message is only produced for tests, and never as part of a query run. Therefore, I don't think it makes sense to move it to new-messages.ts.

I can rename new-messages.ts in a follow-up PR. new-query-runner.ts has already been renamed as part of #3171

@koesie10 koesie10 merged commit d227af4 into main Dec 22, 2023
@koesie10 koesie10 deleted the koesie10/remove-legacy-messages branch December 22, 2023 15:14
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