Skip to content

Commit

Permalink
Merge branch 'main' into will/kill-common
Browse files Browse the repository at this point in the history
  • Loading branch information
winder authored Jan 9, 2025
2 parents 170745a + 2ebd63b commit 6e854ab
Show file tree
Hide file tree
Showing 323 changed files with 24,036 additions and 19,079 deletions.
16 changes: 16 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!--- Does this work have a corresponding ticket? Please link it here as well as one of:
- the PR title
- branch name
- commit message
[LINK-777](https://smartcontract-it.atlassian.net/browse/LINK-777)
-->

### Requires
<!--- Does this work depend on other open PRs? Please list them.
- https://github.com/smartcontractkit/libocr/pull/7777777
-->

### Supports
<!--- Does this work support other open PRs? Please list them.
- https://github.com/smartcontractkit/chainlink/pull/7777777
-->
24 changes: 7 additions & 17 deletions .github/workflows/golangci_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,13 @@ on: [pull_request]
jobs:
golangci-lint:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
actions: read
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version-file: "go.mod"
- name: Build binary
shell: bash
run: go build ./...
- name: golangci-lint
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0
uses: smartcontractkit/.github/actions/ci-lint-go@2ac9d97a83a5edded09af7fcf4ea5bce7a4473a4 # v0.2.6
with:
version: v1.60.1
# only-new-issues is only applicable to PRs, otherwise it is always set to false
only-new-issues: true
args: --out-format colored-line-number,checkstyle:golangci-lint-report.xml
- name: Print lint report artifact
if: failure()
shell: bash
run: cat ./golangci-lint-report.xml
golangci-lint-version: v1.62.2

23 changes: 23 additions & 0 deletions .github/workflows/llm-action-error-reporter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: LLM Action Error Reporter
on:
workflow_run:
workflows: ["PKG Build and Test"] # As soon as one of the listed worfklows is completed, reporter is triggered
types:
- completed

jobs:
analyze_logs:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
repository-projects: read
actions: read
steps:
- name: Analyze logs
uses: smartcontractkit/.github/actions/llm-action-error-reporter@d125ca9fe5e3b410de7c6db4a4ce3ed7a0728cd6 # v0.3.0
with:
parent-workflow-conclusion: ${{ github.event.workflow_run.conclusion }}
skip-on-success: true # Skip posting comment if no errors are found
gh-token: ${{ github.token }}
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
4 changes: 2 additions & 2 deletions .github/workflows/observability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
go-version-file: "go.mod"

- name: Build
run: go build -v ./...
run: make build

- name: Unit Tests
run: go test -v ./...
run: make test
17 changes: 6 additions & 11 deletions .github/workflows/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
run: go build -v ./...

- name: Unit Tests
run: GORACE="log_path=$PWD/race" go test -race ./... -coverpkg=./... -coverprofile=pkg_coverage.out
run: GORACE="log_path=$PWD/race" go test -race ./... -coverpkg=./... -coverprofile=coverage.txt

- name: Print Races
if: failure()
Expand All @@ -42,20 +42,13 @@ jobs:
if: failure()
run: find . -type f|fgrep '/testdata/fuzz/'|while read f; do echo $f; cat $f; done

- name: Upload Fuzz Tests Failing Inputs
if: failure()
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: failing-fuzz-inputs
path: "**/testdata/fuzz/**"

- name: Upload Go test results
if: always()
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: go-test-results
path: |
./pkg_coverage.out
./coverage.txt
./race.*
check-tidy:
Expand All @@ -70,10 +63,12 @@ jobs:
- name: Ensure "make gomodtidy" has been run
run: |
make gomodtidy
git diff --minimal --exit-code
git add --all
git diff --minimal --cached --exit-code
- name: Ensure "make generate" has been run
run: |
make rm-mocked
make rm-builders
make generate
git diff --stat --exit-code
git add --all
git diff --stat --cached --exit-code
54 changes: 10 additions & 44 deletions .github/workflows/sonar-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}

- name: Wait for workflows
uses: smartcontractkit/chainlink-github-actions/utils/wait-for-workflows@e29366cdecfe6befff9ab8c3cfe4825218505d58 # v2.3.16
uses: smartcontractkit/.github/actions/wait-for-workflows@dca9ab89d734e82738b8aa52bd25d09b205ec6ee # v0.1.1
with:
max-timeout: "900"
max-timeout: "1200"
polling-interval: "30"
exclude-workflow-names: ""
exclude-workflow-names: "Build External Repositories, Observability Lib Checks, Run Benchmarks, LLM Action Error Reporter"
exclude-workflow-ids: ""
github-token: ${{ secrets.GITHUB_TOKEN }}
env:
Expand All @@ -30,46 +30,12 @@ jobs:
runs-on: ubuntu-latest
if: always()
steps:
- name: Checkout the repo
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
fetch-depth: 0 # fetches all history for all tags and branches to provide more metadata for sonar reports

- name: Download Golangci-lint report
if: always()
uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6
with:
workflow: golangci_lint.yml
workflow_conclusion: ""
name_is_regexp: true
name: golangci-lint-report
if_no_artifact_found: warn

- name: Download Go PKG test reports
if: always()
uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6
with:
workflow: pkg.yml
workflow_conclusion: ""
name_is_regexp: true
name: go-test-results
if_no_artifact_found: warn

- name: Set SonarQube Report Paths
if: always()
id: sonarqube_report_paths
shell: bash
run: |
echo "sonarqube_coverage_report_paths=$(find -type f -name '*coverage.out' -printf "%p,")" >> $GITHUB_OUTPUT
echo "sonarqube_golangci_report_paths=$(find -type f -name 'golangci-lint-report.xml' -printf "%p,")" >> $GITHUB_OUTPUT
- name: SonarQube Scan
if: always()
uses: sonarsource/sonarqube-scan-action@53c3e3207fe4b8d52e2f1ac9d6eb1d2506f626c0 # v2.0.2
uses: smartcontractkit/.github/actions/ci-sonarqube-go@5f4a9c9c3407dd499a1ebbc658a45b9beb9bf675 # v0.3.0
with:
args: >
-Dsonar.go.coverage.reportPaths=${{ steps.sonarqube_report_paths.outputs.sonarqube_coverage_report_paths }}
-Dsonar.go.golangci-lint.reportPaths=${{ steps.sonarqube_report_paths.outputs.sonarqube_golangci_report_paths }}
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
# sonarqube inputs
include-lint: "true"
test-report-workflow: pkg.yml
lint-report-workflow: golangci_lint.yml
sonar-token: ${{ secrets.SONAR_TOKEN }}
sonar-host-url: ${{ secrets.SONAR_HOST_URL }}
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@
**/testdata/fuzz/*

# Dependency directories (remove the comment below to include it)
# vendor/
vendor/

# IntelliJ IDE
.idea

vendor/
# Visual Studio Code
.vscode

# Generated files
*.wasm
24 changes: 15 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,29 @@ run:
timeout: 15m0s
linters:
enable:
- containedctx
- depguard
- errname
- errorlint
- exhaustive
- exportloopref
- revive
- fatcontext
- ginkgolinter
- goimports
- gosec
- loggercheck
- mirror
- misspell
- noctx
- perfsprint
- prealloc
- revive
- rowserrcheck
- errorlint
- unconvert
- spancheck
- sqlclosecheck
- noctx
- testifylint
- unconvert
- whitespace
- depguard
- containedctx
- fatcontext
- mirror
- loggercheck
linters-settings:
exhaustive:
default-signifies-exhaustive: true
Expand Down
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
golang 1.22.7
golang 1.23.3
protoc 25.1
protoc-gen-go-grpc 1.3.0
golangci-lint 1.55.2
golangci-lint 1.62.2
mockery 2.43.2
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ generate: mockery install-protoc gomods
mockery

.PHONY: lint-workspace lint
GOLANGCI_LINT_VERSION := 1.60.1
GOLANGCI_LINT_VERSION := 1.62.2
GOLANGCI_LINT_COMMON_OPTS := --max-issues-per-linter 0 --max-same-issues 0
GOLANGCI_LINT_DIRECTORY := ./golangci-lint

Expand Down
Loading

0 comments on commit 6e854ab

Please sign in to comment.