From d937fc5e13bb85aa53a10d19ef3c98a41afd2e98 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Tue, 29 Jun 2021 00:37:25 +0300 Subject: [PATCH 1/9] README and workflows improvements --- .github/workflows/codeql.yml | 5 +---- README.md | 9 +++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 24d3a73..ce19a79 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -6,7 +6,7 @@ on: pull_request: branches: [master] schedule: - - cron: '0 17 * * 1,3,5' + - cron: '0 19 * * 1,3,5' jobs: analyse: @@ -19,9 +19,6 @@ jobs: with: fetch-depth: 2 - - run: git checkout HEAD^2 - if: ${{ github.event_name == 'pull_request' }} - - name: Initialize CodeQL uses: github/codeql-action/init@v1 with: diff --git a/README.md b/README.md index 2d0e0f5..32b5a21 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,13 @@

- GitHub Actions Status - - - codebeat badge + GitHub Actions CI Status + GitHub Actions CodeQL Status + GoReportCard + Codebeat badge

+

From 6a97fd36e98d2dbe4617fc673bb4f572eb7a61d5 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Tue, 29 Jun 2021 00:37:51 +0300 Subject: [PATCH 2/9] Update copyright header --- morpher-server.go | 2 +- refs/fuzz.go | 2 +- refs/refs.go | 2 +- refs/refs_test.go | 2 +- repo/repo.go | 2 +- server/healthcheck/healthcheck.go | 2 +- server/morpher/morpher.go | 2 +- server/server.go | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/morpher-server.go b/morpher-server.go index 60121b0..cb0f8f1 100644 --- a/morpher-server.go +++ b/morpher-server.go @@ -2,7 +2,7 @@ package main // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2020 ESSENTIAL KAOS // +// Copyright (c) 2021 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/refs/fuzz.go b/refs/fuzz.go index b2c4534..8f74d4e 100644 --- a/refs/fuzz.go +++ b/refs/fuzz.go @@ -4,7 +4,7 @@ package refs // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2020 ESSENTIAL KAOS // +// Copyright (c) 2021 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/refs/refs.go b/refs/refs.go index fa13b22..3a8bd3e 100644 --- a/refs/refs.go +++ b/refs/refs.go @@ -2,7 +2,7 @@ package refs // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2020 ESSENTIAL KAOS // +// Copyright (c) 2021 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/refs/refs_test.go b/refs/refs_test.go index 2b8b958..e71decc 100644 --- a/refs/refs_test.go +++ b/refs/refs_test.go @@ -2,7 +2,7 @@ package refs // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2020 ESSENTIAL KAOS // +// Copyright (c) 2021 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/repo/repo.go b/repo/repo.go index 2e22597..b590dcc 100644 --- a/repo/repo.go +++ b/repo/repo.go @@ -2,7 +2,7 @@ package repo // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2020 ESSENTIAL KAOS // +// Copyright (c) 2021 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/server/healthcheck/healthcheck.go b/server/healthcheck/healthcheck.go index 967cc05..d5a5f14 100644 --- a/server/healthcheck/healthcheck.go +++ b/server/healthcheck/healthcheck.go @@ -2,7 +2,7 @@ package healthcheck // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2020 ESSENTIAL KAOS // +// Copyright (c) 2021 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/server/morpher/morpher.go b/server/morpher/morpher.go index f8a44f9..b3db035 100644 --- a/server/morpher/morpher.go +++ b/server/morpher/morpher.go @@ -2,7 +2,7 @@ package morpher // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2020 ESSENTIAL KAOS // +// Copyright (c) 2021 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // diff --git a/server/server.go b/server/server.go index f55aa5e..390eeea 100644 --- a/server/server.go +++ b/server/server.go @@ -2,7 +2,7 @@ package server // ////////////////////////////////////////////////////////////////////////////////// // // // -// Copyright (c) 2020 ESSENTIAL KAOS // +// Copyright (c) 2021 ESSENTIAL KAOS // // Apache License, Version 2.0 // // // // ////////////////////////////////////////////////////////////////////////////////// // From 1f56e528cda88ecd337b2c93069969d27120fa05 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Tue, 29 Jun 2021 00:46:26 +0300 Subject: [PATCH 3/9] Update dependencies --- Gopkg.lock | 34 +++++++++++++++++----------------- Gopkg.toml | 8 ++++---- Makefile | 4 ++-- refs/refs_test.go | 2 +- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index aeef1ba..6405a7c 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -2,15 +2,15 @@ [[projects]] - digest = "1:3bfdfb3f1e89263734e9dd6d65a00ad0d4886750061439b7da2a8ab753a2ecf4" + digest = "1:f140dbd6d3c8ba2f7bde03b7d39530d233ed400d91576ac43660aacea587849d" name = "github.com/andybalholm/brotli" packages = ["."] pruneopts = "UT" - revision = "729edfbcfeaad43a6412c185205501ec80773250" - version = "v1.0.1" + revision = "5376c15dde3fd4247febd5a3b4ac9708d2d6faff" + version = "v1.0.3" [[projects]] - digest = "1:31d6e66ab882fae8534e01407a9cd6c036a51706a04adfe6912efaaf18989d20" + digest = "1:e377cb0e163dcc88ea2b87a8e3f62abc3229ddbd6e20ece13f5f80b673e5614f" name = "github.com/klauspost/compress" packages = [ "flate", @@ -18,8 +18,8 @@ "zlib", ] pruneopts = "UT" - revision = "ff4a4acf3be7ac7b0b1c3381000e0216eb9e956f" - version = "v1.11.3" + revision = "5453ad3645a8c3a61091d6508d3d0e32ad950b79" + version = "v1.13.1" [[projects]] digest = "1:759375161ead34b8a830e14e75196bb51a999f125531d2faf0a1a944551a586f" @@ -46,7 +46,7 @@ version = "v1.0.0" [[projects]] - digest = "1:8b729ea12d4304a0841ad2946f479b5f746eb663d053e43b4dfd220a7304098d" + digest = "1:fad1aeae72dfb041868236466dfa03daba77c923254a30db774166abbdc088bd" name = "github.com/valyala/fasthttp" packages = [ ".", @@ -54,19 +54,19 @@ "stackless", ] pruneopts = "UT" - revision = "d0dfbd4494632e4bf398d1c0098e4c389a1c4356" - version = "v1.18.0" + revision = "874c8cad76f8bb0a0ee59cf7f749016e7b4cfcf4" + version = "v1.27.0" [[projects]] - branch = "master" - digest = "1:b39f3febddd151ee9993a0a10c20393efeddb1d31c0c706c9d03d054dbafd308" - name = "pkg.re/check.v1" + digest = "1:41609162109a3dfa19f3ae290696e594f989aa646a3d4595d7e94ee96ffed072" + name = "pkg.re/essentialkaos/check.v1" packages = ["."] pruneopts = "UT" - revision = "10cb98267c6cb43ea9cd6793f29ff4089c306974" + revision = "f4374f852de5d45996a5baf0b71865d1096185d4" + version = "v1.0.0" [[projects]] - digest = "1:904f7cbc12855430f0d164541cdd3ade6026373835fcdf6d3ce320a30789bab4" + digest = "1:dca937719a6211a7decf209c19c6ee1385aa7975927f868a1d11cf4adb3ae690" name = "pkg.re/essentialkaos/ek.v12" packages = [ "env", @@ -87,15 +87,15 @@ "version", ] pruneopts = "UT" - revision = "00c0a837aeb511ce64760297eb140bf73626e88f" - version = "v12.11.0" + revision = "ce458cfce7e3a5d26987ffb116366955d43eba52" + version = "v12.20.4" [solve-meta] analyzer-name = "dep" analyzer-version = 1 input-imports = [ "github.com/valyala/fasthttp", - "pkg.re/check.v1", + "pkg.re/essentialkaos/check.v1", "pkg.re/essentialkaos/ek.v12/fmtc", "pkg.re/essentialkaos/ek.v12/knf", "pkg.re/essentialkaos/ek.v12/knf/validators", diff --git a/Gopkg.toml b/Gopkg.toml index 2e46c4a..11daba6 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -1,14 +1,14 @@ [[constraint]] name = "github.com/valyala/fasthttp" - version = "1.18.0" + version = "1.27.0" [[constraint]] - branch = "master" - name = "pkg.re/check.v1" + name = "pkg.re/essentialkaos/check.v1" + version = "1.0.0" [[constraint]] name = "pkg.re/essentialkaos/ek.v12" - version = "12.11.0" + version = "12.20.4" [prune] go-tests = true diff --git a/Makefile b/Makefile index 99c87bb..ee1b5a5 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ ################################################################################ -# This Makefile generated by GoMakeGen 1.3.0 using next command: +# This Makefile generated by GoMakeGen 1.3.2 using next command: # gomakegen --dep --metalinter . # # More info: https://kaos.sh/gomakegen @@ -64,6 +64,6 @@ help: ## Show this info @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \ | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-16s\033[0m %s\n", $$1, $$2}' @echo -e '' - @echo -e '\033[90mGenerated by GoMakeGen 1.3.0\033[0m\n' + @echo -e '\033[90mGenerated by GoMakeGen 1.3.2\033[0m\n' ################################################################################ diff --git a/refs/refs_test.go b/refs/refs_test.go index e71decc..389747d 100644 --- a/refs/refs_test.go +++ b/refs/refs_test.go @@ -12,7 +12,7 @@ import ( "io/ioutil" "testing" - . "pkg.re/check.v1" + . "pkg.re/essentialkaos/check.v1" ) // ////////////////////////////////////////////////////////////////////////////////// // From b1544a4968547cd13f7a3075ac39d31723702b79 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Tue, 29 Jun 2021 00:47:48 +0300 Subject: [PATCH 4/9] Version bump --- common/pkgre.spec | 7 +++++-- server/server.go | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common/pkgre.spec b/common/pkgre.spec index 156f8f3..cdd11bd 100644 --- a/common/pkgre.spec +++ b/common/pkgre.spec @@ -54,7 +54,7 @@ Summary: pkg.re morpher server Name: pkgre -Version: 4.3.0 +Version: 4.4.0 Release: 0%{?dist} Group: Applications/System License: Apache License, Version 2.0 @@ -64,7 +64,7 @@ Source0: https://source.kaos.st/pkgre/%{name}-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: golang >= 1.14 +BuildRequires: golang >= 1.16 Requires: systemd @@ -153,6 +153,9 @@ rm -rf %{buildroot} ################################################################################ %changelog +* Tue Jun 29 2021 Anton Novojilov - 4.4.0-0 +- Dependencies updated to the latest versions + * Mon Dec 21 2020 Anton Novojilov - 4.3.0-0 - Sending healthcheck requests diff --git a/server/server.go b/server/server.go index 390eeea..82b2d04 100644 --- a/server/server.go +++ b/server/server.go @@ -33,7 +33,7 @@ import ( // Application info const ( APP = "PkgRE Morpher Server" - VER = "4.3.0" + VER = "4.4.0" DESC = "HTTP Server for morphing go get requests" ) From 4babd9eed4337d472b6229174d95704c8a2662bb Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Tue, 29 Jun 2021 00:52:25 +0300 Subject: [PATCH 5/9] Add Aligo check to CI workflow --- .github/workflows/ci.yml | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca38d11..73179b4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,3 +86,49 @@ jobs: env: IMAGE: essentialkaos/perfecto:micro run: ./perfecto-docker common/pkgre.spec + + Aligo: + name: Aligo + runs-on: ubuntu-latest + + needs: Go + + env: + SRC_DIR: src/github.com/${{ github.repository }} + GO111MODULE: auto + + steps: + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: '1.16.x' + id: go + + - name: Setup PATH + run: | + echo "GOPATH=${{ github.workspace }}" >> "$GITHUB_ENV" + echo "GOBIN=${{ github.workspace }}/bin" >> "$GITHUB_ENV" + echo "${{ github.workspace }}/bin" >> "$GITHUB_PATH" + + - name: Checkout + uses: actions/checkout@v2 + with: + path: ${{env.SRC_DIR}} + + - name: Download dependencies + working-directory: ${{env.SRC_DIR}} + run: make deps + + - name: Install Aligo + working-directory: ${{env.SRC_DIR}} + run: | + wget https://apps.kaos.st/aligo/latest/linux/x86_64/aligo + chmod +x aligo + + - name: Print Aligo version info + working-directory: ${{env.SRC_DIR}} + run: ./aligo --version + + - name: Check Go structs alignment info + working-directory: ${{env.SRC_DIR}} + run: ./aligo check ./... From 89c86e128be0b255afc79e8a0062df983d2812c4 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Tue, 29 Jun 2021 00:53:28 +0300 Subject: [PATCH 6/9] Align structs --- server/morpher/morpher.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/morpher/morpher.go b/server/morpher/morpher.go index b3db035..ee08ed9 100644 --- a/server/morpher/morpher.go +++ b/server/morpher/morpher.go @@ -45,11 +45,11 @@ const DOC_QUERY_ARG = "docs" // PkgInfo is struct with package info type PkgInfo struct { + Path string + TargetName string RepoInfo *repo.Info RefsInfo *refs.Info - Path string TargetType refs.RefType - TargetName string } // Metrics is struct with metrics data From 02dfd74e66e565ff67b687cdb2f78f2e9ea5a782 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Tue, 29 Jun 2021 00:56:25 +0300 Subject: [PATCH 7/9] Fix PkgInfo struct initialization --- server/morpher/morpher.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/morpher/morpher.go b/server/morpher/morpher.go index ee08ed9..3ece540 100644 --- a/server/morpher/morpher.go +++ b/server/morpher/morpher.go @@ -176,7 +176,13 @@ func requestHandler(ctx *fasthttp.RequestCtx) { } targetType, targetName := suggestHead(repoInfo, refsInfo) - pkgInfo := &PkgInfo{repoInfo, refsInfo, path, targetType, targetName} + pkgInfo := &PkgInfo{ + RepoInfo: repoInfo, + RefsInfo: refsInfo, + Path: path, + TargetType: targetType, + TargetName: targetName, + } // Rewrite refs if repoInfo.Path == "info/refs" { From 3436fdffd36aa5ad5adb8c67a17555e2a3dc55c1 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Tue, 29 Jun 2021 00:59:15 +0300 Subject: [PATCH 8/9] Fix Aligo CI step --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73179b4..a1d5faa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,6 +115,11 @@ jobs: with: path: ${{env.SRC_DIR}} + - name: Install deps + run: | + mkdir -p $GOBIN + curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + - name: Download dependencies working-directory: ${{env.SRC_DIR}} run: make deps From 4acfa27c9ead22403d2ea0ca2c020cdc05dfc59b Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Wed, 30 Jun 2021 14:35:38 +0300 Subject: [PATCH 9/9] Update spec file for compatibility with Go 1.16 --- common/pkgre.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/common/pkgre.spec b/common/pkgre.spec index cdd11bd..03c7e20 100644 --- a/common/pkgre.spec +++ b/common/pkgre.spec @@ -87,6 +87,7 @@ pkg.re service morpher server. %build export GOPATH=$(pwd) +export GO111MODULE=auto pushd src/github.com/essentialkaos/%{name} %{__make} %{?_smp_mflags} all