diff --git a/.github/ISSUE_TEMPLATE/patch_release.md b/.github/ISSUE_TEMPLATE/patch_release.md index ccc19617b..455b56f28 100644 --- a/.github/ISSUE_TEMPLATE/patch_release.md +++ b/.github/ISSUE_TEMPLATE/patch_release.md @@ -28,11 +28,14 @@ examples of each step, assuming vX.Y.Z is being cut. - [ ] `xp/getting-started-with-aws-with-vpc` - [ ] `xp/getting-started-with-azure` - [ ] `xp/getting-started-with-gcp` +- [ ] Confirm the full set of patch versions that will be released and promote them from lowest to highest, so the **highest** version is the **last** to be promoted (e.g. `v1.12.2` should be promoted after `v1.11.3`), in order to avoid the promote workflow overwriting the latest patch release. - [ ] Run the [Promote workflow][promote-workflow] with channel `stable` on the `release-X.Y` branch and verified that the tagged build version exists on the [releases.crossplane.io] `stable` channel at `stable/vX.Y.Z/...`. - [ ] Published a [new release] for the tagged version, with the same name as the version and descriptive release notes, taking care of generating the changes list selecting as "Previous tag" `vX.Y.`, so the previous patch release for the same minor. Before publishing the release notes, set them as Draft and ask the rest of the team to double check them. - [ ] Ensured that users have been notified of the release on all communication channels: - [ ] Slack: `#announcements` channel on Crossplane's Slack workspace. - [ ] Twitter: reach out to a Crossplane maintainer or steering committee member, see [OWNERS.md][owners]. + - [ ] LinkedIn: same as Twitter +- [ ] Remove any extra permissions given to release team members for this release [ci-workflow]: https://github.com/crossplane/crossplane/actions/workflows/ci.yml diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md index 5f786ce0e..b3ba2e6b7 100644 --- a/.github/ISSUE_TEMPLATE/release.md +++ b/.github/ISSUE_TEMPLATE/release.md @@ -26,6 +26,7 @@ examples of each step, assuming release vX.Y.0 is being cut. - [ ] Created and merged an empty commit to the `master` branch, if required to have it at least one commit ahead of the release branch. - [ ] Run the [Tag workflow][tag-workflow] on the `master` branch with the release candidate tag for the next release `vX.Y+1.0-rc.0`. - [ ] Opened a [docs release issue]. +- [ ] Checked that the [GitHub milestone] for this release only contains closed issues - [ ] Run the [Tag workflow][tag-workflow] on the `release-X.Y` branch with the proper release version, `vX.Y.0`. Message suggested, but not required: `Release vX.Y.0`. - [ ] Run the [CI workflow][ci-workflow] on the release branch and verified that the tagged build version exists on the [releases.crossplane.io] `build` channel, e.g. `build/release-X.Y/vX.Y.0/...` should contain all the relevant binaries. - [ ] Run the [Configurations workflow][configurations-workflow] on the release branch and verified that version exists on [xpkg.upbound.io] for all getting started packages. @@ -39,10 +40,14 @@ examples of each step, assuming release vX.Y.0 is being cut. - [ ] Updated, in a single PR, the following on `master`: - [ ] The [releases table] in the `README.md`, removing the now old unsupported release and adding the new one. - [ ] The `baseBranches` list in `.github/renovate.json5`, removing the now old unsupported release and adding the new one. +- [ ] Closed the GitHub milestone for this release. +- [ ] Publish a blog post about the release to the [crossplane blog] - [ ] Ensured that users have been notified of the release on all communication channels: - [ ] Slack: `#announcements` channel on Crossplane's Slack workspace. - [ ] Twitter: reach out to a Crossplane maintainer or steering committee member, see [OWNERS.md][owners]. -- [ ] Request @jbw976 to remove the EOL docs version from Google Search + - [ ] LinkedIn: same as Twitter +- [ ] Request @jbw976 to remove all old docs versions from Google Search +- [ ] Remove any extra permissions given to release team members for this release @@ -59,3 +64,5 @@ examples of each step, assuming release vX.Y.0 is being cut. [releases.crossplane.io]: https://releases.crossplane.io [tag-workflow]: https://github.com/crossplane/crossplane/actions/workflows/tag.yml [xpkg.upbound.io]: https://marketplace.upbound.io/configurations?query=getting-started +[GitHub milestone]: https://github.com/crossplane/crossplane/milestones +[crossplane blog]: https://blog.crossplane.io diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4091a83e1..010632c0b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ on: env: # Common versions GO_VERSION: '1.20.7' - GOLANGCI_VERSION: 'v1.53.3' + GOLANGCI_VERSION: 'v1.54.0' DOCKER_BUILDX_VERSION: 'v0.10.0' # Common users. We can't run a step 'if secrets.DOCKER_USR != ""' but we can run @@ -30,7 +30,7 @@ jobs: submodules: true - name: Setup Go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4 + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4 with: go-version: ${{ env.GO_VERSION }} @@ -84,7 +84,7 @@ jobs: submodules: true - name: Setup Go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4 + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4 with: go-version: ${{ env.GO_VERSION }} @@ -130,7 +130,7 @@ jobs: submodules: true - name: Setup Go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4 + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4 with: go-version: ${{ env.GO_VERSION }} @@ -156,12 +156,12 @@ jobs: run: make vendor vendor.check - name: Initialize CodeQL - uses: github/codeql-action/init@0ba4244466797eb048eb91a6cd43d5c03ca8bd05 # v2 + uses: github/codeql-action/init@5b6282e01c62d02e720b81eb8a51204f527c3624 # v2 with: languages: go - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@0ba4244466797eb048eb91a6cd43d5c03ca8bd05 # v2 + uses: github/codeql-action/analyze@5b6282e01c62d02e720b81eb8a51204f527c3624 # v2 trivy-scan-fs: runs-on: ubuntu-22.04 @@ -198,7 +198,7 @@ jobs: run: git fetch --prune --unshallow - name: Setup Go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4 + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4 with: go-version: ${{ env.GO_VERSION }} @@ -261,7 +261,7 @@ jobs: run: git fetch --prune --unshallow - name: Setup Go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4 + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4 with: go-version: ${{ env.GO_VERSION }} @@ -333,7 +333,7 @@ jobs: run: git fetch --prune --unshallow - name: Setup Go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4 + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4 with: go-version: ${{ env.GO_VERSION }} diff --git a/.github/workflows/promote.yml b/.github/workflows/promote.yml index 2eb8fd553..c02dab681 100644 --- a/.github/workflows/promote.yml +++ b/.github/workflows/promote.yml @@ -31,7 +31,7 @@ jobs: submodules: true - name: Setup Go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4 + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4 with: go-version: ${{ env.GO_VERSION }} diff --git a/.github/workflows/scan.yaml b/.github/workflows/scan.yaml index e1f8d0ede..6597ca12f 100644 --- a/.github/workflows/scan.yaml +++ b/.github/workflows/scan.yaml @@ -131,7 +131,7 @@ jobs: retention-days: 3 - name: Upload Trivy Scan Results To GitHub Security Tab - uses: github/codeql-action/upload-sarif@0ba4244466797eb048eb91a6cd43d5c03ca8bd05 # v2 + uses: github/codeql-action/upload-sarif@5b6282e01c62d02e720b81eb8a51204f527c3624 # v2 with: sarif_file: 'trivy-results.sarif' category: ${{ matrix.image }}:${{ env.tag }} diff --git a/Makefile b/Makefile index ec5920d70..0b881d241 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ GO_TEST_PACKAGES = $(GO_PROJECT)/test/e2e GO_LDFLAGS += -X $(GO_PROJECT)/internal/version.version=$(shell echo $(VERSION) | sed 's/[\.,-]up.*//' ) GO_SUBDIRS += cmd internal apis GO111MODULE = on -GOLANGCILINT_VERSION = 1.53.3 +GOLANGCILINT_VERSION = 1.54.0 -include build/makelib/golang.mk # ==================================================================================== diff --git a/internal/controller/apiextensions/composite/composition_transforms.go b/internal/controller/apiextensions/composite/composition_transforms.go index 66c66f71c..1da5f8c6f 100644 --- a/internal/controller/apiextensions/composite/composition_transforms.go +++ b/internal/controller/apiextensions/composite/composition_transforms.go @@ -336,12 +336,19 @@ func stringConvertTransform(t *v1.StringConversionType, input any) (string, erro } func stringGenerateHash[THash any](input any, hashFunc func([]byte) THash) (THash, error) { - inputJSON, err := json.Marshal(input) - if err != nil { - var ret THash - return ret, errors.Wrap(err, errMarshalJSON) + var b []byte + var err error + switch v := input.(type) { + case string: + b = []byte(v) + default: + b, err = json.Marshal(input) + if err != nil { + var ret THash + return ret, errors.Wrap(err, errMarshalJSON) + } } - return hashFunc(inputJSON), nil + return hashFunc(b), nil } func stringTrimTransform(input any, t v1.StringTransformType, trim string) string { diff --git a/internal/controller/apiextensions/composite/composition_transforms_test.go b/internal/controller/apiextensions/composite/composition_transforms_test.go index b82945ef2..ef929b1e6 100644 --- a/internal/controller/apiextensions/composite/composition_transforms_test.go +++ b/internal/controller/apiextensions/composite/composition_transforms_test.go @@ -794,7 +794,7 @@ func TestStringResolve(t *testing.T) { i: "Crossplane", }, want: want{ - o: "f9fd1da3c0cc298643ff098a0c59febf1d8b7b84", + o: "3b683dc8ff44122b331a5e4f253dd69d90726d75", }, }, "ConvertToSha1Error": { @@ -815,7 +815,7 @@ func TestStringResolve(t *testing.T) { i: "Crossplane", }, want: want{ - o: "e84ae541a0725d73154ee76b7ac3fec4b007dd01ed701d506cd7e7a45bb48935", + o: "19c8a7c24ed0067f606815b59e5b82d92935ff69deed04171457a55018e31224", }, }, "ConvertToSha256Error": { @@ -836,7 +836,27 @@ func TestStringResolve(t *testing.T) { i: "Crossplane", }, want: want{ - o: "b48622a3f487b8cb7748b356c9531cf54d9125c1456689c115744821f3dafd59c8c7d4dc5627c4a1e4082c67ee9f4528365a644a01a0c46d6dd0a6d979c8f51f", + o: "0016037c62c92b5cc4a282fbe30cdd228fa001624b26fd31baa9fcb76a9c60d48e2e7a16cf8729a2d9cba3d23e1d846e7721a5381b9a92dd813178e9a6686205", + }, + }, + "ConvertToSha512Int": { + args: args{ + stype: v1.StringTransformTypeConvert, + convert: &toSha512, + i: 1234, + }, + want: want{ + o: "d404559f602eab6fd602ac7680dacbfaadd13630335e951f097af3900e9de176b6db28512f2e000b9d04fba5133e8b1c6e8df59db3a8ab9d60be4b97cc9e81db", + }, + }, + "ConvertToSha512IntStr": { + args: args{ + stype: v1.StringTransformTypeConvert, + convert: &toSha512, + i: "1234", + }, + want: want{ + o: "d404559f602eab6fd602ac7680dacbfaadd13630335e951f097af3900e9de176b6db28512f2e000b9d04fba5133e8b1c6e8df59db3a8ab9d60be4b97cc9e81db", }, }, "ConvertToSha512Error": {