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

.github/workflows: specify core ref in PR desc #307

Merged
merged 9 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions .github/workflows/ccip-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,35 @@
go-version: ${{ matrix.go-version }}
- name: Display Go version
run: go version
- name: Fetch latest pull request data
id: fetch_pr_data
uses: actions/github-script@v6

Check warning on line 31 in .github/workflows/ccip-integration-test.yml

View workflow job for this annotation

GitHub Actions / Validate Workflow Changes

1. Action is using node16 (node-version / warning)
with:
script: |
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});
return pr.data.body;
- name: Get the chainlink commit sha from PR description, if applicable
id: get_chainlink_sha
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
comment=$(echo "${{ steps.fetch_pr_data.outputs.result }}" | tr -d '"')
echo $comment
core_ref="$(echo "$comment" | grep -oP 'core ref: \K\S+' || true)"
echo "::set-output name=ref::$core_ref"
else
echo "::set-output name=ref::develop"
fi
- name: Clone Chainlink repo
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
repository: smartcontractkit/chainlink
ref: develop
ref: ${{ steps.get_chainlink_sha.outputs.ref }}
path: chainlink
- name: Get the correct commit SHA via GitHub API
- name: Get the correct chainlink-ccip commit SHA via GitHub API
id: get_sha
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
Expand Down Expand Up @@ -81,7 +103,7 @@
- name: Run ccip ocr3 add chain integration test
run: |
cd $GITHUB_WORKSPACE/chainlink/deployment
go test -v -run '^TestAddChainInbound$' -timeout 6m ./ccip/
go test -v -run '^TestAddChainInbound$' -timeout 6m ./ccip/changeset
EXITCODE=${PIPESTATUS[0]}
if [ $EXITCODE -ne 0 ]; then
echo "Integration test failed"
Expand Down
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,21 @@ make generate

## Development Cycle

In order to keep the `ccip-develop` branch in working condition, we need to make sure the integration test
[written in the CCIP repo](https://github.com/smartcontractkit/ccip/blob/03ae3bbed0e6020be5fa9be26d03af21f152d7dc/core/capabilities/ccip/ccip_integration_tests/ocr3_node_test.go#L37)
In order to keep the `main` branch in working condition, we need to make sure the integration tests
[written in the CCIP repo](https://github.com/smartcontractkit/chainlink/blob/340a6bfdf54745dd1c6d9f322d9c9515c97060bb/deployment/ccip/changeset/initial_deploy_test.go#L19)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, we run only this single test? It doesn't seem correct, does it? I think as part of this CI action we run every e2e/integration test for ccip 1.6 we have in the chainlink repository. Especially now, when putting more effort to work on these

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we need to rethink these, maybe as a matrix so we can parallelize

will pass.

As such, part of CI will run this integration test combined with your latest pushed change.

Follow the steps below to ensure that we don't run into any unexpected breakages.

1. Create a PR on chainlink-ccip with the changes you want to make.
2. CI will run the integration test in the CCIP repo after applying your changes.
2. CI will run the integration test in the chainlink repo after applying your changes.
3. If the integration test fails, make sure to fix it first before merging your changes into
the `ccip-develop` branch of chainlink-ccip. You can do this by:
the `main` branch of chainlink-ccip. You can do this by:
- Creating a branch in the CCIP repo and running `go get github.com/smartcontractkit/chainlink-ccip@<your-branch-commit-sha>`.
- Fixing the build/tests.
4. Once your ccip PR is approved, merge it.
5. Go back to your chainlink-ccip PR and re-run the integration test workflow.
6. Once the integration test passes, merge your chainlink-ccip PR into `ccip-develop`, however do not delete the branch on the remote.
7. Create a new PR in ccip that points to the newly merged commit in the `ccip-develop` tree and merge that.

[ocr3]: https://github.com/smartcontractkit/libocr/blob/master/offchainreporting2plus/ocr3types/plugin.go#L108
- You can specify a particular commit hash on the chainlink repo by adding "core ref: commit sha" to your PR description. See [this](https://github.com/smartcontractkit/chainlink-ccip/pull/307) as an example. If you update the description, manually rerun the workflow.
4. Once your chainlink-ccip PR is approved, merge it.
5. Go back to your chainlink PR and bump the chainlink-ccip version to the latest main.
6. Once the integration test passes, merge your chainlink PR into `develop`.
Loading