From 47dd6ed83d6dbb2d582c23254f991eb12a8a530c Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Mon, 12 Feb 2024 14:37:56 -0800 Subject: [PATCH 1/5] ci: automatically create PR to update Go versions (#308) Removes the issue-creation in the Go versions workflow, replacing it by creating a PR directly. --- .github/ISSUE_TEMPLATE/update_go_versions.md | 21 -------- .github/workflows/check-go-versions.yml | 51 ++++++++++++++------ 2 files changed, 36 insertions(+), 36 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/update_go_versions.md diff --git a/.github/ISSUE_TEMPLATE/update_go_versions.md b/.github/ISSUE_TEMPLATE/update_go_versions.md deleted file mode 100644 index bf1dce0d..00000000 --- a/.github/ISSUE_TEMPLATE/update_go_versions.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: It's time to update supported Go versions -assignees: '' -labels: '' ---- -It's time to update Relay's supported Go versions, due to a recent upstream Go release. - -The Go major release cadence is ~every 6 months; the two most recent major versions are supported. -Note that between major releases, the Go team often ships multiple minor versions. - -| | Current repo configuration | Desired repo configuration | -|-------------|------------------------------------|---------------------------------------------------------------------------------------------------------------------| -| Latest | {{ env.RELAY_LATEST_VERSION}} | [{{ env.OFFICIAL_LATEST_VERSION }}](https://go.dev/doc/devel/release#go{{ env.OFFICIAL_LATEST_VERSION }}) | -| Penultimate | {{ env.RELAY_PENULTIMATE_VERSION}} | [{{ env.OFFICIAL_PENULTIMATE_VERSION }}](https://go.dev/doc/devel/release#go{{ env.OFFICIAL_PENULTIMATE_VERSION }}) | - - - -Run locally: -```bash -./scripts/update-go-release-version.sh {{ env.OFFICIAL_LATEST_VERSION }} {{ env.OFFICIAL_PENULTIMATE_VERSION }} -``` diff --git a/.github/workflows/check-go-versions.yml b/.github/workflows/check-go-versions.yml index a439b5ff..ec80c8e6 100644 --- a/.github/workflows/check-go-versions.yml +++ b/.github/workflows/check-go-versions.yml @@ -16,8 +16,8 @@ jobs: check-go-eol: needs: go-versions permissions: - issues: write - contents: read + contents: write + pull-requests: write runs-on: ubuntu-latest timeout-minutes: 2 steps: @@ -36,17 +36,38 @@ jobs: echo "officialLatestVersion=${{ fromJSON(env.fetch-api-data)[0].latest }}" >> $GITHUB_ENV echo "officialPenultimateVersion=${{ fromJSON(env.fetch-api-data)[1].latest }}" >> $GITHUB_ENV - # If the latest official Go version is different from Relay's release version, generate an issue - # with useful details. - - name: Create issue if update required - if: inputs.force_create_issue || (needs.go-versions.outputs.latest != env.officialLatestVersion) - uses: JasonEtco/create-an-issue@e27dddc79c92bc6e4562f268fffa5ed752639abd - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - RELAY_LATEST_VERSION: ${{ needs.go-versions.outputs.latest }} - OFFICIAL_LATEST_VERSION: ${{ env.officialLatestVersion }} - RELAY_PENULTIMATE_VERSION: ${{ needs.go-versions.outputs.penultimate }} - OFFICIAL_PENULTIMATE_VERSION: ${{ env.officialPenultimateVersion }} + - name: Run update script + if: needs.go-versions.outputs.latest != env.officialLatestVersion + id: update + run: ./scripts/update-go-release-version.sh ${{ env.officialLatestVersion }} ${{ env.officialPenultimateVersion }} \ + + - name: Create pull request + if: steps.update.outcome == 'success' + uses: peter-evans/create-pull-request@v6 with: - filename: .github/ISSUE_TEMPLATE/update_go_versions.md - update_existing: true + token: ${{ secrets.GITHUB_TOKEN }} + add-paths: | + Dockerfile + .github/variables/go-versions.env + branch: "launchdarklyreleasebot/update-to-go-${{ env.officialLatestVersion }}" + author: "LaunchDarklyReleaseBot " + committer: "LaunchDarklyReleaseBot " + title: "fix(deps): bump supported Go versions to ${{ env.officialLatestVersion }} and ${{ env.officialPenultimateVersion }}" + commit-message: "Bumps from Go ${{ needs.go-versions.outputs.latest }} -> ${{ env.officialLatestVersion }} and ${{ needs.go-versions.outputs.penultimate }} -> ${{ env.officialPenultimateVersion }}." + body: | + It's time to update Relay's supported Go versions, due to a recent upstream Go release. + + The Go major release cadence is ~every 6 months; the two most recent major versions are supported. + Note that between major releases, the Go team often ships multiple minor versions. + + + | | Current repo configuration | Desired repo configuration | + |-------------|------------------------------------|---------------------------------------------------------------------------------------------------------------------| + | Latest | ${{ needs.go-versions.outputs.latest }} | [${{ env.officialLatestVersion }}](https://go.dev/doc/devel/release#go${{ env.officialLatestVersion }}) | + | Penultimate | ${{ needs.go-versions.outputs.penultimate }}| [${{ env.officialPenultimateVersion }}](https://go.dev/doc/devel/release#go${{ env.officialPenultimateVersion }}) | + + + Run locally: + ```bash + ./scripts/update-go-release-version.sh ${{ env.officialPenultimateVersion }} ${{ env.officialPenultimateVersion }} + ``` From e81454f097d46f487d870dd1f286e9101fab8bec Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 14:55:38 -0800 Subject: [PATCH 2/5] fix(deps): bump supported Go versions to 1.22.0 and 1.21.7 (#314) --- .github/variables/go-versions.env | 4 ++-- Dockerfile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/variables/go-versions.env b/.github/variables/go-versions.env index d2d8b648..76661803 100644 --- a/.github/variables/go-versions.env +++ b/.github/variables/go-versions.env @@ -1,2 +1,2 @@ -latest=1.21.6 -penultimate=1.20.13 +latest=1.22.0 +penultimate=1.21.7 diff --git a/Dockerfile b/Dockerfile index 2367d162..ac7def5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # This is a standalone Dockerfile that does not depend on goreleaser building the binary # It is NOT the version that is pushed to dockerhub -FROM golang:1.21.6-alpine3.19 as builder +FROM golang:1.22.0-alpine3.19 as builder # See "Runtime platform versions" in CONTRIBUTING.md RUN apk --no-cache add \ From 3f3bdc4ca8dfa307b0e3c9fc61d93623cf42c047 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 14:58:56 -0800 Subject: [PATCH 3/5] chore(v8): release 8.3.1 (#315) :robot: I have created a release *beep* *boop* --- ## [8.3.1](https://github.com/launchdarkly/ld-relay/compare/v8.3.0...v8.3.1) (2024-02-12) ### Bug Fixes * **deps:** bump supported Go versions to 1.22.0 and 1.21.7 ([#314](https://github.com/launchdarkly/ld-relay/issues/314)) ([e81454f](https://github.com/launchdarkly/ld-relay/commit/e81454f097d46f487d870dd1f286e9101fab8bec)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 7 +++++++ relay/version/version.go | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8d48393b..b0034f9d 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "8.3.0" + ".": "8.3.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 75946c10..19726759 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to the LaunchDarkly Relay will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org). +## [8.3.1](https://github.com/launchdarkly/ld-relay/compare/v8.3.0...v8.3.1) (2024-02-12) + + +### Bug Fixes + +* **deps:** bump supported Go versions to 1.22.0 and 1.21.7 ([#314](https://github.com/launchdarkly/ld-relay/issues/314)) ([e81454f](https://github.com/launchdarkly/ld-relay/commit/e81454f097d46f487d870dd1f286e9101fab8bec)) + ## [8.3.0](https://github.com/launchdarkly/ld-relay/compare/v8.2.3...v8.3.0) (2024-02-09) diff --git a/relay/version/version.go b/relay/version/version.go index 42622117..0e8819c8 100644 --- a/relay/version/version.go +++ b/relay/version/version.go @@ -2,4 +2,4 @@ package version // Version is the package version -const Version = "8.3.0" // {{ x-release-please-version }} +const Version = "8.3.1" // {{ x-release-please-version }} From 5c76f71f33f8530dd08fbc5bea3fed193d5db12e Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Mon, 12 Feb 2024 15:50:16 -0800 Subject: [PATCH 4/5] ci: remove workflow_dispatch inputs on check-go-version workflow (#313) The "force create issue" on the check-go-version workflow was useful for testing out the workflow even if the Go versions were up-to-date. Since this files a PR now based on actual changes, the input doesn't make sense to have. --- .github/workflows/check-go-versions.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/check-go-versions.yml b/.github/workflows/check-go-versions.yml index ec80c8e6..846a916c 100644 --- a/.github/workflows/check-go-versions.yml +++ b/.github/workflows/check-go-versions.yml @@ -3,12 +3,7 @@ on: schedule: - cron: "0 17 * * *" workflow_dispatch: - inputs: - force_create_issue: - type: boolean - description: 'Create issue even if versions are up-to-date' - required: false - default: false + jobs: go-versions: uses: ./.github/workflows/go-versions.yml From 17af73ffd076a24b59151e3c90a6bca51a4db401 Mon Sep 17 00:00:00 2001 From: Casey Waldren Date: Mon, 12 Feb 2024 19:59:06 -0800 Subject: [PATCH 5/5] ci: run integration tests additionally on v7 branch (#316) Integration tests were only running on the `v8` branch since (apparently) cron schedule only works for the `default` branch. This commit explicitly uses a matrix build to trigger v7/v8 integration tests: `{v7, v8} x {production, staging}`. I've also added a manual job to make it easy to target a particular branch+environment. --- .github/workflows/daily-integration-tests.yml | 11 +++----- .github/workflows/manual-integration-test.yml | 26 +++++++++++++++++++ 2 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/manual-integration-test.yml diff --git a/.github/workflows/daily-integration-tests.yml b/.github/workflows/daily-integration-tests.yml index 7cd96149..30cc80df 100644 --- a/.github/workflows/daily-integration-tests.yml +++ b/.github/workflows/daily-integration-tests.yml @@ -1,13 +1,9 @@ -name: 'Integration Tests' +name: 'Daily Integration Tests' on: workflow_dispatch: inputs: go-version: - description: "Go version to use for building Relay." - required: false - type: string - branch: - description: "Branch to test." + description: "Go version to use for building Relay (leave empty for latest defined in repo.)" required: false type: string @@ -25,9 +21,10 @@ jobs: fail-fast: false matrix: environment: ['staging', 'production'] + branch: ['v7', 'v8'] uses: ./.github/workflows/integration-test.yml with: environment: ${{ matrix.environment }} go-version: ${{ inputs.go-version != '' && inputs.go-version || needs.go-versions.outputs.latest }} - branch: ${{ inputs.branch }} + branch: ${{ matrix.branch }} diff --git a/.github/workflows/manual-integration-test.yml b/.github/workflows/manual-integration-test.yml new file mode 100644 index 00000000..07fd23be --- /dev/null +++ b/.github/workflows/manual-integration-test.yml @@ -0,0 +1,26 @@ +name: 'Manual Integration Tests' +on: + workflow_dispatch: + inputs: + go-version: + description: "Go version to use for building Relay (leave empty for latest defined in repo.)" + required: false + type: string + environment: + description: "The environment to test against." + type: choice + options: + - 'staging' + - 'production' + +jobs: + go-versions: + uses: ./.github/workflows/go-versions.yml + + integration-test: + needs: go-versions + uses: ./.github/workflows/integration-test.yml + with: + environment: ${{ inputs.environment }} + go-version: ${{ inputs.go-version != '' && inputs.go-version || needs.go-versions.outputs.latest }} + branch: ${{ github.ref }}