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

Go: Add database sources for the gorqlite package #18863

Merged

Conversation

egregius313
Copy link
Contributor

Adds database source models for the gorqlite package.

@Copilot Copilot bot review requested due to automatic review settings February 26, 2025 04:17
@egregius313 egregius313 requested a review from a team as a code owner February 26, 2025 04:17

Choose a reason for hiding this comment

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

PR Overview

This PR adds database source models for the gorqlite package to support taint flow analysis for various query operations.

  • Introduces a new test file for validating taint flows with multiple query methods.
  • Updates the model configuration in the YAML file to include source and summary model mappings for gorqlite.
  • Adds change notes reflecting the newly added database source models.

Reviewed Changes

File Description
go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_rqlite_gorqlite.go New test file for validating taint flows with different query methods.
go/ql/lib/ext/github.com.rqlite.gorqlite.model.yml Adds new mappings for source and summary models for various gorqlite methods.
go/ql/lib/change-notes/2025-02-25-go-database-rqlite-sources.md Documents the addition of database source models for gorqlite.

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more

Copy link
Contributor

⚠️ The head of this PR and the base branch were compared for differences in the framework coverage reports. The generated reports are available in the artifacts of this workflow run. The differences will be picked up by the nightly job after the PR gets merged.

Click to show differences in coverage

go

Generated file changes for go

  • Changes to framework-coverage-go.rst:
-    `gorqlite <https://github.com/rqlite/gorqlite>`_,"``github.com/raindog308/gorqlite*``, ``github.com/rqlite/gorqlite*``",,,48
+    `gorqlite <https://github.com/rqlite/gorqlite>`_,"``github.com/raindog308/gorqlite*``, ``github.com/rqlite/gorqlite*``",16,4,48
+    Others,``github.com/kanikanema/gorqlite``,8,2,24
-    Totals,,470,952,1532
+    Totals,,494,958,1556
  • Changes to framework-coverage-go.csv:
+ github.com/kanikanema/gorqlite,24,8,2,,,,,,,,,,,,24,,,,,,8,,,,,2,
- github.com/raindog308/gorqlite,24,,,,,,,,,,,,,,24,,,,,,,,,,,,
+ github.com/raindog308/gorqlite,24,8,2,,,,,,,,,,,,24,,,,,,8,,,,,2,
- github.com/rqlite/gorqlite,24,,,,,,,,,,,,,,24,,,,,,,,,,,,
+ github.com/rqlite/gorqlite,24,8,2,,,,,,,,,,,,24,,,,,,8,,,,,2,

Copy link
Contributor

@owen-mc owen-mc left a comment

Choose a reason for hiding this comment

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

Looking good. I see there isn't a test for QueryResult.Map. Is that deliberate, or is it easy to add one?

@egregius313
Copy link
Contributor Author

Looking good. I see there isn't a test for QueryResult.Map. Is that deliberate, or is it easy to add one?

That was just an oversight on my part. I just modified one of the examples to use a call of Map in 4f204ee.

@egregius313 egregius313 requested a review from owen-mc February 26, 2025 18:28
@egregius313 egregius313 merged commit 28770c5 into github:main Feb 27, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants