core/services/chainlink/config.go: merge RawConfigs using expected fields
Quality Gate failed
Failed conditions
7 New Major Issues (required ≤ 5)
C Reliability Rating on New Code (required ≥ A)
See analysis details on SonarQube
Catch issues before they fail your Quality Gate with our IDE extension
SonarLint
AER Report: CI Core
aer_workflow , commit , Detect Changes , Clean Go Tidy & Generate , lint , Core Tests (go_core_tests) , Core Tests (go_core_ccip_deployment_tests) , Core Tests (go_core_race_tests) , Core Tests (go_core_fuzz) , SonarQube Scan
1. Error return value not checked: [Golang Lint]
Source of Error:
core/services/chainlink/config.go:66:17: Error return value of `(github.com/smartcontractkit/chainlink/v2/core/services/chainlink.RawConfig).SetFrom` is not checked (errcheck)
rs[i].SetFrom(config)
^
Suggested fix: Add error handling for the SetFrom function call to ensure any errors are properly managed.
2. Variable naming issues: [Golang Lint]
Source of Error:
core/services/chainlink/config.go:60:3: var-naming: var chainId should be chainID (revive)
chainId := config.ChainID()
^
core/services/chainlink/config.go:62:4: var-naming: var otherChainId should be otherChainID (revive)
otherChainId := r.ChainID()
^
core/services/chainlink/config.go:82:2: var-naming: var chainIds should be chainIDs (revive)
chainIds := commonconfig.UniqueStrings{}
^
core/services/chainlink/config.go:84:3: var-naming: var chainId should be chainID (revive)
chainId := config.ChainID()
^
core/services/chainlink/config.go:112:2: var-naming: var chainId should be chainID (revive)
chainId := c.ChainID()
^
Suggested fix: Rename the variables from chainId, otherChainId, and chainIds to chainID, otherChainID, and chainIDs respectively.
3. Redundant nil check: [Golang Lint]
Source of Error:
core/services/chainlink/config.go:117:5: S1009: should omit nil check; len() for []string is defined as zero (gosimple)
if nodeNames == nil || len(nodeNames) == 0 {
^
Suggested fix: Remove the nil check and only check the length of the slice: if len(nodeNames) == 0 {.
AER Report: Operator UI CI ran successfully :white_check_mark:
AER Report: CI Core ran successfully :white_check_mark:
AER Report: Operator UI CI ran successfully :white_check_mark:
@cfal can you clean up this PR and get it merged please? Aptos staging got affected by some config reorgs and I believe this will fix it.
Hey @cfal, please do not worry about this failing job. This is unrelated to your PR and will be fixed soon.
Quality Gate passed
Issues
2 New issues
0 Fixed issues
0 Accepted issues
Measures
0 Security Hotspots
81.8% Coverage on New Code
0.0% Duplication on New Code