From 5dc8c297fe77c77d47fca7c50bd0dd3b4881f400 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Aug 2021 10:12:04 +0800 Subject: [PATCH 1/3] build(deps): Bump github.com/beyondstorage/go-storage/v4 from 4.4.0 to 4.5.0 (#13) * build(deps): Bump github.com/beyondstorage/go-storage/v4 Bumps [github.com/beyondstorage/go-storage/v4](https://github.com/beyondstorage/go-storage) from 4.4.0 to 4.5.0. - [Release notes](https://github.com/beyondstorage/go-storage/releases) - [Changelog](https://github.com/beyondstorage/go-storage/blob/master/CHANGELOG.md) - [Commits](https://github.com/beyondstorage/go-storage/compare/v4.4.0...v4.5.0) --- updated-dependencies: - dependency-name: github.com/beyondstorage/go-storage/v4 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Auto build to generate code Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] --- generated.go | 2 ++ go.mod | 2 +- go.sum | 5 ++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/generated.go b/generated.go index 60ce8a5..5050c12 100644 --- a/generated.go +++ b/generated.go @@ -4,6 +4,7 @@ package onedrive import ( "context" "io" + "net/http" "time" "github.com/beyondstorage/go-storage/v4/pkg/httpclient" @@ -15,6 +16,7 @@ var _ Storager var _ services.ServiceError var _ httpclient.Options var _ time.Duration +var _ http.Request // Type is the type for onedrive const Type = "onedrive" diff --git a/go.mod b/go.mod index 62467de..ee75d98 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/beyondstorage/go-service-onedrive go 1.15 -require github.com/beyondstorage/go-storage/v4 v4.4.0 +require github.com/beyondstorage/go-storage/v4 v4.5.0 diff --git a/go.sum b/go.sum index 26b4864..18bdbc1 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/Xuanwo/templateutils v0.1.0 h1:WpkWOqQtIQ2vAIpJLa727DdN8WtxhUkkbDGa6UhntJY= github.com/Xuanwo/templateutils v0.1.0/go.mod h1:OdE0DJ+CJxDBq6psX5DPV+gOZi8bhuHuVUpPCG++Wb8= -github.com/beyondstorage/go-storage/v4 v4.4.0 h1:sWURraKFjNR4qpwthr45cAGOIx6EOLrrJcz6su4Je30= -github.com/beyondstorage/go-storage/v4 v4.4.0/go.mod h1:mc9VzBImjXDg1/1sLfta2MJH79elfM6m47ZZvZ+q/Uw= +github.com/beyondstorage/go-storage/v4 v4.5.0 h1:cWkX1A+yVLldEpj/Ad9capev9K1fbVIVcRvwqWsMgpw= +github.com/beyondstorage/go-storage/v4 v4.5.0/go.mod h1:mc9VzBImjXDg1/1sLfta2MJH79elfM6m47ZZvZ+q/Uw= github.com/dave/dst v0.26.2 h1:lnxLAKI3tx7MgLNVDirFCsDTlTG9nKTk7GcptKcWSwY= github.com/dave/dst v0.26.2/go.mod h1:UMDJuIRPfyUCC78eFuB+SV/WI8oDeyFDvM/JR6NI3IU= github.com/dave/gopackages v0.0.0-20170318123100-46e7023ec56e/go.mod h1:i00+b/gKdIDIxuLDFob7ustLAVqhsZRk2qVZrArELGQ= @@ -13,7 +13,6 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/google/pprof v0.0.0-20181127221834-b4f47329b966/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/kevinburke/go-bindata v3.22.0+incompatible h1:/JmqEhIWQ7GRScV0WjX/0tqBrC5D21ALg0H0U/KZ/ts= From 5a28eefb6f28232650e3b418a5dd5adfcca90412 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Sep 2021 11:21:23 +0800 Subject: [PATCH 2/3] build(deps): Bump github.com/beyondstorage/go-storage/v4 from 4.5.0 to 4.6.0 (#14) * build(deps): Bump github.com/beyondstorage/go-storage/v4 Bumps [github.com/beyondstorage/go-storage/v4](https://github.com/beyondstorage/go-storage) from 4.5.0 to 4.6.0. - [Release notes](https://github.com/beyondstorage/go-storage/releases) - [Changelog](https://github.com/beyondstorage/go-storage/blob/master/CHANGELOG.md) - [Commits](https://github.com/beyondstorage/go-storage/compare/v4.5.0...v4.6.0) --- updated-dependencies: - dependency-name: github.com/beyondstorage/go-storage/v4 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Auto build to generate code Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] --- generated.go | 10 ++++++++++ go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/generated.go b/generated.go index 5050c12..e6f2048 100644 --- a/generated.go +++ b/generated.go @@ -7,6 +7,7 @@ import ( "net/http" "time" + . "github.com/beyondstorage/go-storage/v4/pairs" "github.com/beyondstorage/go-storage/v4/pkg/httpclient" "github.com/beyondstorage/go-storage/v4/services" . "github.com/beyondstorage/go-storage/v4/types" @@ -17,6 +18,7 @@ var _ services.ServiceError var _ httpclient.Options var _ time.Duration var _ http.Request +var _ Error // Type is the type for onedrive const Type = "onedrive" @@ -99,6 +101,8 @@ type pairStorageNew struct { // Required pairs // Optional pairs + // Enable features + // Default pairs } // parsePairStorageNew will parse Pair slice into *pairStorageNew @@ -111,9 +115,15 @@ func parsePairStorageNew(opts []Pair) (pairStorageNew, error) { switch v.Key { // Required pairs // Optional pairs + // Enable features + // Default pairs } } + // Enable features + + // Default pairs + return result, nil } diff --git a/go.mod b/go.mod index ee75d98..7d72720 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/beyondstorage/go-service-onedrive go 1.15 -require github.com/beyondstorage/go-storage/v4 v4.5.0 +require github.com/beyondstorage/go-storage/v4 v4.6.0 diff --git a/go.sum b/go.sum index 18bdbc1..1b11c93 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ github.com/Xuanwo/templateutils v0.1.0 h1:WpkWOqQtIQ2vAIpJLa727DdN8WtxhUkkbDGa6UhntJY= github.com/Xuanwo/templateutils v0.1.0/go.mod h1:OdE0DJ+CJxDBq6psX5DPV+gOZi8bhuHuVUpPCG++Wb8= -github.com/beyondstorage/go-storage/v4 v4.5.0 h1:cWkX1A+yVLldEpj/Ad9capev9K1fbVIVcRvwqWsMgpw= -github.com/beyondstorage/go-storage/v4 v4.5.0/go.mod h1:mc9VzBImjXDg1/1sLfta2MJH79elfM6m47ZZvZ+q/Uw= +github.com/beyondstorage/go-storage/v4 v4.6.0 h1:a05dtbYjMZB7LrUSvVzzHwlx33B4yEmd5oQB7Itk7VY= +github.com/beyondstorage/go-storage/v4 v4.6.0/go.mod h1:mc9VzBImjXDg1/1sLfta2MJH79elfM6m47ZZvZ+q/Uw= github.com/dave/dst v0.26.2 h1:lnxLAKI3tx7MgLNVDirFCsDTlTG9nKTk7GcptKcWSwY= github.com/dave/dst v0.26.2/go.mod h1:UMDJuIRPfyUCC78eFuB+SV/WI8oDeyFDvM/JR6NI3IU= github.com/dave/gopackages v0.0.0-20170318123100-46e7023ec56e/go.mod h1:i00+b/gKdIDIxuLDFob7ustLAVqhsZRk2qVZrArELGQ= From 8daee1be276a1ff33d44734275d58ac5b0bb1a73 Mon Sep 17 00:00:00 2001 From: BeyondRobot Date: Sat, 18 Sep 2021 12:47:17 +0800 Subject: [PATCH 3/3] ci: Sync github actions (#16) * Delete not allowed file: .github/workflows/auto-build.yml * Delete not allowed file: .github/workflows/codeql-analysis.yml * Add new file: .github/workflows/build-test.yml * Add new file: .github/workflows/unit-test.yml * Add new file: .github/workflows/auto-merge.yml --- .github/workflows/auto-build.yml | 36 --------------- .github/workflows/auto-merge.yml | 55 ++++++++++++++++++++++ .github/workflows/build-test.yml | 26 +++++++++++ .github/workflows/codeql-analysis.yml | 66 --------------------------- .github/workflows/unit-test.yml | 4 +- 5 files changed, 83 insertions(+), 104 deletions(-) delete mode 100644 .github/workflows/auto-build.yml create mode 100644 .github/workflows/auto-merge.yml create mode 100644 .github/workflows/build-test.yml delete mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/auto-build.yml b/.github/workflows/auto-build.yml deleted file mode 100644 index 84dbd6a..0000000 --- a/.github/workflows/auto-build.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Dependabot Auto Build -on: pull_request_target - -permissions: - pull-requests: write - contents: write - -jobs: - dependabot: - runs-on: ubuntu-latest - if: ${{ github.actor == 'dependabot[bot]' }} - steps: - - name: Dependabot metadata - id: metadata - uses: dependabot/fetch-metadata@v1.1.0 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - - - name: Set up Go 1.x - uses: actions/setup-go@v2 - with: - go-version: "1.15" - - - name: Checkout repository - uses: actions/checkout@v2 - with: - ref: ${{ github.head_ref }} - token: ${{ secrets.ROBOT_GITHUB_TOKEN }} - - - name: Auto build - run: make build - - - name: Auto commit - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Auto build to generate code diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml new file mode 100644 index 0000000..e0881aa --- /dev/null +++ b/.github/workflows/auto-merge.yml @@ -0,0 +1,55 @@ +name: Dependabot Auto Build +on: pull_request_target + +permissions: + pull-requests: write + contents: write + +jobs: + metadata: + runs-on: ubuntu-latest + outputs: + dependency-names: ${{ steps.metadata.outputs.dependency-names }} + steps: + - name: Dependabot metadata + uses: Xuanwo/fetch-metadata@v1.2.2 + id: metadata + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + dependabot: + needs: metadata + if: ${{ needs.metadata.outputs.dependency-names != '' }} + runs-on: ubuntu-latest + steps: + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: "1.16" + + - name: Checkout repository + uses: actions/checkout@v2 + with: + ref: ${{ github.head_ref }} + token: ${{ secrets.ROBOT_GITHUB_TOKEN }} + + - name: Auto build + run: make build + + - name: Auto commit + uses: stefanzweifel/git-auto-commit-action@v4 + if: ${{contains(needs.metadata.outputs.dependency-names, 'github.com/beyondstorage/go-storage/v4')}} + with: + commit_message: Auto build to generate code + + - name: Auto merge + run: gh pr merge --auto --squash "$PR_URL" + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GITHUB_TOKEN: ${{ secrets.ROBOT_GITHUB_TOKEN }} + + - name: Auto approve + run: gh pr review "$PR_URL" -a + env: + PR_URL: ${{ github.event.pull_request.html_url }} + GITHUB_TOKEN: ${{ secrets.ROBOT_GITHUB_TOKEN }} diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 0000000..26c30f5 --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,26 @@ +name: "Build Test" + +on: [ push,pull_request ] + +jobs: + build_test: + name: Build Test + runs-on: ubuntu-latest + + steps: + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: "1.16" + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Format + run: if [ "$(gofmt -l . | wc -l)" -gt 0 ]; then exit 1; fi + + - name: Build + run: make build + + - name: Git Diff + run: if [ "$(git diff | wc -l)" -gt 0 ]; then exit 1; fi diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 1370988..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,66 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -name: "CodeQL" - -on: - push: - branches: [master] - pull_request: - # The branches below must be a subset of the branches above - branches: [master] - schedule: - - cron: '0 13 * * 5' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - # Override automatic language detection by changing the below list - # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] - language: ['go'] - # Learn more... - # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - # We must fetch at least the immediate parents so that if this is - # a pull request then we can checkout the head. - fetch-depth: 2 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v1 - - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index eeb0bc8..cb8b384 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -1,6 +1,6 @@ name: "Unit Test" -on: [push,pull_request] +on: [ push,pull_request ] jobs: unit_test: @@ -10,7 +10,7 @@ jobs: strategy: matrix: go: [ "1.15", "1.16" ] - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ ubuntu-latest, windows-latest, macos-latest ] steps: - name: Set up Go 1.x