diff --git a/.changeset/bright-queens-joke.md b/.changeset/bright-queens-joke.md deleted file mode 100644 index a9dc2c8eb6d..00000000000 --- a/.changeset/bright-queens-joke.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"chainlink": patch ---- - -#internal Keystone - rename type -> id diff --git a/.changeset/grumpy-birds-serve.md b/.changeset/grumpy-birds-serve.md deleted file mode 100644 index 35b2c160c02..00000000000 --- a/.changeset/grumpy-birds-serve.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"chainlink": patch ---- - -withdraw in offchain mode #bugfix diff --git a/.changeset/ninety-students-return.md b/.changeset/ninety-students-return.md deleted file mode 100644 index d00737e7f24..00000000000 --- a/.changeset/ninety-students-return.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"chainlink": patch ---- - -#updated Add gethwrappers for operatorforwarder contracts diff --git a/.changeset/tall-hats-brake.md b/.changeset/tall-hats-brake.md deleted file mode 100644 index 1c11e4baeca..00000000000 --- a/.changeset/tall-hats-brake.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"chainlink": patch ---- - -get available erc20 for payment #bugfix diff --git a/.github/workflows/changesets-preview-pr.yml b/.github/workflows/changesets-preview-pr.yml new file mode 100644 index 00000000000..14a7690e657 --- /dev/null +++ b/.github/workflows/changesets-preview-pr.yml @@ -0,0 +1,68 @@ +# +# This action creates or updates a Release Preview PR that shows which changes are going to be part of the next release. +# + +name: Release Preview - Changeset + +on: + push: + branches: + - re-2590/refactor-changeset-release-preview # remove after testing + # - develop + +jobs: + changesets-release-preview: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - name: Checkout repository + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + + - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 + id: change + with: + token: ${{ secrets.GITHUB_TOKEN }} + filters: | + core-changeset: + - '.changeset/**' + + - name: Setup pnpm + uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 + if: steps.change.outputs.core-changeset == 'true' + with: + version: ^8.0.0 + + - name: Setup node + uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 + if: steps.change.outputs.core-changeset == 'true' + with: + node-version: 20 + cache: pnpm + cache-dependency-path: ./pnpm-lock.yaml + + - name: Generate new changelog + if: steps.change.outputs.core-changeset == 'true' + id: changelog + run: pnpm install && ./tools/ci/format_changelog + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create release preview PR + if: steps.change.outputs.core-changeset == 'true' + uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5 + with: + git-token: ${{ secrets.GITHUB_TOKEN }} + add-paths: | + .changeset/** + CHANGELOG.md + commit-message: "changeset: release preview" + committer: app-token-issuer-releng[bot] + branch: changesets/release-preview + title: "[DO NOT MERGE] Changeset Release Preview - v${{ steps.changelog.outputs.version }}" + body: ${{ steps.changelog.outputs.pr_body }} + draft: true + labels: | + release-preview + do-not-merge diff --git a/.github/workflows/cicd-changesets.yml b/.github/workflows/cicd-changesets.yml deleted file mode 100644 index 96363588319..00000000000 --- a/.github/workflows/cicd-changesets.yml +++ /dev/null @@ -1,74 +0,0 @@ -# -# This action creates or updates a Release Preview PR that shows which changes are going to be part of the next release -# when a PR is merged into develop branch -# - -name: Release Preview - Changeset - -on: - push: - branches: - - develop - -jobs: - cicd-changesets: - runs-on: ubuntu-latest - permissions: - id-token: write - contents: read - actions: read - steps: - - name: Checkout repository - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 - - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 - id: changeset-added - with: - token: ${{ secrets.GITHUB_TOKEN }} - filters: | - core-changeset: - - added: '.changeset/**' - - - name: Setup pnpm - uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d # v3.0.0 - if: steps.changeset-added.outputs.core-changeset == 'true' - with: - version: ^8.0.0 - - - name: Setup node - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 - if: steps.changeset-added.outputs.core-changeset == 'true' - with: - node-version: 20 - cache: pnpm - cache-dependency-path: ./pnpm-lock.yaml - - - name: Run changeset version - run: pnpm install && pnpm changeset version - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - if: steps.changeset-added.outputs.core-changeset == 'true' - - - name: Get release version - if: steps.changeset-added.outputs.core-changeset == 'true' - id: get-release-version - run: echo "version=$(jq -r '.version' package.json)" >> $GITHUB_OUTPUT - - - name: cicd-changesets - if: steps.changeset-added.outputs.core-changeset == 'true' - uses: smartcontractkit/.github/actions/cicd-changesets@6da79c7b9f14bec077df2c1ad40d53823b409d9c # cicd-changesets@0.3.3 - with: - # general inputs - git-user: app-token-issuer-releng[bot] - git-email: app-token-issuer-releng[bot]@users.noreply.github.com - pnpm-use-cache: false - pr-draft: true - pr-title: "[DO NOT MERGE] Changeset Release Preview - v${{ steps.get-release-version.outputs.version }}" - # aws inputs - aws-region: ${{ secrets.AWS_REGION }} - aws-role-arn: ${{ secrets.AWS_OIDC_CHAINLINK_CI_AUTO_PR_TOKEN_ISSUER_ROLE_ARN }} - aws-lambda-url: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }} - # grafana inputs - gc-basic-auth: ${{ secrets.GRAFANA_INTERNAL_BASIC_AUTH }} - gc-host: ${{ secrets.GRAFANA_INTERNAL_HOST }} - gc-org-id: ${{ secrets.GRAFANA_INTERNAL_TENANT_ID }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 314626a0bd6..5f10d4b6c4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog Chainlink Core +## 2.12.1 - PREVIEW + +## updated + +- [#13084](https://github.com/smartcontractkit/chainlink/pull/13084) [`d79bdf1`](https://github.com/smartcontractkit/chainlink/commit/d79bdf16c5129cf7bc7cc5114f92eb07fd3fbf02) Thanks [@austinborn](https://github.com/austinborn)! - #updated Add gethwrappers for operatorforwarder contracts + +## bugfix + +- [#13058](https://github.com/smartcontractkit/chainlink/pull/13058) [`a34a17a`](https://github.com/smartcontractkit/chainlink/commit/a34a17ae9d62679a1ff15a7703f5cbcf6dfd1d0f) Thanks [@shileiwill](https://github.com/shileiwill)! - withdraw in offchain mode #bugfix + +- [#13088](https://github.com/smartcontractkit/chainlink/pull/13088) [`29b1636`](https://github.com/smartcontractkit/chainlink/commit/29b16360fb41e4372f72fe744aaf3ee8234a9b67) Thanks [@shileiwill](https://github.com/shileiwill)! - get available erc20 for payment #bugfix + +## internal + +- [#13008](https://github.com/smartcontractkit/chainlink/pull/13008) [`841fe61`](https://github.com/smartcontractkit/chainlink/commit/841fe61daa90b980f1e1622d2f7bd8f850b55462) Thanks [@HenryNguyen5](https://github.com/HenryNguyen5)! - #internal Keystone - rename type -> id + +- [#13094](https://github.com/smartcontractkit/chainlink/pull/13094) [`36f8eae`](https://github.com/smartcontractkit/chainlink/commit/36f8eaea9c2502e239cbfabe8fb2d8eb7dbba96a) Thanks [@momentmaker](https://github.com/momentmaker)! - Refactor changesets release preview workflow #internal + ## 2.12.0 - UNRELEASED ### Minor Changes @@ -283,7 +301,7 @@ - [#12412](https://github.com/smartcontractkit/chainlink/pull/12412) [`83c8688a14`](https://github.com/smartcontractkit/chainlink/commit/83c8688a14ac04111f999d132673ebaf6a364b4a) Thanks [@poopoothegorilla](https://github.com/poopoothegorilla)! - Bump grafana to 1.1.1 -- [#12248](https://github.com/smartcontractkit/chainlink/pull/12248) [`e1950769ee`](https://github.com/smartcontractkit/chainlink/commit/e1950769ee3ff2a40ca5772b9634c45f8be241cc) Thanks [@FelixFan1992](https://github.com/FelixFan1992)! - Add version support for automation registry 2.\* +- [#12248](https://github.com/smartcontractkit/chainlink/pull/12248) [`e1950769ee`](https://github.com/smartcontractkit/chainlink/commit/e1950769ee3ff2a40ca5772b9634c45f8be241cc) Thanks [@FelixFan1992](https://github.com/FelixFan1992)! - Add version support for automation registry 2.* ## 2.10.0 - 2024-04-05 @@ -859,8 +877,8 @@ The following `AUDIT_LOGGER_*` environment variables below configure this option An optional list of HTTP headers to be added for every optional audit log event. If the above `AUDIT_LOGGER_FORWARD_TO_URL` is set, audit log events will be POSTed to that URL, and will include headers specified in this environment variable. One example use case is auth for example: `AUDIT_LOGGER_HEADERS="Authorization||{{token}}"`. -Header keys and values are delimited on ||, and multiple headers can be added with a forward slash delimiter ('\\'). An example of multiple key value pairs: -`AUDIT_LOGGER_HEADERS="Authorization||{{token}}\Some-Other-Header||{{token2}}"` +Header keys and values are delimited on ||, and multiple headers can be added with a forward slash delimiter ('\'). An example of multiple key value pairs: +`AUDIT_LOGGER_HEADERS="Authorization||{{token}}Some-Other-Header||{{token2}}"` ##### AUDIT_LOGGER_JSON_WRAPPER_KEY @@ -1072,7 +1090,7 @@ If minConfirmations > 0 and failOnRevert=true then the ethtx task will error on If `minConfirmations` is not set on the task, the chain default will be used which is usually 12 and always greater than 0. -- `http` task now allows specification of request headers. Use like so: `foo [type=http headers="[\\"X-Header-1\\", \\"value1\\", \\"X-Header-2\\", \\"value2\\"]"]`. +- `http` task now allows specification of request headers. Use like so: `foo [type=http headers="[\"X-Header-1\", \"value1\", \"X-Header-2\", \"value2\"]"]`. ### Fixed @@ -1088,7 +1106,7 @@ If `minConfirmations` is not set on the task, the chain default will be used whi ### Fixed -- Ensure failed EthSubscribe didn't register a (\*rpc.ClientSubscription)(nil) which would lead to a panic on Unsubscribe +- Ensure failed EthSubscribe didn't register a (*rpc.ClientSubscription)(nil) which would lead to a panic on Unsubscribe - Fixes parsing of float values on job specs ## [1.4.0] - 2022-05-02 @@ -1113,7 +1131,7 @@ If `minConfirmations` is not set on the task, the chain default will be used whi ### Added - Added support for Keeper registry v1.2 in keeper jobs -- Added disk rotating logs. Chainlink will now always log to disk at debug level. The default output directory for debug logs is Chainlink's root directory (ROOT_DIR) but can be configured by setting LOG_FILE_DIR. This makes it easier for node operators to report useful debugging information to Chainlink's team, since all the debug logs are conveniently located in one directory. Regular logging to STDOUT still works as before and respects the LOG_LEVEL env var. If you want to log in disk at a particular level, you can pipe STDOUT to disk. This automatic debug-logs-to-disk feature is enabled by default, and will remain enabled as long as the `LOG_FILE_MAX_SIZE` ENV var is set to a value greater than zero. The amount of disk space required for this feature to work can be calculated with the following formula: `LOG_FILE_MAX_SIZE` \* (`LOG_FILE_MAX_BACKUPS` + 1). If your disk doesn't have enough disk space, the logging will pause and the application will log Errors until space is available again. New environment variables related to this feature: +- Added disk rotating logs. Chainlink will now always log to disk at debug level. The default output directory for debug logs is Chainlink's root directory (ROOT_DIR) but can be configured by setting LOG_FILE_DIR. This makes it easier for node operators to report useful debugging information to Chainlink's team, since all the debug logs are conveniently located in one directory. Regular logging to STDOUT still works as before and respects the LOG_LEVEL env var. If you want to log in disk at a particular level, you can pipe STDOUT to disk. This automatic debug-logs-to-disk feature is enabled by default, and will remain enabled as long as the `LOG_FILE_MAX_SIZE` ENV var is set to a value greater than zero. The amount of disk space required for this feature to work can be calculated with the following formula: `LOG_FILE_MAX_SIZE` * (`LOG_FILE_MAX_BACKUPS` + 1). If your disk doesn't have enough disk space, the logging will pause and the application will log Errors until space is available again. New environment variables related to this feature: - `LOG_FILE_MAX_SIZE` (default: 5120mb) - this env var allows you to override the log file's max size (in megabytes) before file rotation. - `LOG_FILE_MAX_AGE` (default: 0) - if `LOG_FILE_MAX_SIZE` is set, this env var allows you to override the log file's max age (in days) before file rotation. Keeping this config with the default value means not to remove old log files. - `LOG_FILE_MAX_BACKUPS` (default: 1) - if `LOG_FILE_MAX_SIZE` is set, this env var allows you to override the max amount of old log files to retain. Keeping this config with the default value means to retain 1 old log file at most (though `LOG_FILE_MAX_AGE` may still cause them to get deleted). If this is set to 0, the node will retain all old log files instead. @@ -2056,7 +2074,7 @@ Note that it has no effect on FMv1 jobs. Node operators will need to upgrade to - Task definitions in v2 jobs (those with TOML specs) now support quoting strings with angle brackets (which DOT already permitted). This is particularly useful when defining JSON blobs to post to external adapters. For example: ``` - my_bridge [type=bridge name="my_bridge" requestData="{\\"hi\\": \\"hello\\"}"] + my_bridge [type=bridge name="my_bridge" requestData="{\"hi\": \"hello\"}"] ``` ... can now be written as: diff --git a/tools/ci/format_changelog b/tools/ci/format_changelog new file mode 100755 index 00000000000..bc5cdeaeb32 --- /dev/null +++ b/tools/ci/format_changelog @@ -0,0 +1,162 @@ +#!/usr/bin/env bash + +create_changesets_json() { + echo "[[]]" > changesets.json +} + +create_tags_json() { + json="{}" + for tag in "${tags_list[@]}"; do + tag=${tag:1} + json=$(jq --arg k "$tag" '.[$k] = []' <<< "$json") + done + echo "$json" > tags.json +} + +append_changeset_content() { + if [[ $1 != "" ]]; then + jq --argjson idx "$changesets_index" --arg str "$1" \ + '.[$idx] += [$str]' changesets.json > tmp.json && mv tmp.json changesets.json + fi +} + +append_changelog_content() { + for tag in "${tags_list[@]}"; do + tag=${tag:1} + array_length=$(jq -r --arg key "$tag" '.[$key] | length' tags.json) + if [[ $array_length -eq 0 ]]; then + continue + fi + changesets=$(jq -r --arg key "$tag" '.[$key] | join("\n\n")' tags.json) + read -d '' changelog_content <> $GITHUB_OUTPUT + read -d '' pr_header <> $GITHUB_OUTPUT + echo "${pr_body}" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT +} + +set_new_changelog_content() { + read -d '' new_changelog < CHANGELOG.md +} + +# checks for tags in each changeset entry and append to tags.json +match_tags() { + changesets_with_index=$(jq -r 'to_entries | .[] | "\(.key) \(.value | join(" "))"' changesets.json) + + echo "$changesets_with_index" | while IFS= read -r line; do + index="${line%% *}" + changeset_content="${line#* }" + changeset_formatted=$(jq -r --argjson idx "$index" '.[$idx] | join("\n")' changesets.json) + found_tag="" + for tag in "${tags_list[@]}"; do + if [[ "$changeset_content" =~ $tag ]]; then + found_tag=${tag:1} + jq --arg key "$found_tag" --arg val "$changeset_formatted" \ + '.[$key] += [$val]' tags.json > tmp.json && mv tmp.json tags.json + fi + done + if [[ $found_tag == "" ]] && [[ ! -z $changeset_content ]]; then + found_tag="untagged" + jq --arg key "$found_tag" --arg val "$changeset_formatted" \ + '.[$key] += [$val]' tags.json > tmp.json && mv tmp.json tags.json + fi + done +} + +cleanup() { + rm -f CHANGELOG.md.tmp + rm -f changesets.json + rm -f tags.json +} + +### SCRIPT STARTS HERE ### +cp CHANGELOG.md CHANGELOG.md.tmp +tail -n +2 CHANGELOG.md > CHANGELOG.md.tmp + +pnpm changeset version + +version=$(jq -r '.version' package.json) +read -d '' changelog_content <