From 8020e8c166ca28a95762bc1d8492d497ad7be812 Mon Sep 17 00:00:00 2001 From: Hansu Park Date: Wed, 9 Oct 2024 20:29:48 +0900 Subject: [PATCH 1/2] refactor: improve logging for unimplemented ErrorTranslator in TranslateError config (#7225) --- gorm.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gorm.go b/gorm.go index 117d2fd0..84ff8ee3 100644 --- a/gorm.go +++ b/gorm.go @@ -189,6 +189,12 @@ func Open(dialector Dialector, opts ...Option) (db *DB, err error) { _ = db.Close() } } + + if config.TranslateError { + if _, ok := db.Dialector.(ErrorTranslator); !ok { + config.Logger.Warn(context.Background(), "The TranslateError option is enabled, but the Dialector %s does not implement ErrorTranslator.", db.Dialector.Name()) + } + } } if config.PrepareStmt { From 52e3b353ebc700f405628922acdbdc02eaaa33c1 Mon Sep 17 00:00:00 2001 From: Yidi Sprei Date: Wed, 9 Oct 2024 07:31:04 -0400 Subject: [PATCH 2/2] refactor(workflow): update release workflow to enhance automation (#7224) Replaced the old release workflow with a new setup using Release Drafter. This refactor allows for more detailed release notes by categorizing changes and automatically generating release drafts. The new workflow triggers on semantic version tags and improves permissions management. This change enhances the release process by providing better documentation and automation. --- .github/release-drafter.yml | 20 ++++++++++++++++++ .github/workflows/create-release.yml | 31 ++++++++++++++++++++++++++++ .github/workflows/release-on-tag.yml | 23 --------------------- 3 files changed, 51 insertions(+), 23 deletions(-) create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/create-release.yml delete mode 100644 .github/workflows/release-on-tag.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 00000000..3d7182ec --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,20 @@ +name-template: 'v Release $NEXT_PATCH_VERSION 🌈' +tag-template: 'v$NEXT_PATCH_VERSION' +categories: + - title: '🚀 Features' + labels: + - 'feature' + - 'enhancement' + - title: '🐛 Bug Fixes' + labels: + - 'fix' + - 'bugfix' + - 'bug' + - title: '🧰 Maintenance' + label: 'chore' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' +change-title-escapes: '\<*_&' +template: | + ## Changes + + $CHANGES \ No newline at end of file diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 00000000..b75fb58a --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,31 @@ +name: Create Release + +on: + push: + tags: + - 'v*.*.*' + +permissions: + contents: write + pull-requests: read + +jobs: + create_release: + name: Create Release + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Generate Release Notes and Publish + id: generate_release_notes + uses: release-drafter/release-drafter@v6 + with: + config-name: 'release-drafter.yml' + name: "Release ${{ github.ref_name }}" + tag: ${{ github.ref_name }} + publish: true + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-on-tag.yml b/.github/workflows/release-on-tag.yml deleted file mode 100644 index 3868a8f5..00000000 --- a/.github/workflows/release-on-tag.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Create Release on Tag - -on: - push: - tags: - - '*' - -jobs: - create_release: - runs-on: ubuntu-latest - - steps: - - name: Create Release - uses: actions/create-release@v1 - with: - tag_name: ${{ github.ref_name }} - release_name: ${{ github.ref_name }} - body: | - Release ${{ github.ref_name }} of GORM. - draft: false - prerelease: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}