Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into whitesource-sbt-con…
Browse files Browse the repository at this point in the history
…fig-fix

* origin/master: (36 commits)
  Revert changes done to release action (SAP#5228)
  Update release-go.yml (SAP#5227)
  Remove README and CONTRIBUTING files from release 3rd try (SAP#5226)
  fix(setupCommonPipelineEnvironment): handling tags from scm info (SAP#5219)
  Remove README and CONTRIBUTING files from release 2nd try (SAP#5225)
  [CxONE] Improve report: add Low findings; Proposed Not Exploitable state (SAP#5223)
  Remove README and CONTRIBUTING files from release (SAP#5221)
  fix(naming): Rename Trust Engine to System Trust (SAP#5217)
  abapEnvironmentAssemblePackages Check for Build Errors (SAP#5214)
  docs: fix npmExuceteTests documentation formatting issues (SAP#5218)
  feat: Introduce new npmExecuteTests step (SAP#5124)
  fix(cloudFoundryDeploy): argument list too long (SAP#5216)
  Revert "Fix deployment failure with CF if password contains special char (SAP#5197)" (SAP#5215)
  chore(trustengine): Rename Trust Engine to System Trust in logs and docs (SAP#5210)
  Fix deployment failure with CF if password contains special char (SAP#5197)
  Update go version to 1.23 and removed some helper methods in favor of STD library (SAP#5200)
  Added validation for buildTool and buildDescriptorFile (SAP#5193)
  Unstash class files for Compliance stage (SAP#5192) (SAP#5204)
  fix(documentation): check param for jenkinsParams before appending Jenkins-specific text (SAP#5203)
  Align description of ADO and GHA (SAP#5202)
  ...
  • Loading branch information
maxatsap committed Jan 10, 2025
2 parents aa1bce2 + a90d483 commit 9fabb76
Show file tree
Hide file tree
Showing 93 changed files with 1,427 additions and 393 deletions.
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ indent_style = none
indent_size = none
[{go.mod,go.sum,*.go,*.golden}]
indent_style = tab
indent_size = 8
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: '1.22.4'
go-version: '1.23.4'

- name: Install Groovy
run: sudo apt-get update && sudo apt-get install groovy -y
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-go-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22.4'
go-version: '1.23.4'
- name: Perform update
run: |
git checkout -B gh-action-update-golang-dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload-go-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22.4'
go-version: '1.23.4'
- env:
CGO_ENABLED: 0
run: |
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/verify-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: styfle/cancel-workflow-action@0.11.0
- uses: actions/setup-go@v5
with:
go-version: '1.22.4'
go-version: '1.23.4'
- name: Cache Golang Packages
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.22.4'
go-version: '1.23.4'
- name: Cache Golang Packages
uses: actions/cache@v3
with:
Expand All @@ -63,7 +63,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.22.4'
go-version: '1.23.4'
- name: checkout
uses: actions/checkout@v4
with:
Expand All @@ -78,7 +78,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.22.4'
go-version: '1.23.4'
- name: Cache Golang Packages
uses: actions/cache@v3
with:
Expand All @@ -98,7 +98,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.22.4'
go-version: '1.23.4'
- name: Cache Golang Packages
uses: actions/cache@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.4 AS build-env
FROM golang:1.23.4 AS build-env
COPY . /build
WORKDIR /build

Expand Down
4 changes: 4 additions & 0 deletions cmd/abapEnvironmentAssemblePackages.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ func checkIfFailedAndPrintLogs(builds []buildWithRepository) error {
log.Entry().Errorf("Assembly of %s failed", builds[i].repo.PackageName)
buildFailed = true
}
if builds[i].build.ResultState == abapbuild.Erroneous {
log.Entry().Errorf("Assembly of %s revealed errors", builds[i].repo.PackageName)
buildFailed = true
}
if builds[i].build.BuildID != "" {
if err := builds[i].build.PrintLogs(); err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion cmd/abapEnvironmentCheckoutBranch_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/abapEnvironmentCloneGitRepo_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/abapEnvironmentPullGitRepo_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cmd/checkmarxOneExecuteScan.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"io"
"maps"
"math"
"net/url"
"os"
"path/filepath"
"regexp"
Expand Down Expand Up @@ -803,7 +804,7 @@ func (c *checkmarxOneExecuteScanHelper) getDetailedResults(scan *checkmarxOne.Sc
}

resultMap["Preset"] = scanmeta.PresetName
resultMap["DeepLink"] = fmt.Sprintf("%v/projects/%v/overview?branch=%v", c.config.ServerURL, c.Project.ProjectID, scan.Branch)
resultMap["DeepLink"] = fmt.Sprintf("%v/projects/%v/overview?branch=%v", c.config.ServerURL, c.Project.ProjectID, url.QueryEscape(scan.Branch))
resultMap["ReportCreationTime"] = time.Now().String()
resultMap["High"] = map[string]int{}
resultMap["Medium"] = map[string]int{}
Expand Down
3 changes: 2 additions & 1 deletion cmd/cloudFoundryDeploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"io"
"os"
"regexp"
"slices"
"sort"
"strings"
"time"
Expand Down Expand Up @@ -414,7 +415,7 @@ func deployMta(config *cloudFoundryDeployOptions, mtarFilePath string, command c
deployCommand = "bg-deploy"

const noConfirmFlag = "--no-confirm"
if !piperutils.ContainsString(deployParams, noConfirmFlag) {
if !slices.Contains(deployParams, noConfirmFlag) {
deployParams = append(deployParams, noConfirmFlag)
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/cloudFoundryDeploy_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cmd/cnbBuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"
"path"
"path/filepath"
"slices"

"github.com/SAP/jenkins-library/pkg/buildpacks"
"github.com/SAP/jenkins-library/pkg/buildsettings"
Expand Down Expand Up @@ -594,7 +595,7 @@ func runCnbBuild(config *cnbBuildOptions, telemetry *buildpacks.Telemetry, image
}
for _, tag := range config.AdditionalTags {
target := fmt.Sprintf("%s:%s", containerImage, tag)
if !piperutils.ContainsString(creatorArgs, target) {
if !slices.Contains(creatorArgs, target) {
creatorArgs = append(creatorArgs, "-tag", target)
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/cnbBuild_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cmd/detectExecuteScan.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"io"
"net/http"
"path/filepath"
"slices"
"sort"
"strconv"
"strings"
Expand Down Expand Up @@ -467,7 +468,7 @@ func addDetectArgs(args []string, config detectExecuteScanOptions, utils detectU
handleExcludedDirectories(&args, &config)

if config.Unmap {
if !piperutils.ContainsString(config.ScanProperties, "--detect.project.codelocation.unmap=true") {
if !slices.Contains(config.ScanProperties, "--detect.project.codelocation.unmap=true") {
args = append(args, "--detect.project.codelocation.unmap=true")
}
config.ScanProperties, _ = piperutils.RemoveAll(config.ScanProperties, "--detect.project.codelocation.unmap=false")
Expand Down
3 changes: 2 additions & 1 deletion cmd/fortifyExecuteScan.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"path/filepath"
"regexp"
"runtime"
"slices"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -211,7 +212,7 @@ func runFortifyScan(ctx context.Context, config fortifyExecuteScanOptions, sys f
prID, prAuthor := determinePullRequestMerge(config)
if prID != "0" {
log.Entry().Debugf("Determined PR ID '%v' for merge check", prID)
if len(prAuthor) > 0 && !piperutils.ContainsString(config.Assignees, prAuthor) {
if len(prAuthor) > 0 && !slices.Contains(config.Assignees, prAuthor) {
log.Entry().Debugf("Determined PR Author '%v' for result assignment", prAuthor)
config.Assignees = append(config.Assignees, prAuthor)
} else {
Expand Down
2 changes: 1 addition & 1 deletion cmd/fortifyExecuteScan_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cmd/fortifyExecuteScan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"os"
"path/filepath"
"reflect"
"slices"
"strings"
"testing"
"time"
Expand All @@ -21,7 +22,6 @@ import (

"github.com/SAP/jenkins-library/pkg/fortify"
"github.com/SAP/jenkins-library/pkg/log"
"github.com/SAP/jenkins-library/pkg/piperutils"
"github.com/SAP/jenkins-library/pkg/versioning"

"github.com/google/go-github/v45/github"
Expand Down Expand Up @@ -421,7 +421,7 @@ func (er *execRunnerMock) Stderr(err io.Writer) {
func (er *execRunnerMock) RunExecutable(e string, p ...string) error {
er.numExecutions++
er.currentExecution().executable = e
if len(p) > 0 && piperutils.ContainsString(p, "--failTranslate") {
if len(p) > 0 && slices.Contains(p, "--failTranslate") {
return errors.New("Translate failed")
}
er.currentExecution().parameters = p
Expand Down
3 changes: 3 additions & 0 deletions cmd/getConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ func GetStageConfig() (config.StepConfig, error) {

defaultConfig := []io.ReadCloser{}
for _, f := range GeneralConfig.DefaultConfig {
if configOptions.OpenFile == nil {
return stepConfig, errors.New("config: open file function not set")
}
fc, err := configOptions.OpenFile(f, GeneralConfig.GitHubAccessTokens)
// only create error for non-default values
if err != nil && f != ".pipeline/defaults.yaml" {
Expand Down
3 changes: 2 additions & 1 deletion cmd/kanikoExecute.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"fmt"
"slices"
"strings"

"github.com/mitchellh/mapstructure"
Expand Down Expand Up @@ -287,7 +288,7 @@ func runKanikoExecute(config *kanikoExecuteOptions, telemetryData *telemetry.Cus
}
return nil

case piperutils.ContainsString(config.BuildOptions, "--destination"):
case slices.Contains(config.BuildOptions, "--destination"):
log.Entry().Infof("Running Kaniko build with destination defined via buildOptions: %v", config.BuildOptions)

for i, o := range config.BuildOptions {
Expand Down
6 changes: 4 additions & 2 deletions cmd/mavenBuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

const (
mvnBomFilename = "bom-maven"
mvnSimpleBomFilename = "bom-simple"
mvnSimpleBomFilename = "simple-bom-maven"
)

func mavenBuild(config mavenBuildOptions, telemetryData *telemetry.CustomData, commonPipelineEnvironment *mavenBuildCommonPipelineEnvironment) {
Expand Down Expand Up @@ -238,7 +238,9 @@ func runMavenBuild(config *mavenBuildOptions, _ *telemetry.CustomData, utils mav
func createBuildArtifactsMetadata(config *mavenBuildOptions, commonPipelineEnvironment *mavenBuildCommonPipelineEnvironment) (error, bool) {
fileUtils := &piperutils.Files{}
buildCoordinates := []versioning.Coordinates{}
options := versioning.Options{}
options := versioning.Options{
ProjectSettingsFile: config.ProjectSettingsFile,
}
var utils versioning.Utils

matches, _ := fileUtils.Glob("**/pom.xml")
Expand Down
1 change: 1 addition & 0 deletions cmd/metadata_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cmd/mtaBuild_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func TestMtaBuild(t *testing.T) {
SetConfigOptions(ConfigCommandOptions{
OpenFile: config.OpenPiperFile,
})

t.Run("Application name not set", func(t *testing.T) {
utilsMock := newMtaBuildTestUtilsBundle()
options := mtaBuildOptions{}
Expand Down
4 changes: 2 additions & 2 deletions cmd/newmanExecute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ package cmd
import (
"os"
"path/filepath"
"slices"
"strings"
"testing"

sliceUtils "github.com/SAP/jenkins-library/pkg/piperutils"
"github.com/google/uuid"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -317,7 +317,7 @@ func (e *newmanExecuteMockUtils) RunExecutable(executable string, params ...stri
if e.errorOnNewmanExecution && strings.Contains(executable, "newman") {
return errors.New("error on newman execution")
}
if e.errorOnNewmanInstall && sliceUtils.ContainsString(params, "install") {
if e.errorOnNewmanInstall && slices.Contains(params, "install") {
return errors.New("error on newman install")
}

Expand Down
Loading

0 comments on commit 9fabb76

Please sign in to comment.