Skip to content
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

Don't accidentally mix DTO and non-DTO types in query-history-store.test.ts #3290

Merged
merged 2 commits into from
Jan 29, 2024

Conversation

robertbrignull
Copy link
Contributor

I hit some errors in https://github.com/github/vscode-codeql/actions/runs/7695850568/job/20969605471?pr=3287 and this made me realise that query-history-store.test.ts is being a bit naughty when writing test data. We're writing the query history file but the data being written is the internal query history types instead of the query history DTO types.

This PR introduces a writeRawQueryHistory method which accepts the correct QueryHistoryDto type and writes it to disk. Hopefully this will help avoid people making the same mistake in the future by discouraging direct use of writeFileSync and writing incorrect JSON.

When I merge this branch into the robertbrignull/move_language_pack branch then the no-workspace tests pass locally (where they don't before) so that convinces me this change is correct.

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.

Copy link
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 for tidying that up!

@robertbrignull robertbrignull merged commit 5367bde into main Jan 29, 2024
15 checks passed
@robertbrignull robertbrignull deleted the robertbrignull/history-tests-dtos branch January 29, 2024 16:33
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