chore(deps): update module github.com/hyperledger/fabric-contract-api-go to v2#30
Conversation
Reviewer's Guide by SourceryThis PR updates the Class diagram showing updated API support in fabric-contract-api-go v2classDiagram
class ContractAPI {
+HandleBytes[] byte
+ReturnBytes() byte[]
}
class StructArgument {
+OptionalField1 string
+OptionalField2 int
}
note for ContractAPI "New support for byte[] parameters and return types"
note for StructArgument "New support for structs with all optional fields"
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
6d82000 to
32fe259
Compare
c56d7e1 to
c53224b
Compare
c53224b to
82cfe56
Compare
82cfe56 to
56d87ee
Compare
src/go.mod
Outdated
| require ( | ||
| github.com/hyperledger/fabric-chaincode-go v0.0.0-20230731094759-d626e9ab09b9 | ||
| github.com/hyperledger/fabric-contract-api-go v1.2.2 | ||
| github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0 |
There was a problem hiding this comment.
Bug: The Go module was updated to v2 in go.mod, but the import paths in .go files were not updated with the required /v2 suffix, which will cause a build failure.
Severity: CRITICAL | Confidence: High
🔍 Detailed Analysis
The go.mod file was updated to use version 2 of the fabric-contract-api-go dependency, but the import paths in the source code were not updated accordingly. Go's Semantic Import Versioning requires that for major versions v2 and above, the import path must include the version suffix (e.g., /v2). The current code imports from the v1 path (github.com/hyperledger/fabric-contract-api-go/contractapi) while the go.mod file specifies the v2 module. This mismatch will cause a build failure because the compiler cannot resolve the specified imports.
💡 Suggested Fix
Update the import paths in src/assetTransfer.go, src/chaincode/smartcontract.go, and src/chaincode/smartcontract_test.go from "github.com/hyperledger/fabric-contract-api-go/contractapi" to "github.com/hyperledger/fabric-contract-api-go/v2/contractapi" to match the module version.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: src/go.mod#L9
Potential issue: The `go.mod` file was updated to use version 2 of the
`fabric-contract-api-go` dependency, but the import paths in the source code were not
updated accordingly. Go's Semantic Import Versioning requires that for major versions v2
and above, the import path must include the version suffix (e.g., `/v2`). The current
code imports from the v1 path
(`github.com/hyperledger/fabric-contract-api-go/contractapi`) while the `go.mod` file
specifies the v2 module. This mismatch will cause a build failure because the compiler
cannot resolve the specified imports.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 7530241
src/go.mod
Outdated
| github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0 | ||
| github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0 |
There was a problem hiding this comment.
Bug: The go.mod file has a duplicate require entry for the fabric-contract-api-go/v2 module. This makes the file malformed and can cause build tool failures.
Severity: CRITICAL | Confidence: High
🔍 Detailed Analysis
The go.mod file contains a duplicate entry for the github.com/hyperledger/fabric-contract-api-go/v2 dependency. Having duplicate require entries for the same module makes the go.mod file malformed. This can lead to unpredictable behavior or outright failures when using Go toolchain commands like go build or go mod tidy, which expect a correctly structured dependency file. The change introduced a second identical line instead of modifying the existing one.
💡 Suggested Fix
Remove one of the duplicate lines for github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0 from the go.mod file. Afterwards, run go mod tidy to ensure the file is correctly formatted and dependencies are consistent.
🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: src/go.mod#L9-L10
Potential issue: The `go.mod` file contains a duplicate entry for the
`github.com/hyperledger/fabric-contract-api-go/v2` dependency. Having duplicate
`require` entries for the same module makes the `go.mod` file malformed. This can lead
to unpredictable behavior or outright failures when using Go toolchain commands like `go
build` or `go mod tidy`, which expect a correctly structured dependency file. The change
introduced a second identical line instead of modifying the existing one.
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 7530241
56d87ee to
a889f1a
Compare
…-go to v2 Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
a889f1a to
ab78eaf
Compare
ℹ️ Artifact update noticeFile name: src/go.modIn order to perform the update(s) described in the table above, Renovate ran the
Details:
|
This PR contains the following updates:
v1.2.2→v2.2.1Release Notes
hyperledger/fabric-contract-api-go (github.com/hyperledger/fabric-contract-api-go)
v2.2.1Compare Source
What's Changed
New Contributors
Full Changelog: hyperledger/fabric-contract-api-go@v2.2.0...v2.2.1
v2.2.0Compare Source
What's Changed
New Contributors
Full Changelog: hyperledger/fabric-contract-api-go@v2.1.0...v2.2.0
v2.1.0Compare Source
What's Changed
Full Changelog: hyperledger/fabric-contract-api-go@v2.0.0...v2.1.0
v2.0.0Compare Source
v2 Release Notes
The v2 release is functionally equivalent to the v1 release. The primary difference is the use of the current Go API for protocol buffers in place of the original (deprecated) API. The v2 implementation retains wire-level compatibility with Fabric but does include the following breaking changes:
github.com/hyperledger/fabric-protos-gowill experience protocol buffer namespace conflicts (as described in https://protobuf.dev/reference/go/faq/). Any use of fabric-protos-go must be replaced bygithub.com/hyperledger/fabric-protos-go-apiv2.github.com/hyperledger/fabric-chaincode-gomust instead usegithub.com/hyperledger/fabric-chaincode-go/v2.What's Changed
New Contributors
Full Changelog: hyperledger/fabric-contract-api-go@v1.2.2...v2.0.0
Configuration
📅 Schedule: Branch creation - At 12:00 AM through 04:59 AM and 10:00 PM through 11:59 PM, Monday through Friday ( * 0-4,22-23 * * 1-5 ), Only on Sunday and Saturday ( * * * * 0,6 ) (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.