From 08debbfe4939022b7b4cc4b8e2c829fa5ee650a7 Mon Sep 17 00:00:00 2001 From: Steven Borrelli Date: Thu, 3 Aug 2023 11:13:56 -0500 Subject: [PATCH 1/7] update hash calculations Signed-off-by: Steven Borrelli --- .../composite/composition_transforms.go | 17 ++++++++---- .../composite/composition_transforms_test.go | 26 ++++++++++++++++--- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/internal/controller/apiextensions/composite/composition_transforms.go b/internal/controller/apiextensions/composite/composition_transforms.go index 48f6c2651..c17051fcf 100644 --- a/internal/controller/apiextensions/composite/composition_transforms.go +++ b/internal/controller/apiextensions/composite/composition_transforms.go @@ -344,12 +344,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": { From de14b603627f4d06e8525682fcb2a076b2c589d6 Mon Sep 17 00:00:00 2001 From: Predrag Knezevic Date: Mon, 7 Aug 2023 16:34:29 +0200 Subject: [PATCH 2/7] Release template improvement: Close GH milestone Signed-off-by: Predrag Knezevic --- .github/ISSUE_TEMPLATE/release.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md index 679118093..56af9bb0b 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,6 +40,7 @@ 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. - [ ] 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]. @@ -58,3 +60,4 @@ 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 \ No newline at end of file From 51af61b94e753ba6c0bfe40f20b7a4ae1d925acc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 8 Aug 2023 12:49:39 +0000 Subject: [PATCH 3/7] chore(deps): update actions/setup-go digest to 93397be --- .github/workflows/ci.yml | 12 ++++++------ .github/workflows/promote.yml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22ee86fcb..ad160a86f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,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 }} @@ -86,7 +86,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 }} @@ -132,7 +132,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 }} @@ -200,7 +200,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 }} @@ -263,7 +263,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 }} @@ -335,7 +335,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 2c0955cfc..6f8f05a74 100644 --- a/.github/workflows/promote.yml +++ b/.github/workflows/promote.yml @@ -33,7 +33,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 }} From a6c655afbb5823410e2ab8527f65c31c222b4aae Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 8 Aug 2023 14:21:17 +0000 Subject: [PATCH 4/7] chore(deps): update github/codeql-action digest to 5b6282e --- .github/workflows/ci.yml | 4 ++-- .github/workflows/scan.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22ee86fcb..1b4797f98 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -158,12 +158,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 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 }} From 98e67a44827e06bdb7ba65644d848618ee7a1deb Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 9 Aug 2023 14:28:02 +0000 Subject: [PATCH 5/7] chore(deps): update dependency golangci/golangci-lint to v1.54.0 --- .github/workflows/ci.yml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee651bbb3..cb72a8c0c 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.AWS_USR != ""' but we can run diff --git a/Makefile b/Makefile index c8d82acb1..b1b590b9a 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ GO_TEST_PACKAGES = $(GO_PROJECT)/test/e2e GO_LDFLAGS += -X $(GO_PROJECT)/internal/version.version=$(VERSION) GO_SUBDIRS += cmd internal apis GO111MODULE = on -GOLANGCILINT_VERSION = 1.53.3 +GOLANGCILINT_VERSION = 1.54.0 -include build/makelib/golang.mk # ==================================================================================== From 44dd43f1969f939019f47675945633309fdb978c Mon Sep 17 00:00:00 2001 From: Jared Watts Date: Tue, 18 Jul 2023 19:12:58 -0700 Subject: [PATCH 6/7] Update release issue templates with recent changes/learnings * Promote patch releases from oldest to newest * Ensure a blog post is published for major releases * Remove all old docs versions from search * Include LinkedIn in social announcements * Remove extra permissions from release team if needed Signed-off-by: Jared Watts --- .github/ISSUE_TEMPLATE/patch_release.md | 3 +++ .github/ISSUE_TEMPLATE/release.md | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/patch_release.md b/.github/ISSUE_TEMPLATE/patch_release.md index ccc19617b..12cc3e426 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`) - [ ] 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 98d08617e..b3ba2e6b7 100644 --- a/.github/ISSUE_TEMPLATE/release.md +++ b/.github/ISSUE_TEMPLATE/release.md @@ -41,10 +41,13 @@ examples of each step, assuming release vX.Y.0 is being cut. - [ ] 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 @@ -61,4 +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 \ No newline at end of file +[GitHub milestone]: https://github.com/crossplane/crossplane/milestones +[crossplane blog]: https://blog.crossplane.io From d13dde085e8b9c0f3d7f59512a6dd97b46b4473b Mon Sep 17 00:00:00 2001 From: Jared Watts Date: Wed, 9 Aug 2023 17:52:13 -0700 Subject: [PATCH 7/7] Explain why we run patch releases from lowest to highest Signed-off-by: Jared Watts --- .github/ISSUE_TEMPLATE/patch_release.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/patch_release.md b/.github/ISSUE_TEMPLATE/patch_release.md index 12cc3e426..455b56f28 100644 --- a/.github/ISSUE_TEMPLATE/patch_release.md +++ b/.github/ISSUE_TEMPLATE/patch_release.md @@ -28,7 +28,7 @@ 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`) +- [ ] 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: