Skip to content

Commit 8235813

Browse files
committed
Merge
2 parents 0c4bb16 + 15722ca commit 8235813

File tree

558 files changed

+37937
-8170
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

558 files changed

+37937
-8170
lines changed

.github/workflows/docker-test.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
types: [submitted]
55
pull_request:
66
types: [labeled]
7+
paths-ignore:
8+
- 'tools/**'
79

810
jobs:
911
eth_env:

.github/workflows/framework-golden-tests.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,27 @@ jobs:
2222
config: smoke.toml
2323
count: 1
2424
timeout: 10m
25-
- name: TestLoad
26-
config: load.toml
25+
- name: TestSolanaSmoke
26+
config: smoke_solana.toml
27+
count: 1
28+
timeout: 10m
29+
- name: TestUpgrade
30+
config: upgrade.toml
31+
count: 1
32+
timeout: 10m
33+
- name: TestPerformanceBaseline
34+
config: performance_baseline.toml
2735
count: 1
2836
timeout: 10m
2937
- name: TestChaos
3038
config: chaos.toml
3139
count: 1
3240
timeout: 10m
33-
- name: TestReload
34-
config: reload.toml
41+
- name: TestScalability
42+
config: scalability.toml
3543
count: 1
3644
timeout: 10m
45+
name: ${{ matrix.test.name }}
3746
steps:
3847
- name: Checkout repo
3948
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
@@ -54,6 +63,7 @@ jobs:
5463
filters: |
5564
src:
5665
- 'framework/**'
66+
- '.github/workflows/framework-golden-tests.yml'
5767
- name: Set up Go
5868
uses: actions/setup-go@v4
5969
with:
@@ -70,9 +80,16 @@ jobs:
7080
go-modules-${{ runner.os }}
7181
- name: Install dependencies
7282
run: go mod download
73-
- name: Run Docker Component Tests
83+
- name: Run System Tests
7484
if: steps.changes.outputs.src == 'true'
7585
env:
7686
CTF_CONFIGS: ${{ matrix.test.config }}
7787
run: |
7888
go test -timeout ${{ matrix.test.timeout }} -v -count ${{ matrix.test.count }} -run ${{ matrix.test.name }}
89+
- name: Upload Logs
90+
if: always()
91+
uses: actions/upload-artifact@v3
92+
with:
93+
name: container-logs-${{ matrix.test.name }}
94+
path: framework/examples/myproject/logs
95+
retention-days: 1

.github/workflows/framework.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ concurrency:
55
group: ${{ github.workflow }}-${{ github.ref }}-framework
66
cancel-in-progress: true
77
jobs:
8-
test:
8+
framework-component-tests:
99
defaults:
1010
run:
1111
working-directory: framework
12+
env:
13+
CTF_JD_IMAGE: ${{ secrets.CTF_JD_IMAGE }}
1214
runs-on: ubuntu-latest
1315
permissions:
1416
id-token: write
@@ -51,4 +53,4 @@ jobs:
5153
- name: Run Docker Component Tests
5254
if: steps.changes.outputs.src == 'true'
5355
run: |
54-
go test -timeout 5m -v -count 1 -run TestDocker ./...
56+
go test -timeout 2m -v -count 1 -run TestComponent ./...
Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
name: Generate go-docs
2+
3+
on:
4+
pull_request:
5+
types:
6+
- labeled
7+
- reopened
8+
- synchronize
9+
10+
jobs:
11+
generate_docs_new_pr:
12+
name: Generate Go Docs
13+
if: ${{ contains(github.event.pull_request.labels.*.name, 'generate_go_docs') }}
14+
runs-on: ubuntu-latest
15+
environment: integration
16+
permissions:
17+
id-token: write
18+
contents: read
19+
20+
steps:
21+
- name: Setup GitHub Token for reading Generate Go Doc Repo
22+
id: setup-github-token-read
23+
uses: smartcontractkit/.github/actions/setup-github-token@9e7cc0779934cae4a9028b8588c9adb64d8ce68c # [email protected]
24+
with:
25+
aws-role-arn: ${{ secrets.AWS_ROLE_ARN_READ_GENERATE_GO_DOC_REPO }}
26+
aws-lambda-url: ${{ secrets.GATI_LAMBDA_TT_URL }}
27+
aws-region: ${{ secrets.AWS_REGION }}
28+
29+
- name: Configure git for private repository and install go tools
30+
env:
31+
GOPRIVATE: github.com/smartcontractkit/generate-go-function-docs
32+
run: |
33+
git config --global url."https://x-access-token:${{ steps.setup-github-token-read.outputs.access-token }}@github.com/".insteadOf "https://github.com/"
34+
go install github.com/smartcontractkit/[email protected]
35+
go install github.com/jmank88/[email protected]
36+
go install golang.org/x/tools/gopls@latest
37+
38+
- name: Checkout current branch
39+
uses: actions/checkout@v3
40+
with:
41+
fetch-depth: 0
42+
43+
- name: Detect changes related to current PR
44+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
45+
id: changes
46+
with:
47+
filters: |
48+
seth:
49+
- 'seth/**/*.go'
50+
wasp:
51+
- 'wasp/**/*.go'
52+
havoc:
53+
- 'havoc/**/*.go'
54+
lib:
55+
- 'lib/**/*.go'
56+
k8s-test-runner:
57+
- 'k8s-test-runner/**/*.go'
58+
framework:
59+
- 'framework/**/*.go'
60+
tools/asciitable:
61+
- 'tools/asciitable/**/*.go'
62+
tools/breakingchanges:
63+
- 'tools/breakingchanges/**/*.go'
64+
tools/citool:
65+
- 'tools/citool/**/*.go'
66+
tools/ecrimagefetcher:
67+
- 'tools/ecrimagefetcher/**/*.go'
68+
tools/envresolve:
69+
- 'tools/envresolve/**/*.go'
70+
tools/flakeguard:
71+
- 'tools/flakeguard/**/*.go'
72+
tools/ghlatestreleasechecker:
73+
- 'tools/ghlatestreleasechecker/**/*.go'
74+
tools/ghsecrets:
75+
- 'tools/ghsecrets/**/*.go'
76+
tools/gotestloghelper:
77+
- 'tools/gotestloghelper/**/*.go'
78+
tools/testlistgenerator:
79+
- 'tools/testlistgenerator/**/*.go'
80+
tools/workflowresultparser:
81+
- 'tools/workflowresultparser/**/*.go'
82+
# add more projects here
83+
84+
- name: Find all go modules in the repository and filter the ones that changed
85+
shell: bash
86+
id: go-modules
87+
env:
88+
FILTERS: ${{ steps.changes.outputs.changes }}
89+
run: |
90+
PATH=$PATH:$(go env GOPATH)/bin
91+
export PATH
92+
93+
# Find all go projects
94+
gomods_output=$(gomods 2>&1)
95+
96+
# Extract the parent directories of go.mod files
97+
parent_folders=$(echo "$gomods_output" | grep 'go\.mod$' | sed 's/\/go\.mod//' | sed 's/^[ \t]*//;s/[ \t]*$//' | xargs -n 1)
98+
99+
# Convert parent directories into a JSON matrix
100+
echo "$parent_folders" | jq -R -s 'split("\n") | map(select(length > 0)) | map({folder: .})' > all_folders.json
101+
102+
# Filter the directories that did not changeß
103+
jq --argjson filters "$FILTERS" 'map(select(.folder as $folder | $filters | index($folder)))' all_folders.json > filtered_folders.json
104+
105+
echo "Filtered folder List JSON"
106+
cat filtered_folders.json
107+
108+
rm all_folders.json
109+
110+
- name: Generate go docs for changed projects
111+
shell: bash
112+
env:
113+
OPENAI_API_KEY: ${{ secrets.OPENAI_DOC_GEN_API_KEY }}
114+
run: |
115+
# Add go binary to PATH
116+
PATH=$PATH:$(go env GOPATH)/bin
117+
export PATH
118+
cat filtered_folders.json | jq -c '.[]' | while read -r item; do
119+
folder=$(echo "$item" | jq -r '.folder')
120+
echo "Processing folder: $folder"
121+
generate-go-function-docs diff -b ${{ github.event.pull_request.base.sha }} -c ${{ github.event.pull_request.head.sha }} --saveCosts --generator chatgpt --generatorSubType ${{ vars.GO_DOC_GEN_CHATGPT_MODEL }} --folder "$folder"
122+
done
123+
rm filtered_folders.json
124+
125+
- name: Upload costs as artifact
126+
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
127+
with:
128+
name: generation-costs
129+
path: ./costs
130+
131+
- name: Remove costs before committing
132+
shell: bash
133+
run: rm -rf costs
134+
135+
- name: Setup GitHub Token for creating a new PR
136+
id: setup-github-token-write
137+
uses: smartcontractkit/.github/actions/setup-github-token@9e7cc0779934cae4a9028b8588c9adb64d8ce68c # [email protected]
138+
with:
139+
aws-role-arn: ${{ secrets.AWS_ROLE_ARN_CREATE_PR }}
140+
aws-lambda-url: ${{ secrets.GATI_LAMBDA_TT_URL }}
141+
aws-region: ${{ secrets.AWS_REGION }}
142+
143+
- name: Create a new PR targeting current PR
144+
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
145+
id: create-pr
146+
with:
147+
token: ${{ steps.setup-github-token-write.outputs.access-token }}
148+
branch: ${{ github.head_ref }}-docs
149+
base: ${{ github.head_ref }}
150+
title: "Go docs for PR#${{ github.event.pull_request.number }}"
151+
body: "This PR contains automatically generated go documentation for the PR#${{ github.event.pull_request.number }}. Please review the changes."
152+
commit-message: "[Bot] Add automatically generated go documentation"
153+
154+
- name: Find comment with PR link
155+
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0
156+
id: fc
157+
with:
158+
issue-number: ${{ github.event.pull_request.number }}
159+
body-includes: Go doc generation
160+
161+
- name: Create comment in the original PR with link to the new PR
162+
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
163+
if: steps.create-pr.outputs.pull-request-number != ''
164+
with:
165+
token: ${{ steps.setup-github-token-write.outputs.access-token }}
166+
issue-number: ${{ github.event.pull_request.number }}
167+
comment-id: ${{ steps.fc.outputs.comment-id }}
168+
edit-mode: replace
169+
body: |
170+
## Go doc generation
171+
Hey @${{ github.actor }}, you can check generated Go function documentation [here](${{ steps.create-pr.outputs.pull-request-url }}). Please review them and merge to this PR once you're satisfied with them.
172+
173+
- name: Create comment in the original PR to notify about no new docs
174+
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
175+
if: steps.create-pr.outputs.pull-request-number == ''
176+
with:
177+
token: ${{ steps.setup-github-token-write.outputs.access-token }}
178+
issue-number: ${{ github.event.pull_request.number }}
179+
comment-id: ${{ steps.fc.outputs.comment-id }}
180+
edit-mode: replace
181+
body: |
182+
## Go doc generation
183+
Hey @${{ github.actor }}, no documentation was generated. Are you sure that you made changes to public functions without existing comments in your PR?
184+
185+
- name: Send Slack notification
186+
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 # v1.25.0
187+
if: failure()
188+
id: slack
189+
env:
190+
SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }}
191+
with:
192+
channel-id: 'C049X3353K2'
193+
payload: |
194+
{
195+
"attachments": [
196+
{
197+
"color": "#C62828",
198+
"blocks": [
199+
{
200+
"type": "section",
201+
"text": {
202+
"type": "mrkdwn",
203+
"text": "Go doc generation - Failed :x:"
204+
}
205+
},
206+
{
207+
"type": "section",
208+
"text": {
209+
"type": "mrkdwn",
210+
"text": "<@U060CGGPY8H>, please have a look."
211+
}
212+
},
213+
{
214+
"type": "section",
215+
"text": {
216+
"type": "mrkdwn",
217+
"text": "<${{ github.server_url }}/${{ github.repository }}/pull/${{ github.event.pull_request.number }}|PR#${{ github.event.pull_request.number }}> | <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Run Details>"
218+
}
219+
}
220+
]
221+
}
222+
]
223+
}

.github/workflows/k8s-e2e.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: (k8s package) E2E tests
22
on:
3-
pull_request:
3+
pull_request:
44

55
concurrency:
66
group: e2e-tests-k8s-${{ github.ref }}
@@ -73,7 +73,7 @@ jobs:
7373
- name: Load Nix
7474
run: nix develop -c sh -c "cd lib &&go mod download"
7575
- name: Setup environment
76-
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/setup-run-tests-environment@d2f9642bcc24a73400568756f24b72c188ac7a9a # v2.3.31
76+
uses: smartcontractkit/.github/actions/ctf-setup-run-tests-environment@49cb1613e96c9ce17f7290e4dabd38f43aa9bd4d # [email protected]
7777
with:
7878
go_mod_path: go.mod
7979
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
@@ -83,7 +83,7 @@ jobs:
8383
- name: Run Tests
8484
env:
8585
LOCAL_CHARTS: true
86-
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@d2f9642bcc24a73400568756f24b72c188ac7a9a # v2.3.31
86+
uses: smartcontractkit/.github/actions/ctf-run-tests@b8731364b119e88983e94b0c4da87fc27ddb41b8 # [email protected]
8787
with:
8888
cl_repo: ${{ env.CHAINLINK_IMAGE }}
8989
cl_image_tag: ${{ env.CHAINLINK_VERSION }}
@@ -96,7 +96,6 @@ jobs:
9696
go_mod_path: go.mod
9797
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
9898
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
99-
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
10099
run_setup: false
101100
- name: Upload test log
102101
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3

.github/workflows/k8s-publish-test-base-image.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ on:
55
# we only need base image for k8s based tests
66
- 'lib/v*'
77
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'Tag for the base image'
11+
required: true
12+
type: string
813

914
jobs:
1015
publish_test_base_image:
@@ -19,12 +24,20 @@ jobs:
1924
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
2025

2126
- name: Strip "lib/" from github.ref_name
27+
if: ${{ github.event_name == 'push' }}
2228
run: |
2329
stripped_ref_name="${GITHUB_REF//refs\/tags\/lib\//}"
2430
# disabling as the string containing variable is double-quotted as a whole, no need to quote each variable separately
2531
# shellcheck disable=SC2086
2632
echo "BASE_IMAGE_TAG=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/test-base-image:$stripped_ref_name" >> $GITHUB_ENV
2733
34+
- name: Export base image tag for workflow dispatch
35+
if: ${{ github.event_name == 'workflow_dispatch' }}
36+
shell: bash
37+
run: |
38+
# shellcheck disable=SC2086
39+
echo "BASE_IMAGE_TAG=${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/test-base-image:${{ github.event.inputs.tag }}" >> $GITHUB_ENV
40+
2841
- name: Build Base Image
2942
uses: smartcontractkit/chainlink-github-actions/docker/build-push@d2f9642bcc24a73400568756f24b72c188ac7a9a # v2.3.31
3043
with:

.github/workflows/modgraph.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Module graph
2+
on:
3+
pull_request:
4+
jobs:
5+
modgraph:
6+
runs-on: ubuntu-latest
7+
name: modgraph
8+
steps:
9+
- name: Checkout the Repo
10+
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
11+
- name: Setup Go
12+
uses: actions/setup-go@v5
13+
- run: make modgraph
14+
- name: Ensure clean modgraph
15+
run: git diff --minimal --exit-code

0 commit comments

Comments
 (0)