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 source models for the github.com/couchbase/gocb package (#2) #19088

Merged
merged 9 commits into from
Mar 25, 2025

Conversation

owen-mc
Copy link
Contributor

@owen-mc owen-mc commented Mar 21, 2025

Copy of #18913 with some reviews applied that were more easily done on the command line.

egregius313 and others added 8 commits March 3, 2025 13:25

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was signed with the committer’s verified signature.
owen-mc Owen Mansel-Chan

Verified

This commit was signed with the committer’s verified signature.
owen-mc Owen Mansel-Chan

Verified

This commit was signed with the committer’s verified signature.
owen-mc Owen Mansel-Chan
I had to remove quite a few incorrect method declarations for promoted
methods.
@Copilot Copilot bot review requested due to automatic review settings March 21, 2025 10:31
@owen-mc owen-mc requested a review from a team as a code owner March 21, 2025 10:31

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds database source models for both v1 and v2 of the github.com/couchbase/gocb package and updates supporting test files and change notes accordingly.

  • Added new YAML definitions for couchbase source models.
  • Introduced tests for v1 and v2 flows covering analytics, query, search, collection and transaction methods.
  • Updated go:generate directives for Gorm, Beego ORM, and jmoiron/sqlx.

Reviewed Changes

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

Show a summary per file
File Description
go/ql/lib/ext/github.com.couchbase.gocb.model.yml Introduces new database source model definitions for various grouptypes and methods.
go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v1.go Adds tests exercising source flows for couchbase gocb v1.
go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v2.go Adds tests exercising source flows for couchbase gocb v2 covering multiple interfaces.
go/ql/lib/change-notes/2025-03-03-couchbase-source-models.md Describes the addition of database source models for the new version.
go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_gorm.go Updates depstubber directives for Gorm.
go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_beego_orm.go Updates depstubber directives for Beego ORM.
go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_jmoiron_sqlx.go Updates depstubber directives for jmoiron/sqlx.
Files not reviewed (1)
  • go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/go.mod: Language not supported

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:
-    `Couchbase official client(gocb) <https://github.com/couchbase/gocb>`_,"``github.com/couchbase/gocb*``, ``gopkg.in/couchbase/gocb*``",,36,16
+    `Couchbase official client(gocb) <https://github.com/couchbase/gocb>`_,"``github.com/couchbase/gocb*``, ``gopkg.in/couchbase/gocb*``",44,96,16
-    `Couchbase unofficial client <http://www.github.com/couchbase/go-couchbase>`_,``github.com/couchbaselabs/gocb*``,,18,8
+    `Couchbase unofficial client <http://www.github.com/couchbase/go-couchbase>`_,``github.com/couchbaselabs/gocb*``,22,48,8
-    Totals,,494,958,1556
+    Totals,,560,1048,1556
  • Changes to framework-coverage-go.csv:
- github.com/couchbase/gocb,8,,18,,,,,8,,,,,,,,,,,,,,,,,,18,
+ github.com/couchbase/gocb,8,22,48,,,,,8,,,,,,,,,,,,,22,,,,,48,
- github.com/couchbaselabs/gocb,8,,18,,,,,8,,,,,,,,,,,,,,,,,,18,
+ github.com/couchbaselabs/gocb,8,22,48,,,,,8,,,,,,,,,,,,,22,,,,,48,
- gopkg.in/couchbase/gocb,8,,18,,,,,8,,,,,,,,,,,,,,,,,,18,
+ gopkg.in/couchbase/gocb,8,22,48,,,,,8,,,,,,,,,,,,,22,,,,,48,

smowton
smowton previously approved these changes Mar 21, 2025
Copy link
Contributor

@smowton smowton left a comment

Choose a reason for hiding this comment

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

Looks plausible

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@owen-mc
Copy link
Contributor Author

owen-mc commented Mar 21, 2025

@smowton I had to delete some extraneous imports in the stubs and this dismissed your review. Please re-review.

@owen-mc owen-mc merged commit 6d61820 into github:main Mar 25, 2025
13 checks passed
@owen-mc owen-mc deleted the review/egregius313/18913 branch March 25, 2025 10:31
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.

None yet

3 participants