Skip to content

Commit

Permalink
Update go version to 1.22 (#706)
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas authored Jun 4, 2024
1 parent 94b3547 commit 126c33a
Show file tree
Hide file tree
Showing 16 changed files with 160 additions and 151 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.21.x
go-version: 1.22.x

- name: Go Cache
uses: actions/cache@v3
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.21.x
go-version: 1.22.x

- name: Run Gosec Security Scanner
uses: securego/gosec@master
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/oidc-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.21.x
go-version: 1.22.x
cache: false

# Generating a unique name for the Integration Configuration that will be created in the following step
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.21.x
go-version: 1.22.x
cache: false

- name: Go Cache
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.21.x
go-version: 1.22.x
cache: false

- name: Go Cache
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.21.x
go-version: 1.22.x
cache: false

- name: Run Tests
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.21.x
go-version: 1.22.x
cache: false

- name: Run Tests
Expand Down Expand Up @@ -201,7 +201,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.21.x
go-version: 1.22.x
cache: false

- name: Run Tests
Expand All @@ -223,7 +223,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.21.x
go-version: 1.22.x
cache: false

- name: Unzip Preconfigured Bitbucket Home
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module github.com/jfrog/frogbot/v2

go 1.21
go 1.22.3

require (
github.com/go-git/go-git/v5 v5.12.0
github.com/golang/mock v1.6.0
github.com/google/go-github/v45 v45.2.0
github.com/jfrog/build-info-go v1.9.27
github.com/jfrog/froggit-go v1.15.0
github.com/jfrog/gofrog v1.7.1
github.com/jfrog/gofrog v1.7.2
github.com/jfrog/jfrog-cli-core/v2 v2.53.0
github.com/jfrog/jfrog-cli-security v1.1.0
github.com/jfrog/jfrog-client-go v1.40.2
Expand Down Expand Up @@ -80,7 +80,7 @@ require (
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/pkg/term v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rivo/uniseg v0.4.3 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
Expand Down Expand Up @@ -119,12 +119,12 @@ require (
gopkg.in/warnings.v0 v0.1.2 // indirect
)

replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.2.1-0.20240530135020-d86745699b3e
replace github.com/jfrog/jfrog-cli-security => github.com/jfrog/jfrog-cli-security v1.2.1-0.20240604113517-9b10a472489c

// replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 dev
replace github.com/jfrog/jfrog-cli-core/v2 => github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240603153234-c15cde9842c7

// replace github.com/jfrog/build-info-go => github.com/jfrog/build-info-go dev

// replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go dev
replace github.com/jfrog/jfrog-client-go => github.com/jfrog/jfrog-client-go v1.28.1-0.20240530101935-539b5837ce04

// replace github.com/jfrog/froggit-go => github.com/jfrog/froggit-go dev
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -894,16 +894,16 @@ github.com/jfrog/build-info-go v1.9.27 h1:7RWJcajqtNNbGHuYkgOLUIG7mmRKF0yxC7mvYA
github.com/jfrog/build-info-go v1.9.27/go.mod h1:8T7/ajM9aGshvgpwCtXwIFpyF/R6CEn4W+/FLryNXWw=
github.com/jfrog/froggit-go v1.15.0 h1:P9pWpLxucoL97FmSKW0UFbPDaRox72uqQ0XiNtbqlqQ=
github.com/jfrog/froggit-go v1.15.0/go.mod h1:TEJSzgiV+3D/GVGE8Y6j46ut1jrBLD1FL6WdMdKwwCE=
github.com/jfrog/gofrog v1.7.1 h1:ME1Meg4hukAT/7X6HUQCVSe4DNjMZACCP8aCY37EW/w=
github.com/jfrog/gofrog v1.7.1/go.mod h1:X7bjfWoQDN0Z4FQGbE91j3gbPP7Urwzm4Z8tkvrlbRI=
github.com/jfrog/gofrog v1.7.2 h1:VkAaA/9tmbw27IqgUOmaZWnO6ATUqL3vRzDnsROKATw=
github.com/jfrog/gofrog v1.7.2/go.mod h1:WJFk88SR9Sr9mKl1bQBig7DmSdXiBGKV3WhL9O6jL9w=
github.com/jfrog/jfrog-apps-config v1.0.1 h1:mtv6k7g8A8BVhlHGlSveapqf4mJfonwvXYLipdsOFMY=
github.com/jfrog/jfrog-apps-config v1.0.1/go.mod h1:8AIIr1oY9JuH5dylz2S6f8Ym2MaadPLR6noCBO4C22w=
github.com/jfrog/jfrog-cli-core/v2 v2.53.0 h1:qdZ1Svb1hGyRx2QviJtarhcA8eet8QtYU054nKzlhDg=
github.com/jfrog/jfrog-cli-core/v2 v2.53.0/go.mod h1:l101ZcbHy/FLieCx1xDtjONgkqsoLDNaqVT7b4KJ5OQ=
github.com/jfrog/jfrog-cli-security v1.2.1-0.20240530135020-d86745699b3e h1:tuJ4tlq8jOTHGYq2It5o63QqTIoWByodI/DXk3ivoaM=
github.com/jfrog/jfrog-cli-security v1.2.1-0.20240530135020-d86745699b3e/go.mod h1:IbP3MiDz5gXXc2+oXSqV688uEhLrtxHapoJ14oYTV20=
github.com/jfrog/jfrog-client-go v1.40.2 h1:zdCWPPT11r0bMGnAXGhZPb3RrIINhiTFCceQABhguZ4=
github.com/jfrog/jfrog-client-go v1.40.2/go.mod h1:m3hIn12eFWk5nJH1swPRtFrjXbiiCscOpX+v/vCdmNI=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240603153234-c15cde9842c7 h1:pWVjLJ4kwm9jn0hEPWABtQTXT77phbvLGR7icTNvtOk=
github.com/jfrog/jfrog-cli-core/v2 v2.31.1-0.20240603153234-c15cde9842c7/go.mod h1:ckNDje4Ydeo7DPS4kiripqSZ7xF7mVE5Gca3uJ5vTik=
github.com/jfrog/jfrog-cli-security v1.2.1-0.20240604113517-9b10a472489c h1:LSo6ePFNSVGgxpEVObT3cjtIJVNTp5FJ2Z/12woRv8E=
github.com/jfrog/jfrog-cli-security v1.2.1-0.20240604113517-9b10a472489c/go.mod h1:aIaW9//EpybepPUANgWv1JxuAXyUEsPvCrayjkp67IU=
github.com/jfrog/jfrog-client-go v1.28.1-0.20240530101935-539b5837ce04 h1:ERLE/L7YPr6aCUTeAnE8SXU5VOZHd5/XK16rM1TEpts=
github.com/jfrog/jfrog-client-go v1.28.1-0.20240530101935-539b5837ce04/go.mod h1:37RR4pYgXZM4w7tywyfRu8t2wagt0qf5wBtpDILWBsk=
github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible h1:jdpOPRN1zP63Td1hDQbZW73xKmzDvZHzVdNYxhnTMDA=
github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible/go.mod h1:1c7szIrayyPPB/987hsnvNzLushdWf4o/79s3P08L8A=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
Expand Down Expand Up @@ -1008,8 +1008,8 @@ github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6T
github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw=
github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
Expand Down
29 changes: 15 additions & 14 deletions packagehandlers/commonpackagehandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ package packagehandlers

import (
"fmt"
"github.com/jfrog/frogbot/v2/utils"
"github.com/jfrog/jfrog-cli-core/v2/utils/config"
"github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
"github.com/jfrog/jfrog-client-go/utils/log"
"io/fs"
"os/exec"
"path/filepath"
"regexp"
"strings"

"github.com/jfrog/frogbot/v2/utils"
"github.com/jfrog/jfrog-cli-core/v2/utils/config"
"github.com/jfrog/jfrog-cli-security/utils/techutils"
"github.com/jfrog/jfrog-client-go/utils/log"
)

// PackageHandler interface to hold operations on packages
Expand All @@ -21,25 +22,25 @@ type PackageHandler interface {

func GetCompatiblePackageHandler(vulnDetails *utils.VulnerabilityDetails, details *utils.ScanDetails) (handler PackageHandler) {
switch vulnDetails.Technology {
case coreutils.Go:
case techutils.Go:
handler = &GoPackageHandler{}
case coreutils.Poetry:
case techutils.Poetry:
handler = &PythonPackageHandler{}
case coreutils.Pipenv:
case techutils.Pipenv:
handler = &PythonPackageHandler{}
case coreutils.Npm:
case techutils.Npm:
handler = &NpmPackageHandler{}
case coreutils.Yarn:
case techutils.Yarn:
handler = &YarnPackageHandler{}
case coreutils.Pip:
case techutils.Pip:
handler = &PythonPackageHandler{pipRequirementsFile: details.PipRequirementsFile}
case coreutils.Maven:
case techutils.Maven:
handler = NewMavenPackageHandler(details)
case coreutils.Nuget:
case techutils.Nuget:
handler = &NugetPackageHandler{}
case coreutils.Gradle:
case techutils.Gradle:
handler = &GradlePackageHandler{}
case coreutils.Pnpm:
case techutils.Pnpm:
handler = &PnpmPackageHandler{}
default:
handler = &UnsupportedPackageHandler{}
Expand Down
Loading

0 comments on commit 126c33a

Please sign in to comment.