Go: Add database source models for the github.com/couchbase/gocb package#18913
Merged
owen-mc merged 5 commits intogithub:mainfrom Mar 25, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
PR Overview
This PR adds new database source models and corresponding taint tests for both v1 and v2 of the github.com/couchbase/gocb package.
- Introduces database source model entries in the CodeQL YAML configuration.
- Adds taint analysis tests for v1 and v2 functions.
- Updates change notes to reflect the new source models.
Reviewed Changes
| File | Description |
|---|---|
| go/ql/lib/ext/github.com.couchbase.gocb.model.yml | New YAML entries for database source models are added for various gocb functions. |
| go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v1.go | New taint flow tests for v1 functions. |
| go/ql/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v2.go | New taint flow tests for v2 functions covering Cluster, Scope, Collection, TransactionAttemptContext, and ViewIndexManager. |
| go/ql/lib/change-notes/2025-03-03-couchbase-source-models.md | Change note reflecting the addition of the new source models. |
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
go/ql/lib/ext/github.com.couchbase.gocb.model.yml:12
- The YAML mapping for the new entry appears to have inconsistent indentation (e.g. 'data:' is indented differently than 'addsTo:'). Please verify that the YAML structure is correctly formatted to avoid any parsing issues.
- addsTo:
Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more
Contributor
Click to show differences in coveragegoGenerated file changes for go
- `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,94,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,47,8
- Totals,,494,958,1556
+ Totals,,560,1045,1556
- github.com/couchbase/gocb,8,,18,,,,,8,,,,,,,,,,,,,,,,,,18,
+ github.com/couchbase/gocb,8,22,47,,,,,8,,,,,,,,,,,,,22,,,,,47,
- github.com/couchbaselabs/gocb,8,,18,,,,,8,,,,,,,,,,,,,,,,,,18,
+ github.com/couchbaselabs/gocb,8,22,47,,,,,8,,,,,,,,,,,,,22,,,,,47,
- gopkg.in/couchbase/gocb,8,,18,,,,,8,,,,,,,,,,,,,,,,,,18,
+ gopkg.in/couchbase/gocb,8,22,47,,,,,8,,,,,,,,,,,,,22,,,,,47, |
owen-mc
requested changes
Mar 4, 2025
...l/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v1.go
Outdated
Show resolved
Hide resolved
...l/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v2.go
Outdated
Show resolved
Hide resolved
owen-mc
reviewed
Mar 7, 2025
...l/test/library-tests/semmle/go/dataflow/flowsources/local/database/test_couchbase_gocb_v1.go
Outdated
Show resolved
Hide resolved
...tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/stub.go
Outdated
Show resolved
Hide resolved
...tests/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/stub.go
Outdated
Show resolved
Hide resolved
owen-mc
reviewed
Mar 7, 2025
...ts/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/v2/stub.go
Outdated
Show resolved
Hide resolved
...ts/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/v2/stub.go
Outdated
Show resolved
Hide resolved
...ts/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/v2/stub.go
Outdated
Show resolved
Hide resolved
...ts/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/v2/stub.go
Outdated
Show resolved
Hide resolved
...ts/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/v2/stub.go
Outdated
Show resolved
Hide resolved
...ts/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/v2/stub.go
Outdated
Show resolved
Hide resolved
...ts/semmle/go/dataflow/flowsources/local/database/vendor/github.com/couchbase/gocb/v2/stub.go
Outdated
Show resolved
Hide resolved
This was referenced Mar 21, 2025
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.
Adds
databasesource models and relevant summaries for v1 and v2 of thegithub.com/couchbase/gocbpackage.