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

Deployment operations #16065

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft

Deployment operations #16065

wants to merge 2 commits into from

Conversation

RodrigoAD
Copy link
Member

Requires

Supports

@RodrigoAD RodrigoAD requested a review from cgruber January 24, 2025 16:50
@cl-sonarqube-production
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)
13 New Major Issues (required ≤ 5)

See analysis details on SonarQube

Catch issues before they fail your Quality Gate with our IDE extension SonarLint SonarLint

Copy link
Contributor

AER Report: CI Core

aer_workflow , commit , Detect Changes , Clean Go Tidy & Generate , Scheduled Run Frequency , GolangCI Lint (deployment) , Core Tests (go_core_tests) , test-scripts , Core Tests (go_core_tests_integration) , Core Tests (go_core_ccip_deployment_tests) , Core Tests (go_core_fuzz) , Core Tests (go_core_race_tests) , lint , SonarQube Scan

1. File is not goimports-ed with -local github.com/smartcontractkit/chainlink: Golang Lint (deployment)

Source of Error:
Golang Lint (deployment)	2025-01-24T16:53:04.7270717Z deployment/ethereum/extension/operations_ethereum.go:6: File is not `goimports`-ed with -local github.com/smartcontractkit/chainlink (goimports)
Golang Lint (deployment)	2025-01-24T16:53:04.7272002Z 	"github.com/ethereum/go-ethereum/core/types"

Why: The file operations_ethereum.go is not formatted according to the goimports tool with the -local flag set to github.com/smartcontractkit/chainlink.

Suggested fix: Run goimports -local github.com/smartcontractkit/chainlink -w deployment/ethereum/extension/operations_ethereum.go to format the file correctly.

2. Struct field Id should be ID: Golang Lint (deployment)

Source of Error:
Golang Lint (deployment)	2025-01-24T16:53:04.7319826Z ##[error]deployment/operations.go:20:2: var-naming: struct field Id should be ID (revive)
Golang Lint (deployment)	2025-01-24T16:53:04.7320679Z 	Id string
Golang Lint (deployment)	2025-01-24T16:53:04.7321065Z 	^

Why: The struct field Id does not follow Go naming conventions, which prefer ID over Id.

Suggested fix: Rename the struct field from Id to ID.

3. Method 'Execute' differs only by capitalization to function 'Execute': Golang Lint (deployment)

Source of Error:
Golang Lint (deployment)	2025-01-24T16:53:04.7323380Z ##[error]deployment/operations.go:125:6: confusing-naming: Method 'Execute' differs only by capitalization to function 'Execute' in the same source file (revive)
Golang Lint (deployment)	2025-01-24T16:53:04.7324399Z func Execute[I, O, Deps any](
Golang Lint (deployment)	2025-01-24T16:53:04.7324808Z ^

Why: The method Execute has a name that differs only by capitalization from another function execute in the same file, which can be confusing.

Suggested fix: Rename one of the functions to avoid confusion, ensuring they have distinct names.

4. Struct field chainId should be chainID: Golang Lint (deployment)

Source of Error:
Golang Lint (deployment)	2025-01-24T16:53:04.7326235Z ##[error]deployment/ethereum/common/changeset.go:15:2: var-naming: struct field chainId should be chainID (revive)
Golang Lint (deployment)	2025-01-24T16:53:04.7327049Z 	chainId uint64
Golang Lint (deployment)	2025-01-24T16:53:04.7327394Z 	^

Why: The struct field chainId does not follow Go naming conventions, which prefer chainID over chainId.

Suggested fix: Rename the struct field from chainId to chainID.

5. Field input is unused: Golang Lint (deployment)

Source of Error:
Golang Lint (deployment)	2025-01-24T16:53:04.7328176Z ##[error]deployment/operations.go:34:2: field `input` is unused (unused)
Golang Lint (deployment)	2025-01-24T16:53:04.7328814Z 	input I // might not be needed
Golang Lint (deployment)	2025-01-24T16:53:04.7329223Z 	^

Why: The field input is declared but not used anywhere in the code.

Suggested fix: Remove the unused field input from the struct.

6. Import 'github.com/test-go/testify/require' is not allowed: Golang Lint (deployment)

Source of Error:
Golang Lint (deployment)	2025-01-24T16:53:04.7336990Z ##[error]deployment/ethereum/common/changeset_test.go:11:2: import 'github.com/test-go/testify/require' is not allowed from list 'main': Use github.com/stretchr/testify/require instead (depguard)
Golang Lint (deployment)	2025-01-24T16:53:04.7338194Z 	"github.com/test-go/testify/require"
Golang Lint (deployment)	2025-01-24T16:53:04.7338620Z 	^

Why: The import github.com/test-go/testify/require is not allowed and should be replaced with github.com/stretchr/testify/require.

Suggested fix: Replace the import statement with github.com/stretchr/testify/require.

7. Ineffectual assignment to err: Golang Lint (deployment)

Source of Error:
Golang Lint (deployment)	2025-01-24T16:53:04.7339576Z ##[error]deployment/ethereum/common/changeset_test.go:29:7: ineffectual assignment to err (ineffassign)
Golang Lint (deployment)	2025-01-24T16:53:04.7340431Z 	ret, err := LinkExampleChangeset(e, changesetInput)
Golang Lint (deployment)	2025-01-24T16:53:04.7340926Z 	 ^

Why: The variable err is assigned a value but never used, which is considered ineffectual.

Suggested fix: Use the err variable or remove the assignment if it is not needed.

8. Unnecessary leading newline: Golang Lint (deployment)

Source of Error:
Golang Lint (deployment)	2025-01-24T16:53:04.7330196Z ##[error]deployment/ethereum/common/changeset_test.go:15:39: unnecessary leading newline (whitespace)
Golang Lint (deployment)	2025-01-24T16:53:04.7330786Z 
Golang Lint (deployment)	2025-01-24T16:53:04.7330932Z ^

Why: There is an unnecessary leading newline in the file changeset_test.go.

Suggested fix: Remove the unnecessary leading newline.

9. Unnecessary trailing newline: Golang Lint (deployment)

Source of Error:
Golang Lint (deployment)	2025-01-24T16:53:04.7332019Z ##[error]deployment/ethereum/common/changeset_test.go:40:1: unnecessary trailing newline (whitespace)
Golang Lint (deployment)	2025-01-24T16:53:04.7332636Z 
Golang Lint (deployment)	2025-01-24T16:53:04.7332787Z ^

Why: There is an unnecessary trailing newline in the file changeset_test.go.

Suggested fix: Remove the unnecessary trailing newline.

10. Process completed with exit code 1: Ensure clean after tidy

Source of Error:
Ensure clean after tidy	2025-01-24T16:59:39.7447919Z ##[error]Process completed with exit code 1.

Why: The git diff --minimal --cached --exit-code command found differences after running go mod tidy, indicating that the repository is not clean.

Suggested fix: Ensure that all changes are committed or revert any unintended changes before running the go mod tidy command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant