Skip to content

Commit

Permalink
[TT-1600] corrected handling of tags (#14312)
Browse files Browse the repository at this point in the history
* strip 'v' prefix only from Docker image, not from github release tag, if compatibility pipeline is triggered by tag

* comment out Slack notification

* ping another user if compat fails

* fail cron test on purpose

* do not fail test on purpose

* use image version from input, not env, as it doesn't work for tags
  • Loading branch information
Tofel authored Sep 4, 2024
1 parent 544ded0 commit 3ba567d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build-chainlink-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ runs:
shell: sh
run: |
echo "### Chainlink node image tag used for this test run :link:" >>$GITHUB_STEP_SUMMARY
echo "\`${GITHUB_SHA}\`" >>$GITHUB_STEP_SUMMARY
echo "\`${{inputs.git_commit_sha}}\`" >>$GITHUB_STEP_SUMMARY
25 changes: 19 additions & 6 deletions .github/workflows/client-compatibility-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ jobs:
outputs:
evm_implementations: ${{ steps.select-implementations.outputs.evm_implementations }}
chainlink_version: ${{ steps.select-chainlink-version.outputs.chainlink_version }}
chainlink_image_version: ${{ steps.select-chainlink-version.outputs.chainlink_image_version }}
latest_image_count: ${{ steps.get-image-count.outputs.image_count }}
chainlink_ref_path: ${{ steps.select-chainlink-version.outputs.cl_ref_path }}
steps:
Expand Down Expand Up @@ -197,42 +198,52 @@ jobs:
echo "Fetching latest Chainlink stable version"
implementations_arr=()
# we use 100 days since we really want the latest one, and it's highly improbable there won't be a release in last 100 days
chainlink_version=$(ghlatestreleasechecker "smartcontractkit/chainlink" 100)
chainlink_version=$(ghlatestreleasechecker "smartcontractkit/chainlink" 100)
chainlink_image_version=$chainlink_version
cl_ref_path="releases"
elif [ "$GITHUB_EVENT_NAME" = "workflow_dispatch" ]; then
echo "Fetching Chainlink version from input"
if [ -n "${{ github.event.inputs.chainlinkVersion }}" ]; then
echo "Chainlink version provided in input"
chainlink_version="${{ github.event.inputs.chainlinkVersion }}"
chainlink_version="${{ github.event.inputs.chainlinkVersion }}"
if [[ "$chainlink_version" =~ ^[0-9a-f]{40}$ ]]; then
cl_ref_path="commit"
chainlink_image_version=$chainlink_version
else
cl_ref_path="releases"
# strip the 'v' from the version, because we tag our Docker images without it
chainlink_image_version="${chainlink_version#v}"
fi
else
echo "Chainlink version not provided in input. Using latest commit SHA."
chainlink_version=${{ github.sha }}
chainlink_image_version=$chainlink_version
cl_ref_path="commit"
fi
elif [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
echo "Fetching Chainlink version from PR's head commit"
chainlink_version="${{ github.event.pull_request.head.sha }}"
chainlink_image_version=$chainlink_version
cl_ref_path="commit"
elif [ "$GITHUB_EVENT_NAME" = "merge_queue" ]; then
echo "Fetching Chainlink version from merge queue's head commit"
chainlink_version="${{ github.event.merge_group.head_sha }}"
chainlink_image_version=$chainlink_version
cl_ref_path="commit"
elif [ "$GITHUB_REF_TYPE" = "tag" ]; then
echo "Fetching Chainlink version from tag"
chainlink_version="${{ github.ref_name }}"
chainlink_version=${chainlink_version#v}
# strip the 'v' from the version, because we tag our Docker images without it
chainlink_image_version="${chainlink_version#v}"
cl_ref_path="releases"
else
echo "Unsupported trigger event. It's probably an issue with the pipeline definition. Please reach out to the Test Tooling team."
exit 1
fi
echo "Will use following Chainlink version: $chainlink_version"
echo "chainlink_version=$chainlink_version" >> $GITHUB_OUTPUT
echo "Will use following Chainlink Docker image version: $chainlink_image_version"
echo "chainlink_image_version=$chainlink_image_version" >> $GITHUB_OUTPUT
echo "cl_ref_path=$cl_ref_path" >> $GITHUB_OUTPUT
- name: Get image count
id: get-image-count
Expand Down Expand Up @@ -315,7 +326,9 @@ jobs:
with:
tag_suffix: ""
dockerfile: core/chainlink.Dockerfile
git_commit_sha: ${{ needs.select-versions.outputs.chainlink_version }}
# for tagged releases Docker image version is different from the Chainlink version (v2.13.0 -> 2.13.0)
# for all other cases (PRs, commits, etc.) Docker image version is the same as the Chainlink version
git_commit_sha: ${{ needs.select-versions.outputs.chainlink_image_version }}
check_image_exists: "true"
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
Expand Down Expand Up @@ -629,7 +642,7 @@ jobs:
with:
test_command_to_run: cd ./integration-tests && touch .root_dir && go test -timeout 30m -count=1 -json ${{ matrix.evm_node.run }} 2>&1 | tee /tmp/gotest.log | gotestloghelper -ci -singlepackage -hidepassingtests=false -hidepassinglogs
test_download_vendor_packages_command: cd ./integration-tests && go mod download
test_config_chainlink_version: ${{ needs.select-versions.outputs.chainlink_version }}
test_config_chainlink_version: ${{ needs.select-versions.outputs.chainlink_image_version }}
test_config_selected_networks: ${{ env.SELECTED_NETWORKS}}
test_config_logging_run_id: ${{ github.run_id }}
test_config_test_log_collect: ${{ vars.TEST_LOG_COLLECT }}
Expand Down Expand Up @@ -710,7 +723,7 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "${{ contains(join(needs.*.result, ','), 'failure') && format('Some tests failed, notifying <!subteam^{0}|bix-scale-eng>', secrets.COMPAT_SLACK_NOTIFICATION_HANDLE) || 'All Good!' }}"
"text": "${{ contains(join(needs.*.result, ','), 'failure') && format('Some tests failed, notifying <!subteam^{0}|bix-ship-emergent-task>', secrets.COMPAT_SLACK_NOTIFICATION_HANDLE) || 'All Good!' }}"
}
},
{
Expand Down

0 comments on commit 3ba567d

Please sign in to comment.