Skip to content

Commit

Permalink
Merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
connorwstein committed Dec 3, 2024
2 parents 69bc98b + 3cecd5f commit 3e1ef01
Show file tree
Hide file tree
Showing 31 changed files with 859 additions and 168 deletions.
5 changes: 5 additions & 0 deletions .changeset/tricky-clouds-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

Updated Solana TXM to store prebroadcast transaction errors caught upfront by simulation. Refactored error parsing to more easily introduce new error cases. Optimized storing finalized and errored transaction to minimize memory usage. #updated
2 changes: 1 addition & 1 deletion .github/actions/version-file-bump/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: version-file-bump
description: "Ensure that the VERSION file has been bumped since the last release."
description: "Ensure that the package.json version field has been bumped since the last release."
inputs:
github-token:
description: "Github access token"
Expand Down
131 changes: 65 additions & 66 deletions .github/workflows/build-publish-develop-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: "Build and Publish GoReleaser"

on:
pull_request:
# The default types are opened, synchronize, and reopened
# See https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request
# We add a label trigger too, since when the build-publish label is added to a PR, we want to build and publish
# The default types are opened, synchronize, and reopened
# See https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request
# We add a label trigger too, since when the build-publish label is added to a PR, we want to build and publish
types:
- opened
- synchronize
Expand All @@ -28,49 +28,41 @@ env:
# a commit is pushed to develop before merge is run.
CHECKOUT_REF: ${{ github.event.inputs.git_ref || github.sha }}


jobs:
merge:
image-tag:
runs-on: ubuntu-latest
needs: [split, image-tag]
if: ${{ needs.image-tag.outputs.release-type == 'nightly' }}
permissions:
id-token: write
contents: read
outputs:
image-tag: ${{ steps.get-image-tag.outputs.image-tag }}
release-type: ${{ steps.get-image-tag.outputs.release-type }}
steps:
- name: Checkout repository
uses: actions/checkout@v4.2.1
with:
ref: ${{ env.CHECKOUT_REF }}

- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
role-to-assume: ${{ secrets.AWS_OIDC_IAM_ROLE_BUILD_PUBLISH_DEVELOP_PR }}
aws-region: ${{ secrets.AWS_REGION }}
mask-aws-account-id: true
role-session-name: "merge"

- uses: actions/cache/restore@v4.1.1
with:
path: dist/linux_amd64_v1
key: chainlink-amd64-${{ github.sha }}
fail-on-cache-miss: true

- uses: actions/cache/restore@v4.1.1
with:
path: dist/linux_arm64_v8.0
key: chainlink-arm64-${{ github.sha }}
fail-on-cache-miss: true

- name: Merge images for both architectures
uses: ./.github/actions/goreleaser-build-sign-publish
with:
docker-registry: ${{ secrets.AWS_SDLC_ECR_HOSTNAME }}
docker-image-tag: ${{ needs.image-tag.outputs.image-tag }}
goreleaser-release-type: "merge"
goreleaser-config: .goreleaser.develop.yaml
goreleaser-key: ${{ secrets.GORELEASER_KEY }}
- name: Get image tag
id: get-image-tag
run: |
short_sha=$(git rev-parse --short HEAD)
echo "release-type=snapshot" | tee -a $GITHUB_OUTPUT
if [[ ${{ github.event_name }} == 'push' ]]; then
echo "image-tag=develop" | tee -a $GITHUB_OUTPUT
echo "release-type=nightly" | tee -a $GITHUB_OUTPUT
elif [[ ${{ github.event_name }} == 'workflow_dispatch' ]]; then
echo "image-tag=${short_sha}" | tee -a $GITHUB_OUTPUT
if [[ "${{ inputs.build-publish }}" == 'false' ]]; then
echo "release-type=snapshot" | tee -a $GITHUB_OUTPUT
else
echo "release-type=nightly" | tee -a $GITHUB_OUTPUT
fi
else
if [[ ${{ github.event_name }} == "pull_request" ]]; then
echo "image-tag=pr-${{ github.event.number }}-${short_sha}" | tee -a $GITHUB_OUTPUT
if [[ ${{ contains(github.event.pull_request.labels.*.name, 'build-publish') }} == "true" ]]; then
echo "release-type=nightly" | tee -a $GITHUB_OUTPUT
fi
fi
fi
split:
name: "split-${{ matrix.goarch }}"
Expand Down Expand Up @@ -113,45 +105,52 @@ jobs:

- name: Build images for ${{ matrix.goarch }}
uses: ./.github/actions/goreleaser-build-sign-publish
if: steps.cache.outputs.cache-hit != 'true'
if: github.event_name == 'workflow_dispatch' || steps.cache.outputs.cache-hit != 'true'
with:
docker-registry: ${{ secrets.AWS_SDLC_ECR_HOSTNAME }}
docker-image-tag: ${{ needs.image-tag.outputs.image-tag }}
goreleaser-release-type: ${{ needs.image-tag.outputs.release-type }}
goreleaser-config: .goreleaser.develop.yaml
goreleaser-key: ${{ secrets.GORELEASER_KEY }}

image-tag:
merge:
runs-on: ubuntu-latest
outputs:
image-tag: ${{ steps.get-image-tag.outputs.image-tag }}
release-type: ${{ steps.get-image-tag.outputs.release-type }}
needs: [split, image-tag]
if: ${{ needs.image-tag.outputs.release-type == 'nightly' }}
permissions:
id-token: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4.2.1
with:
ref: ${{ env.CHECKOUT_REF }}

- name: Get image tag
id: get-image-tag
run: |
short_sha=$(git rev-parse --short HEAD)
echo "release-type=snapshot" | tee -a $GITHUB_OUTPUT
if [[ ${{ github.event_name }} == 'push' ]]; then
echo "image-tag=develop" | tee -a $GITHUB_OUTPUT
echo "release-type=nightly" | tee -a $GITHUB_OUTPUT
elif [[ ${{ github.event_name }} == 'workflow_dispatch' ]]; then
echo "image-tag=${short_sha}" | tee -a $GITHUB_OUTPUT
if [[ "${{ inputs.build-publish }}" == 'false' ]]; then
echo "release-type=snapshot" | tee -a $GITHUB_OUTPUT
else
echo "release-type=nightly" | tee -a $GITHUB_OUTPUT
fi
else
if [[ ${{ github.event_name }} == "pull_request" ]]; then
echo "image-tag=pr-${{ github.event.number }}-${short_sha}" | tee -a $GITHUB_OUTPUT
if [[ ${{ contains(github.event.pull_request.labels.*.name, 'build-publish') }} == "true" ]]; then
echo "release-type=nightly" | tee -a $GITHUB_OUTPUT
fi
fi
fi
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
role-to-assume: ${{ secrets.AWS_OIDC_IAM_ROLE_BUILD_PUBLISH_DEVELOP_PR }}
aws-region: ${{ secrets.AWS_REGION }}
mask-aws-account-id: true
role-session-name: "merge"

- uses: actions/cache/restore@v4.1.1
with:
path: dist/linux_amd64_v1
key: chainlink-amd64-${{ github.sha }}
fail-on-cache-miss: true

- uses: actions/cache/restore@v4.1.1
with:
path: dist/linux_arm64_v8.0
key: chainlink-arm64-${{ github.sha }}
fail-on-cache-miss: true

- name: Merge images for both architectures
uses: ./.github/actions/goreleaser-build-sign-publish
with:
docker-registry: ${{ secrets.AWS_SDLC_ECR_HOSTNAME }}
docker-image-tag: ${{ needs.image-tag.outputs.image-tag }}
goreleaser-release-type: "merge"
goreleaser-config: .goreleaser.develop.yaml
goreleaser-key: ${{ secrets.GORELEASER_KEY }}
44 changes: 37 additions & 7 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,48 @@ on:

env:
ECR_HOSTNAME: public.ecr.aws
ECR_IMAGE_NAME: chainlink/chainlink

jobs:
checks:
name: "Checks"
runs-on: ubuntu-20.04
outputs:
git-tag-type: ${{ steps.check-git-tag-type.outputs.git-tag-type }}
ecr-image-name: ${{ steps.check-git-tag-type.outputs.ecr-image-name }}
steps:
- name: Checkout repository
uses: actions/checkout@v4.2.1
- name: Check git tag type
id: check-git-tag-type
shell: bash
env:
GIT_TAG: ${{ github.ref_name}}
run: |
# Check if git tag is related to CCIP
# Should match:
# v1.0.0-ccip1.0.0-beta.1
# v1.0.0-ccip1.0.0-rc.0
# v1.0.0-ccip1.0.0
if [[ $GIT_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+-ccip[0-9]+\.[0-9]+\.[0-9]+(-((beta|rc)\.[0-9]+))?$ ]]; then
echo "git-tag-type=ccip" | tee -a "$GITHUB_OUTPUT"
echo "ecr-image-name=chainlink/ccip" | tee -a "$GITHUB_OUTPUT"
else
echo "git-tag-type=core" | tee -a "$GITHUB_OUTPUT"
echo "ecr-image-name=chainlink/chainlink" | tee -a "$GITHUB_OUTPUT"
fi
- name: Fail if CCIP release has wrong version
if: ${{ steps.check-git-tag-type.outputs.git-tag-type == 'ccip' }}
run: |
version=$(jq -r '.version' ./package.json)
echo "Package version: $version"
echo "Git tag type: ${{ steps.check-git-tag-type.outputs.git-tag-type }}"
if [[ $version != *"-ccip"* ]]; then
echo "Error: Version '$version' does not match required CCIP format."
exit 1
fi
- name: Check for VERSION file bump on tags
# Avoids checking VERSION file bump on forks.
if: ${{ github.repository == 'smartcontractkit/chainlink' }}
# Avoids checking VERSION file bump on forks or from CCIP releases.
if: ${{ github.repository == 'smartcontractkit/chainlink' && steps.check-git-tag-type.outputs.git-tag-type == 'core' }}
uses: ./.github/actions/version-file-bump
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -47,7 +77,7 @@ jobs:
aws-role-duration-seconds: ${{ secrets.AWS_ROLE_DURATION_SECONDS }}
aws-region: ${{ secrets.AWS_REGION }}
ecr-hostname: ${{ env.ECR_HOSTNAME }}
ecr-image-name: ${{ env.ECR_IMAGE_NAME }}
ecr-image-name: ${{ needs.checks.outputs.ecr-image-name }}
dockerhub_username: ${{ secrets.DOCKERHUB_READONLY_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_READONLY_PASSWORD }}
sign-images: true
Expand All @@ -57,13 +87,13 @@ jobs:
uses: actions/attest-build-provenance@6149ea5740be74af77f260b9db67e633f6b0a9a1 # v1.4.2
with:
subject-digest: ${{ steps.build-sign-publish.outputs.docker-image-digest }}
subject-name: ${{ env.ECR_HOSTNAME }}/${{ env.ECR_IMAGE_NAME }}
subject-name: ${{ env.ECR_HOSTNAME }}/${{ needs.checks.outputs.ecr-image-name }}
push-to-registry: true

# Notify Slack channel for new git tags.
slack-notify:
if: github.ref_type == 'tag'
needs: [build-sign-publish-chainlink]
needs: [checks, build-sign-publish-chainlink]
runs-on: ubuntu-24.04
environment: build-publish
steps:
Expand Down Expand Up @@ -91,7 +121,7 @@ jobs:
format(
'{0}/{1}:{2}',
env.ECR_HOSTNAME,
env.ECR_IMAGE_NAME,
needs.checks.outputs.ecr-image-name,
needs.build-sign-publish-chainlink.outputs.docker-image-tag
) || ''
}}
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/flakeguard-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Flakeguard Nightly

on:
schedule:
# Run every night at 3:00 AM UTC
- cron: '0 3 * * *'
workflow_dispatch:

jobs:
trigger-flaky-test-detection:
name: Find Flaky Tests
uses: ./.github/workflows/flakeguard.yml
with:
repoUrl: 'https://github.com/smartcontractkit/chainlink'
baseRef: 'origin/develop'
projectPath: '.'
maxPassRatio: '1.0'
runAllTests: true
extraArgs: '{ "skipped_tests": "TestChainComponents", "test_repeat_count": "5", "all_tests_runner": "ubuntu22.04-32cores-128GB", "all_tests_runner_count": "3", "run_with_race": "false" }'
slackNotificationAfterTestsChannelId: 'C07TRF65CNS' #flaky-test-detector-notifications
secrets:
SLACK_BOT_TOKEN: ${{ secrets.QA_SLACK_API_KEY }}
3 changes: 0 additions & 3 deletions .github/workflows/flakeguard-on-demand.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Flakeguard On Demand

on:
schedule:
# Run every night at 3:00 AM UTC
- cron: '0 3 * * *'
workflow_dispatch:
inputs:
repoUrl:
Expand Down
26 changes: 16 additions & 10 deletions .github/workflows/flakeguard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:

- name: Install flakeguard
shell: bash
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@04bfae2602c015036f366a8dd4e7a619096cc516 # flakguard@0.1.0
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@f03577def97a20a38c0e1de1cbe7fc98d416dd86 # flakguard@0.1.0

- name: Find new or updated test packages
if: ${{ inputs.runAllTests == false }}
Expand Down Expand Up @@ -259,7 +259,7 @@ jobs:

- name: Install flakeguard
shell: bash
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@04bfae2602c015036f366a8dd4e7a619096cc516 # flakguard@0.1.0
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@f03577def97a20a38c0e1de1cbe7fc98d416dd86 # flakguard@0.1.0

- name: Run tests with flakeguard
shell: bash
Expand All @@ -283,6 +283,11 @@ jobs:
outputs:
test_results: ${{ steps.set_test_results.outputs.results }}
steps:
- name: Checkout repository
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
ref: ${{ env.GIT_HEAD_REF }}

- name: Set Pretty Project Path
id: set_project_path_pretty
run: |
Expand All @@ -295,37 +300,38 @@ jobs:
- name: Download all test result artifacts
uses: actions/download-artifact@v4.1.8
with:
path: test_results
path: ci_test_results
pattern:
test-result-${{ needs.get-tests.outputs.workflow_id }}-*

- name: Install flakeguard
shell: bash
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@04bfae2602c015036f366a8dd4e7a619096cc516 # flakguard@0.1.0
run: go install github.com/smartcontractkit/chainlink-testing-framework/tools/flakeguard@f03577def97a20a38c0e1de1cbe7fc98d416dd86 # flakguard@0.1.0

- name: Set combined test results
id: set_test_results
shell: bash
run: |
set -e # Exit immediately if a command exits with a non-zero status.
if [ -d "test_results" ]; then
cd test_results
if [ -d "ci_test_results" ]; then
cd ci_test_results
ls -R .
# Fix flakeguard binary path
PATH=$PATH:$(go env GOPATH)/bin
export PATH
# Use flakeguard to aggregate all test results
flakeguard aggregate-results --results-path . --output-results ../all_tests.json
flakeguard aggregate-results --results-path . --output-results ../all_tests.json --project-path=${{ github.workspace }}/${{ inputs.projectPath }} --codeowners-path=${{ github.workspace }}/.github/CODEOWNERS
# Count all tests
ALL_TESTS_COUNT=$(jq '.Results | length' ../all_tests.json)
echo "All tests count: $ALL_TESTS_COUNT"
echo "all_tests_count=$ALL_TESTS_COUNT" >> "$GITHUB_OUTPUT"
# Use flakeguard to filter and output failed tests based on MaxPassRatio
flakeguard aggregate-results --filter-failed=true --max-pass-ratio=${{ inputs.maxPassRatio }} --results-path . --output-results ../failed_tests.json --output-logs ../failed_test_logs.json --project-path=${{ inputs.projectPath }} --codeowners-path=.github/CODEOWNERS
flakeguard aggregate-results --filter-failed=true --max-pass-ratio=${{ inputs.maxPassRatio }} --results-path . --output-results ../failed_tests.json --output-logs ../failed_test_logs.json --project-path=${{ github.workspace }}/${{ inputs.projectPath }} --codeowners-path=${{ github.workspace }}/.github/CODEOWNERS
# Count failed tests
if [ -f "../failed_tests.json" ]; then
Expand All @@ -342,7 +348,7 @@ jobs:
fi
- name: Tests Summary
if: always()
if: ${{ fromJson(steps.set_test_results.outputs.all_tests_count) > 0 }}
run: |
FILE_SIZE=$(wc -c < all_tests.md)
echo "File size: $FILE_SIZE bytes"
Expand Down Expand Up @@ -412,7 +418,7 @@ jobs:
script: |
const fs = require('fs');
const prNumber = context.payload.pull_request.number;
const commentBody = fs.readFileSync('../all_tests.md', 'utf8');
const commentBody = fs.readFileSync('all_tests.md', 'utf8');
await github.rest.issues.createComment({
owner: context.repo.owner,
Expand Down
Loading

0 comments on commit 3e1ef01

Please sign in to comment.