1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-14 11:03:09 +02:00
Commit Graph

840 Commits

Author SHA1 Message Date
Ashly Mathew
823ef47db6
Golang build publish binaries and add group id (#3749)
* Add golang binaries to CPE and add groupID in coordinates

Signed-off-by: Ashly Mathew <ashly.mathew@sap.com>

* Introducing binaries as artifacts

Signed-off-by: Ashly Mathew <ashly.mathew@sap.com>
2022-05-05 12:39:59 +02:00
Giridhar Shenoy
fe9b3a796b
detectExecuteScan: fix project version limiting api call (#3754)
* fix project version limiting issue

* add tests for detectExecute
2022-05-05 09:58:43 +02:00
Anil Keshav
7ad96ee686
feat (cpe) introduce a new artifact cpe type (#3763)
* including a artifact cpe type

* removing type kind related to PR 3717

* clean up

* eliminating local path

* go formatting fix

Co-authored-by: anilkeshav27 <you@example.com>
2022-05-03 09:53:12 +02:00
Daniel Bernd
c65e569cdf
add OSL Package Tree on ObjectSet level (#3762)
Co-authored-by: Daniel Bernd <93763187+danManSAP@users.noreply.github.com>
2022-04-29 16:50:57 +02:00
Daniel Bernd
a3f1234a60
Feature: ATC & AUNIT - ObjectSetLibrary(OSL) usage (#3755)
* own OSL go File & first changes ATC step

* OSL Integration in AUnit & ATC steps 1

* OSL & Unit Tests

* Unit Tests 1

* OSL - AUnit & ATC usage

* Unittest ATC: packagetree --> package incl. subpackages

* correct spelling

* yaml & generated update

* generated Metadata

Co-authored-by: Daniel Bernd <93763187+danManSAP@users.noreply.github.com>
2022-04-27 13:30:43 +02:00
Vitalii Sidorov
9d8f3fc6ad
fix runHelmAdd (#3747)
* fix runHelmAdd

* Add tests

Co-authored-by: “Vitalii <“vitalii.sidorov@sap.com”>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-04-26 17:50:37 +02:00
tiloKo
5a252392f2
enableBuildWithoutValues (#3753) 2022-04-26 17:14:55 +02:00
xgoffin
0696db5e0d
feat(sarif): logging improvements (#3727)
* fix(fortifyExecuteScan): check audit data length in all cases

* fix(fortifyExecuteScan): check audit data length in all cases

* feat(SARIF): logging improvements in debug mode

* fix(logging): readability

Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2022-04-26 12:34:54 +02:00
Giridhar Shenoy
2ed1ed76fc
whitesourceExecuteScan : add log level trace (#3745)
* add log level trace

* add log level files trace

* add tests
2022-04-22 13:19:49 +02:00
Jordi van Liempt
eb73cae888
feat(getDefaults): add parameter for CRD-style config (#3736)
* export LoadConditionsV1() in config pkg

* getDefaults: read stage conditions as PipelineDefinitionV1

* add getDefaults useV1 tests

* add comment (pointed out by code climate analysis)

* small addition to comment (from previous commit)

Co-authored-by: I557621 <jordi.van.liempt@sap.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2022-04-19 12:34:40 +02:00
Vitalii Sidorov
63cdfc0e68
Fix helm execute command (#3701)
* Add small fix

* fix unit-tests

* Add deploymentName and packageVersion as flags

* small fix

* Change getting version of helm chart

* small fix

Co-authored-by: “Vitalii <“vitalii.sidorov@sap.com”>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-04-14 15:43:47 +02:00
Siarhei Pazdniakou
d519966fe5
feat(gradleExecuteBuild): publish (upload to staging) (#3662)
* gradle publish

* Fix gradle utils

* Added unit test

* Add descriptions for parameters

* Added unit tests

* fix publish init script template

* fix artifactId and groupId

* fix project path

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-04-14 14:59:09 +02:00
Anil Keshav
3c08a3bd7a
including container names when no conditions (#3733)
Co-authored-by: anilkeshav27 <you@example.com>
2022-04-13 17:34:42 +02:00
rosemarieB
9fdaf86856
Enable additional piecelist for assembly (#3730)
* add useClassicCTS

* add option additionalPiecelist

* Update abapEnvironmentAssemblePackages.go
2022-04-12 16:00:17 +02:00
rosemarieB
1ffe22903e
Enable classic cts (#3728)
* add useClassicCTS

* debug output and unit test

* unsaved fix

* error logging

* Update abapEnvironmentAssemblePackages.go

* Update abapEnvironmentAssemblePackages.go

* add general scope and remove logging

* Update bfw.go

* Update abapEnvironmentAssemblePackages.go

* Update abapEnvironmentAssemblePackages.go

* Update package.go

* Update abapEnvironmentAssemblePackages.go

* change scope and add certificates

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>
2022-04-12 14:39:42 +02:00
Michael
6676da1f9d
feat(gitopsUpdateDeployment) forcePush (#3665)
* feat(gitopsUpdateDeployment) forcePush

fix(gitopsUpdateDeployment) include registry

The push operation in this step can be forced to bypass branch-protection

Signed-off-by: Michael Sprauer <Michael.Sprauer@sap.com>

* add unit test

Signed-off-by: Michael Sprauer <Michael.Sprauer@sap.com>

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-04-07 16:33:46 +02:00
xgoffin
fb9792ad71
feat(fortifyExecuteScan): optimization of the SARIF conversion code (#3710)
* feat(fortifyExecuteScan): query SSC once for batch audit data

* fix(fortifyExecuteScan): check audit data length in all cases

* feat(fortifyExecuteScan): in fpr_to_sarif, better detection of error cases, unit tests

* fix(log): comment useless error message

* fix(fortifyExecuteScan): clarify log message

* fix(fortifyExecuteScan): adapt unit tests
2022-04-07 13:11:52 +02:00
Julian Schmitt
6151f36d88
Implement Release 3.0.0 of CM-Client (#3664)
* Remove --backend-type

* Delete CTS in isChangeDevelopment and change Dockerimage of CM-Client

* fix groovy unit tests

* another fix of groovy unit tests

* try to fix import of fork for Jenkins-Testing

* add workflow to create Go Binary for Jenkins-Server

* Change RepoOwner to test in Fork

* remove previous changes

* adjust docker image for TransportRequestCreate and Release

* Remove CTS from Documentation

Co-authored-by: Thorsten Duda <thorsten.duda@sap.com>
2022-04-05 12:33:19 +02:00
xgoffin
3c55d3c99c
feat(checkmarxExecuteScan): convert Checkmarx xml report to SARIF (#3696)
* feat(checkmarxExecuteScan): sarif conversion for Checkmarx XML reports

* feat(checkmarxExecuteScan): added taxonomies and similarityID

* fix(checkmarxExecuteScan): proper handling of ruleId and ruleIndex

* fix(sarif): mistype in checkmarx properties

* fix(checkmarxExecuteScan): fixed occasional panics when handling audit comment

* chore(sarif): proper variable naming

* chore(code): fix missing and unrecognized comments

* trigger PR

* fix(format): extra space

Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2022-04-04 16:12:35 +02:00
Oliver Nocon
62b3a9a459
fix(versioning): properly consider go.mod (#3687)
* fix(versioning): properly consider go.mod

* fix test
2022-03-31 17:07:10 +02:00
Ralf Pannemans
5b42b6af70
feat(cnbBuild): Support of username/password authorization (#3690)
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
2022-03-31 16:13:21 +02:00
Ralf Pannemans
0c28ecc4fb
debug(cnbbuild): Add some debug messages (#3688)
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>
2022-03-31 15:02:06 +02:00
xgoffin
dc91332e29
fix(fortifyExecuteScan): occasional panics when snippets are undefined or contain XML comments (#3686) 2022-03-31 12:13:17 +02:00
Pavel Busko
1f750af16d
feat(cnbBuild): cache buildpacks during multi-image build (#3635)
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
2022-03-30 13:58:16 +02:00
Anil Keshav
e8fc08e43b
fix (untar) correct condition for gunzip file (#3679)
* debug if file is gzipped

* looking 3 byte value

* debug for gzip file

* reading decimal values instead of hexadecimal

* looking for byte values

* modifying return

* simplyfying conditions

* correcting err condition

* trying with hex

* using hex

Co-authored-by: anilkeshav27 <you@example.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-03-30 12:30:57 +02:00
Vitalii Sidorov
d62c3d73a0
Add helm dependency command (#3669)
* Add helm dependency command

* Change name of flag for package command

Co-authored-by: “Vitalii <“vitalii.sidorov@sap.com”>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-03-30 08:18:51 +02:00
ffeldmann
a9329fba9e
Reuse SOURCEBRANCH for branch name (#3672) 2022-03-28 13:48:55 +02:00
ffeldmann
ccc1c976ee
fix(orchestrator) usage of correct env variables (#3650)
* Reorders getApiInformation, changes variables to get start time, adjusts and adds test cases
* Changes the way to get apiInformation and reduces number of requests
* Changes getting pipeline start time from correct env variable
* Refactors getApiInformation functionality
* Adds GetBuildReason() for Azure and Jenkins
* Updates JobURL for ADO
2022-03-28 09:52:15 +02:00
Christian Volk
22f6aa156f
feat(docker): use crane for pulling docker images (#3652) 2022-03-23 10:02:00 +01:00
Sven Merk
f06890a9b2
SARIF format and GHIssue format improvements (#3646)
* Improve reporting

* Fix location

* Align casing

* Fix severity mapping

* Fix format

* Improve title

* Title format

* Fix severity

* Align title

* Fix schema reference

* Fix schema reference

* Fix fmt

* Fix fmt2

* Fix tests

* fix(sarif): proper handling of omitempty in SnippetSarif

* fix(fortifyExecuteScan): sarif format version

* Addressing comments

* Fix SARIF

* fix(sarif): omitempty handling

* fix(fortifyExecuteScan): pointer indirection

* Added TODOs for audit data

Co-authored-by: Xavier Goffin <x.goffin@sap.com>
Co-authored-by: xgoffin <86716549+xgoffin@users.noreply.github.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-03-22 14:47:19 +01:00
Siarhei Pazdniakou
db5360fb89
feat(gradleExecuteBuild): BOM creation. Integration tests (#3603)
* Implemented bom creation

* Made small fixes. Added integration tests

* go generate

* minor fixes

* fix tests

* Added unit tests

* minor fixes

* use fileutils

* integration tests optimization

* change integraton tests timeout to 25m

* Fix Inclusive Language warnings

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-03-21 10:17:03 +01:00
Vitalii Sidorov
2a4052d13c
feat(helmExecute): run complete lint, build, publish cycle (#3546)
* Add runHelmCommand

* Add dryRun for debug

* Add default case in helmExecute

* Fix unit-tests

* small fix

* Fix RunHelmAdd and change RunHelmPublish methods

* Fix RunHelmPublish

* Fix unit-tests

* Fix unit-test

* small fix

* small fix

* small fix

* Add LintFlag PackageFlag PublishFlag flags

* Add tests for httpClient.go

* test

* test

* smal fix

* small fix

* Add getting name and version from Chart.yaml

* Add test

* Fix

* small fix

* Fix according to comments

* small fix

Co-authored-by: “Vitalii <“vitalii.sidorov@sap.com”>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
Co-authored-by: Vitalii Sidorov <vitalii_sidorov@sap.com>
2022-03-17 17:13:34 +01:00
Sven Merk
c30e93bc6a
feat(detectExecuteScan): SARIF export and GH issue creation (#3637)
* Added SARIF and GH issue creation
2022-03-17 15:32:48 +01:00
xgoffin
3f6e4b9e3b
feat(fortifyExecuteScan): added parameter to generated sarif file (#3644)
* fix(sarif): change format to fit omitempty cases better

* feat(fortifyExecuteScan): include category in sarif file

* fix(fortifyExecuteScan): access to undefined pointer in some cases

Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2022-03-17 13:09:15 +01:00
Anil Keshav
818636b048
feat (checkIfStepActive) including cpe conditions to check if a step is active / not active (#3642)
* including cpe struct

* evaluating types

* adding environment root path

* unit tests

Co-authored-by: anilkeshav27 <you@example.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-03-17 12:09:16 +01:00
Christian Volk
58b30cc99b
fix(golangBuild): publishing of binaries (#3643) 2022-03-17 11:07:51 +01:00
Maurice Breit
9f2d8a70b1
(fix) match regexes in sliceContains to support vaultSecretNames (#3618)
* (fix) match regexes in sliceContains to support vaultSecretNames

* add test for regex matching in sliceContains

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-03-17 09:41:51 +01:00
Oliver Nocon
504f076613
feat: support cpe credentials for multiple repos (#3641) 2022-03-17 08:01:00 +01:00
Oliver Feldmann
4208bc050c
Add bearer token retrieval function (#3595)
* Add bearer token retrieval function

Retrieving a bearer token from the xsuaa service on BTP is always the
same. With these functions one can retrieve a bearer token and set it
to the given header as 'Authorization'.

* CodeClimate fixes

* Refactor test

* Add basic auth to token retrieve request

Co-authored-by: Thorsten Duda <thorsten.duda@sap.com>
2022-03-16 11:22:48 +01:00
Oliver Nocon
7ec512cb9f
feat(artifactPrepareVersion): helm & propagate version (#3627)
* feat(artifactPrepareVersion): helm & propagate version

* chore: small refactoring

* chore: fix linting issue

* fix version persistence
2022-03-15 09:08:24 +01:00
xgoffin
dfd2278639
feat(fortifyExecuteScan): full FPR to SARIF implementation (#3604)
* feat(FPRtoSARIF): boilerplate & comments

* Feat(Ingest): Build done, Vulnerabilities partway

* feat(Vulnerabilities): now entirely parsed

* feat(FprToSarif): integration in Piper step, full xml structure

* feat(fpr_to_sarif): base program. Need to replace names in messages

* feat(fpr_to_sarif): message substitution and custom definition integration

* fix(fpr_to_sarif): missing replacement in tools object

* fix(fpr_to_sarif): failing unit test

* Fix fortify folder creation for generating sarif

* deletion of unzip folder

* feat(fpr_to_sarif): better unit test

* fix(fpr_to_sarif): pr tests failing

* feat(fortifyExecuteScan): complete SARIF file generation

* fix(fpr_to_sarif): add extra check and test to prevent panics

* rebase onto master, fix ALL conflicts, adapt code and format

* fix missing added properties

* fix(SARIF): structure

* fix(whitesource): wrong sarif structures

* Update pkg/fortify/fpr_to_sarif.go

* Update pkg/format/sarif.go

* Update pkg/format/sarif.go

Co-authored-by: Sumeet PATIL <sumeet.patil@sap.com>
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2022-03-14 11:26:05 +01:00
ffeldmann
b224f2294c
Activates debug information for environment variables (#3630)
* Activates debug information for environment variables

* Adds tests for environment variable reading

* Reduces batch size to send messages to Splunk to 5000
2022-03-14 10:17:55 +01:00
Oliver Nocon
2a56723d40
feat(kanikoExecute): Trim names for multi-image builds (#3617)
* feat(kanikoExecute): Trim names for multi-image builds

* chore: fix yaml linting issue
2022-03-11 09:47:44 +01:00
Oliver Nocon
2c837927d4
chore(whitesourceExecuteScan): Gradle config changes (#3621)
* chore(whitesourceExecuteScan): Gradle config changes

supersedes #3293
closes #3293

* update config

Co-authored-by: ffeldmann <f.feldmann@sap.com>
2022-03-11 08:18:21 +01:00
Anil Keshav
157f6d4e35
feat (checkIfStepActive) enhance to include not active conditions (#3616)
* including negative conditions

* clean up and todos

* removing debug logging

* clean up

* fix unit test name

* fixing unit tests

* negative stage test

Co-authored-by: anilkeshav27 <you@example.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-03-10 13:35:28 +01:00
Christian Volk
b9c0aa008f
feat(piperExecuteBin): support running images from private docker registries (#3622) 2022-03-09 17:35:57 +01:00
Johannes Dillmann
3708f274cc
feat(cnbBuild) read target image name from github cpe (#3620)
Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
2022-03-09 14:06:26 +01:00
maheshsrikrishnan
64a00c540a
New piper step APIProviderDownload contribution (#3349)
* added store file function in cpi common utils

Change-Id: Ia429a2792266e082d139025a71799d21c30a7df9

* Added api provider steps

Change-Id: Icd2829a91db4c53d0de2330822d2b33933973868

* Update apiProviderDownload.yaml

* fixed yaml JLINT issue

Change-Id: Iac974abc30fa00e68c0177072b93716b0af5e0c5

* Removed trailing spaces

Change-Id: I927e9314fce6e9cab68d6b97577c7c96bb2bddad

* Resolved common steps groovy script conflict

Change-Id: I3ad144b618e1c77953aaeccaa5bf7309aff77ca9

* Change for conflict resolution

Change-Id: Ic955833eca844f090b7983f99f9d3649ebb981c7

* Fixed method name and its corresponding implementation

Change-Id: I465c1f1d5306bb978386de9efca3c521e385b89c

* Moved re-usable function to commonUtils package

Change-Id: Ide06462b01caeb2bf438ad7661e01c15bf8e8e24

* Changed the implementation to use existing writeFile method

* Fixed review comments on documentation and test structuring

Change-Id: Ifebd2f4b50754b2097b2d564fb3cc37c433ef6c9

* Fixed documentation alignment issues

* Fixed spaces issue

Change-Id: I834bd94e01bce72e7f81ab49ba32671c91c66ca9

* Documentation removed extra spaces

Change-Id: I9a639d76ed9b81c870f18349504044bb70753b52

* Fixed doc build issue

Change-Id: I96c3e15e73834b64f8b8e3432ce59f6b037f93fd

* Fixed documentation build issues

Change-Id: I7fca2ba69bc7b7298ee300ccd1ae16a6238dc96b

* Re-generated code for fixing build failure

Change-Id: I22b7ee6162f643d9f3b60f6a33eb7858927182a0

* Adopted file utils & mock

Change-Id: Ic46462003527f41df64395a5a615c19bf374e8ef

* Removed ioutil call in the test & adopted error variable names

* Removed commented lines

Change-Id: I99a12e39bc04323e9c19f1409d97eeca267e6fdb

* Added test for asserting file download and adopted error variables

Change-Id: I49463a3b75987bf68f5261d45602d2d7bd960a05

* Added download path assertion positive & negative case

Change-Id: Ieee461c3973b9dfa8f395dc936e4241ff9694c7b

* Modified tests with DownloadPath variable

Change-Id: Iaf14c9ea1a8242b6c8d8e9e4fac8c23d9c1b3a74

* Added testcase to validate file content

Change-Id: I21aed481b433450c3b536dbb29d45291f61848d8

* Refactored test for file content check to avoid failures

Change-Id: I3b4fe9a0de678f437fd4cc0a8203ae9434d9fa8e

* Removed auto-generated comments

Change-Id: I86c4ac3e7e4476a75d6cbed58826ec1f3278d7d2

* Fixed documentation review comments

Change-Id: I4faf31473b53fc53a5517d418c343bf7320eec55

* Fixed documentation indentation

Change-Id: I386f046cf4e10ee6deb5a81fcfc8c430c97086c8

* Fix build issue

Change-Id: I61a829cabaf03ffd5e77cddc594486a650118fa3
2022-03-09 13:07:23 +01:00
ffeldmann
3e89fb0cd7
fixes retry when sending telemetry to Splunk (#3615)
* Do not retry sending data to Splunk HEC
* Adds error handling
2022-03-08 13:26:00 +01:00
Oliver Nocon
0998a80f07
chore: update to go 1.17 (#3557)
* chore: update to go 1.17

Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>

* update workflows

Co-authored-by: Pavel Busko <pavel.busko@sap.com>

* fixed multipart upload tests

Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>

* go fmt

Co-authored-by: Pavel Busko <pavel.busko@sap.com>

* Update to go 1.17

Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>

* Update vault to v1.9.3

Co-authored-by: Pavel Busko <pavel.busko@sap.com>

Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
Co-authored-by: Pavel Busko <pavel.busko@sap.com>
Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
Co-authored-by: ffeldmann <f.feldmann@sap.com>
2022-03-07 17:15:36 +01:00
Mayur Belur Mohan
9a3b800b9d
ApiKeyValueMapUpload Command (#3407)
* ApiKeyValueMapUpload Command

* include command in metadata

* TestCase Fixes

* CodeReview Fixes

* CodeReview Fixes

* Code Review Fixes

* CodeReview Fixes

* CodeReview Fixes

* CodeReview FIxes

* CodeReview Fixes

* Documenation change

* documentation fix

* Documentation Fix

* Documentation Fix

* documentation Fix

* CodeReview Fixes

* CodeReview Fixes

* Revert changes

* Documentation Fix

* CodeReview FIxes

* Doc Fixes

* Code Review Fixes

* Code Review Fixes

* CodeReview FIxes

* Documentation Fix

* Documentation Changes

* Documentation Fix

* codereview fix

* Documentation Fix

* CodeReview Fixes

* CodeReview Fix

* Documentation FIx

* doc fix

* Doc Fix

* Documentation Fix

* codereview fix

* revert fix

* Code Review Fix

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
2022-03-07 11:03:44 +01:00
ffeldmann
6398e61995
Splunk reporting; Sending messages in batches (#3611)
* Refactors logfile sending logic, renaming of fields, adds proper piper sourcetype
* Sets maximum retries to three and transport timeout to 10 seconds for azure and jenkins
2022-03-07 09:55:12 +01:00
Christian Volk
5821a311cc
chore(npmExecuteScripts): config@2 support (#3607) 2022-03-04 10:26:46 +01:00
Pavel Busko
0de06c6207
feat(cnbBuild): write image digests to the CPE (#3602)
Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
2022-03-02 16:26:45 +01:00
Christian Volk
e49820f5e4
chore(npmExecuteScripts): unit tests (#3597) 2022-03-02 14:06:51 +01:00
Adrien
a73951909b
checkmarxExecuteScan fixes (#3540)
* Fix FilterByTeamName and LoadExistingProject

* Fix project name loop

Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2022-02-28 14:22:47 +01:00
Eugene Kortelyov
8ced7f8184
Feature/fortify execute scan gradle (#3582)
* initial fortify gradle commit

* initial fortify gradle commit

Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-02-28 11:35:38 +01:00
ffeldmann
5f4cd838cf
Updates telemetry logging information for internal reporting (#3585)
* Add StepStartTime, Renames StepDuration, adds PiperCommithash, removes Branch, GitOwner, GitRepository from logged telemetry information

* Fixes test case for telemetry logging

* Activates step monitoring data in debug mode

* Pretty debug json printing

* Reduces log noise, setting warning to debug
2022-02-28 09:45:57 +01:00
Eugene Kortelyov
af7496d012
feat: url log parsing / reporting when executing a command (#3461)
* Initial PR for url reporting

* Rename URLReport var to URLReportFileName

* Remove URLReportFileName from piper flags

* Update pkg/command/command.go

* Update pkg/command/command.go

* Update pkg/command/command.go

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-02-25 15:35:44 +01:00
thtrinh
d86cfce6e6
Checkmarx json report (#3565)
* feat(checkmarx) : Checkmarx JSON Report

* Test cases with some fix

* Information total and audited test assertions

* feat(checkmarx): align total/audited with existing calculation

* fix(checkmarx): Reporting unit test

Co-authored-by: Sumeet PATIL <sumeet.patil@sap.com>
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-02-25 14:20:36 +01:00
Ralf Pannemans
08bfe1554e
feat(cnbBuild) Introducing preserveFiles config to copy back files (#3562)
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
2022-02-23 18:54:59 +01:00
Philipp Stehle
4c18f2a128
feat: Add support for deprecating step parameters (#3554)
this was already used in fortifyExecuteScan, but had no effect.

Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>

Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
2022-02-23 15:16:05 +01:00
Christian Volk
d428cfcbd1
feat(kanikoExecute): image digests (#3566)
* feat(init stage): artifact version

* feat(kaniko): expose image digests to cpe

* fix

* handle tmp folder creation differently

* fix

* fix

* fix tests

* set ignore-path to /
2022-02-23 11:41:26 +01:00
Sven Merk
a1988f6808
feat(whitesourceExecuteScan): GitHub issue creation + SARIF (#3535)
* Add GH issue creation + SARIF

* Code cleanup

* Fix fmt, add debug

* Code enhancements

* Fix

* Added debug info

* Rework UA log scan

* Fix code

* read UA version

* Fix nil reference

* Extraction

* Credentials

* Issue creation

* Error handling

* Fix issue creation

* query escape

* Query escape 2

* Revert

* Test avoid update

* HTTP client

* Add support for custom TLS certs

* Fix code

* Fix code 2

* Fix code 3

* Disable cert check

* Fix auth

* Remove implicit trust

* Skip verification

* Fix

* Fix client

* Fix HTTP auth

* Fix trusted certs

* Trim version

* Code

* Add token

* Added token handling to client

* Fix token

* Cleanup

* Fix token

* Token rework

* Fix code

* Kick out oauth client

* Kick out oauth client

* Transport wrapping

* Token

* Simplification

* Refactor

* Variation

* Check

* Fix

* Debug

* Switch client

* Variation

* Debug

* Switch to cert check

* Add debug

* Parse self

* Cleanup

* Update resources/metadata/whitesourceExecuteScan.yaml

* Add debug

* Expose subjects

* Patch

* Debug

* Debug2

* Debug3

* Fix logging response body

* Cleanup

* Cleanup

* Fix request body logging

* Cleanup import

* Fix import cycle

* Cleanup

* Fix fmt

* Fix NopCloser reference

* Regenerate

* Reintroduce

* Fix test

* Fix tests

* Correction

* Fix error

* Code fix

* Fix tests

* Add tests

* Fix code climate issues

* Code climate

* Code climate again

* Code climate again

* Fix fmt

* Fix fmt 2

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-02-23 09:30:19 +01:00
ffeldmann
ffd4a7efb8
(fix) nil pointer dereference in case credentials are not available (#3564)
* adds return in gcs upload in case error occurs e.g. no credentials, avoid nil pointer dereference

* Adds generated files

* Updates generated files

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-02-22 18:32:09 +01:00
Oliver Nocon
6247c5dddd
feat(buildsettings): golang and future tools (#3561)
Co-authored-by: Christian Volk <christian.volk@sap.com>
2022-02-21 09:16:48 +01:00
Christian Volk
b2246a021f
chore: noise reduction (#3558)
* fix(telemitry): noise reduction

* partially revert
2022-02-18 11:54:39 +01:00
ffeldmann
d7a13aa5d0
Fixes telemetry logging not reporting an error, adds tests (#3551)
* fixes error logging in case fatalError is empty, adds inital test cases for logStepTelemetryData

* Tests logging output
2022-02-17 15:39:01 +01:00
Oliver Nocon
a4a0873081
feat(checkmarx): create GitHub issue with findings (#3543)
* feat(checkmarx): create GitHub issue with findings

* add github issue reporting
2022-02-17 15:16:55 +01:00
Christian Volk
a1cd6cdb3a
fix(kaniko): set cpe consistently (#3545) 2022-02-17 08:20:30 +01:00
Ralf Pannemans
e7db09db12
feat(cnbBuild): added dockerimage to the telemetry data (#3501)
Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>
Co-authored-by: Sumit Kulhadia <sumit.kulhadia@sap.com>
Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
2022-02-16 13:28:51 +01:00
Ralf Pannemans
4b2f61589d
feat(cnbbuild) enable multi image build (#3521)
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
Co-authored-by: Pavel Busko <pavel.busko@sap.com>
Co-authored-by: Sumit Kulhadia <sumit.kulhadia@sap.com>
2022-02-15 14:39:14 +01:00
ffeldmann
19a05a9c70
Reporting: Variable change to deprecate step Splunk Hook; logging in telemetry (#3539)
* Adds fatalError variable with helper setter and getter helper functions
* Adds logging function to telemetry package (always executed)
2022-02-14 08:56:11 +01:00
Daniel Mieg
f08ff92171
New log entities for Pull & Clone (#3517)
* WIP

* New Logs

* Improving

* Determine log output based on available entities

* Increase width

* Add line

* Adapt TestPollEntity

* Format

* Fix query

* Adapt tests

* Fix test

* Improve formatting

* Retern early in case of no logs

* Remove duplicate log
2022-02-11 10:16:40 +01:00
Christian Volk
c888e21e6c
chore(multiarch): helper to parse targetArchitectures (#3525)
* chore(docker): helper to parse targetArchitectures

* missing files
2022-02-10 16:46:00 +01:00
Vitalii Sidorov
93e3801945
feat: add step for Helm execution (#3419)
* Implement helm step

* Create kubernetes package

* Refactoring helm.go

* Add package, test commands

* Add test for helm package

* Add tests for helm.go

* Add tests for helm.go

* Add tests for utils.go

* Add tests for helmExecute.go

* small fix

* Add helm lint

* small fix

* small fix

* Fix according to comments

* Fix test

* small fix

* Add helm add function

* Changes according to new comments

* Add helm push

* Add unit tests

* Add tests for helmExecute

* Add small fix

* small fix

* small fix

* Move DeployUtilsBundle from kubernetesDeploy to kubernetes package

* small fix

* small fix

* Add unit-tests

* Fix

* Update resources/metadata/helmExecute.yaml

* Update resources/metadata/helmExecute.yaml

* Add helm chart server parameterization

* small fix

* small fix

Co-authored-by: “Vitalii <“vitalii.sidorov@sap.com”>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-02-10 10:25:03 +01:00
Christian Volk
5aa9661db6
feat(kanikoExecute): preparation for multi-arch builds (#3515)
* feat(kanikoExecute): preparation for multi-arch builds

* missing files
2022-02-09 10:17:34 +01:00
xgoffin
2cebf370c9
feat(fortifyExecuteScan): added conversion to SARIF for FPR files (#3485)
* feat(FPRtoSARIF): boilerplate & comments

* Feat(Ingest): Build done, Vulnerabilities partway

* feat(Vulnerabilities): now entirely parsed

* feat(Ingestion): handle Description object

* feat(FprToSarif): integration in Piper step, full xml structure

* feat(fpr_to_sarif): base program. Need to replace names in messages

* feat(fpr_to_sarif): message substitution and custom definition integration

* fix(fpr_to_sarif): missing replacement in tools object

* fix(fortifyExecuteScan): unit tests

* fix(fpr_to_sarif): failing unit test

* Fix fortify folder creation for generating sarif

* deletion of unzip folder

* fix(fortifyExecuteScan): change logging to info

* feat(fpr_to_sarif): better unit test

* fix(fpr_to_sarif): pr tests failing

* feat(fpr_to_sarif): add specific properties to sarif

* feat(fpr_to_sarif): severity integration

* fix(fpr_to_sarif): unit test fixed

Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
Co-authored-by: Sumeet PATIL <sumeet.patil@sap.com>
2022-02-08 14:10:40 +01:00
Giridhar Shenoy
286ff1b6ef
detectExecuteScan : support for detect 7 (#3453)
* enable detect 7 script

* unit test uses detect7 as default

* add detect6 test case

* add check for OSEnv detect version

* add test for OSEnv detect version

* update customEnvironmentVariables docu

* fix linting

Co-authored-by: ffeldmann <f.feldmann@sap.com>
2022-02-08 11:55:01 +01:00
rosemarieB
d1eb87363f
Generic step input from addon descriptor (#3467)
* enhance build step to run based on addon.yml in steampunk environment

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>
2022-02-07 20:34:11 +01:00
Matthias Scudlik
907dcd7dc1
fix(sonarExecuteScan): error handling for report metrics (#3512) 2022-02-07 16:41:36 +01:00
ManjunathMS35
8108bb8f6f
Update npmExecuteScripts step (#3211)
* Update npmExecuteScripts step

* Fixed failing build

* Fixed path issue

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
Co-authored-by: Christian Volk <christian.volk@sap.com>
2022-02-07 14:46:03 +01:00
ffeldmann
f3566ab7e0
Changes GetJobName value to repositoryname (#3509) 2022-02-07 08:52:12 +01:00
Oliver Nocon
2ae1d9dac1
feat(kanikoExecute): allow building multiple images (#3443)
* feat(kanikoExecute): allow building multiple images

* enhance tests

* chore: allow running tests in parallel

* small fixes

* fix: fix destination bug

* update formatting and defaults

* fix yml formatting

* chore: change cpe parameter names

* chore: improve variable naming
2022-02-07 07:58:41 +01:00
Christian Volk
54ca265860
fix(httpclient): folder permissions (#3506) 2022-02-04 14:40:18 +01:00
Matthias Scudlik
5eb996c43c
sonarqube coverage: additional metrics (#3465)
* sonarqube coverage: additional metrics

* sonarExecuteScan: add lines of code and language distribution to sonarscan.json

* sonarExecuteScan: consider branch in componentService requests

* SonarQube: Do not omit empty values in SonarCoverage

* sonarExecuteScan: Add integration tests for ComponentService getLinesOfCode

* fix tests

* sonarExecuteScan: use pullRequest in componentService

Co-authored-by: I550025 <r.kloe@sap.com>
Co-authored-by: Marc Bormeth <marc.bormeth@sap.com>
2022-02-04 09:52:29 +01:00
kulhadia
6feb1217aa
Feat(cnbBuild): collecting the telemetry data for cnbBuild (#3368)
Co-authored-by: Sumit Kulhadia <sumit.kulhadia@sap.com>
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>
Co-authored-by: Pavel Busko <pavel.busko@sap.com>
2022-01-31 12:27:29 +01:00
Christian Volk
880be73a4c
feat(golangBuild): support private modules (#3471)
* feat(golangBuild): support private module repositories
2022-01-31 10:45:40 +01:00
Anil Keshav
1a96d7a67e
fix (npmExecuteScripts) allow npm pack before npm publish (#3455)
* adding config to piperNpmr

* scope in cli

* adding scope to repo url and npmrc

* publish to scoped

* removing scope

* changing scope position

* adding scope to userconfig

* adding registry=

* pack and then tar

* not removing tmp folder

* adding flag

* pack before publish

* adding log

* debug

* debug with change directory

* publishing created tar ball

* debug

* üath

* adding main npmrc

* renaming old npmrc file

* error renaming old npmrc file

* renaming err

* correcting npmrc file path

* renaming file back to original

* current working directory

* renaming the npmrc file

* avoiding change directory

* with current working dir

* adding dot

* renaming npmrc and defer removal

* rename files

* Update pkg/npm/publish.go

* Update pkg/npm/publish.go

Co-authored-by: anilkeshav27 <you@example.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-01-25 09:52:22 +01:00
Eugene Kortelyov
da450c5243
feat(gradleExecuteBuild): add stage scope to path parameter, fix project dir exist issue (#3401)
* add stage scope to path parameter, fix project dir exist issue

* fix unit test for gradleExecuteBuild

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-01-24 15:08:39 +01:00
Christopher Fenner
ebcbb73b46
feat: add command to fetch default files (#3445)
* some ideas..

* Add getDefaults command (WIP) (#3444)

* add getYAML function for configs

* create getDefaults command(based on getConfig)

* add getDefaults command to CLI

* read defaults files, using github tokens as well

* write defaults to stdout as JSON object with YAMLs embedded

* catch case where no input files are given

* actually write output to file if outputFile is specified

* mark defaultsFile flag as required

* add basic tests

* add output (string)  test

* adapt generateDefaults() to return output (used for test of previous commit)

* Changes to getDefaults() JSON output (#3449)

* change JSON output to contain separate fields

* filename -> filepath

* Apply suggestions from code review

* Apply suggestions from code review

* Update pkg/config/config_test.go

Co-authored-by: Jordi van Liempt <35920075+jliempt@users.noreply.github.com>
2022-01-24 13:55:28 +01:00
Christopher Fenner
8e0209db74
feat(GitHub): fetch commit statistics (#3381)
* fetch GH statistics

* move GH and Sonar integration tests to own files

* fix imports

* add integration test case

* add result type

* Apply suggestions from code review
2022-01-24 13:43:07 +01:00
Christian Volk
b0e4599d4d
feat(malwareExecuteScan): refactoring and docker support (#3421)
* feat(malwareExecuteScan): add support for scanning docker images

* refactoring

* print out finding if available

* generate toolrecord for malware scan

* persist scan report

* docs

* fix

* fix

* rollback cmd/init_unix.go

* auhenticated pull

* fix

* fix: report shall be consistent with the api model

* gcs upload

* fix linter
2022-01-24 09:48:01 +01:00
Sven Merk
6520115950
Upload Fortify scan results to GitHub issue (#3300)
* fix(fortifyExecuteScan): Propagate translation errors

Force translation related errors to stop the execution of the step.

* Extend testcase

* Update fortifyExecuteScan.go

* Fix fmt and test

* Fix code

* feat(fortifyExecuteScan): Create GitHub issue

* Fix expectation

* Fix fmt

* Fix fmt add test

* Added tests

* Go fmt

* Add switch

* Rewrite githubCreateIssue

* Fix tests

* Added switch

* Issue only in case of violations

* Fix CPE reference

* Add  debug message to issue creation/update

* Update fortifyExecuteScan.go

* Add credential for GH to groovy wrapper

* Update fortifyExecuteScan.go
2022-01-21 10:52:17 +01:00
Raghunath Deshpande
af4bc6e989
Update maxWaitTime timeout for WhiteSource (#3284)
* Update scanPolling.go

Changing maxWaitTime from 15 to 30 to overcome WhiteSource results reflection in the backend issue.

* Update configHelper.go

* Reset configHelper changes to fix PR 3284

 Committer: raghunathd8

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
Co-authored-by: raghunathd8 <root@docker-evaluation.openstack.eu-nl-1.cloud.sap>
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2022-01-20 12:14:00 +01:00
Siarhei Pazdniakou
c93f1f861d
GCS Upload fixes (#3387)
* Fixed argument type in persist function

* Fixed gcp upload to be usable in internal piper

* Fixed import of packages

* Updated logs

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-01-19 13:16:57 +01:00
Umidjon Urunov
c2ebdfd9ec
feat(protecode): add versioning model (#3373)
* changes to detectExec before master merge

* changes for detectExecuteScan

* self generated code added

* fix syntax errors and update docu

* added unit tests for fail and Group

* fix failOn bug

* add Groups as string array

* add Groups as string array

* tests and validation for groups, failOn

* Updated docs and added more tests

* documentation md files should not be changed

* Handle merge conflicts from PR 1845

* fix merge errors

* remove duplicate groups, merge error

* adding buildCode and buildTool as params

* switching build options

* building maven modules

* parameter correction

* parameter correction

* gnerate with new build parameter

* adding comments

* removing piper lib master and modifying goUtils to download 1.5.7 release

* first cleaning then installing

* multi module maven built

* multi module maven built removing unwanted code

* multi module maven built moving inside switch

* testing

* modifying the default use case to also call maven build

* modifying the default use case to also call maven build wih --

* corrected maven build command

* corrected maven build command with %v

* skipping test runs

* testing for MTA project with single pom

* adding absolute path to m2 path

* clean up

* adding switch for mta and maven and removing env from containers

* commiting changes for new detect step

* correting log message

* code clean up

* unit tests changes to detectExecute

* basic tests for new change

* restoring piperGoUtils to download correct piper binary

* code clean up

* code clean up

* protecodeExecuteScan :: versioning model draft - 1

* protecodeExecuteScan :: version model draft-2

* protecodeExecuteScan :: changing filename and version concatenation

* protecodeExecuteScan :: update documentation

* protecodeExecuteScan :: double URL encoding has been corrected & console messaging improved

* protecodeExecuteScan :: fixed Go/generate validation fail

* protecodeExecuteScan :: fixing failed unit tests

* protecodeExecuteScan :: Version field added

* protecodeExecuteScan :: Version field add => minor changes

* protecodeExecuteScan :: Version field add => fixing tests

Co-authored-by: D072410 <giridhar.shenoy@sap.com>
Co-authored-by: Keshav <anil.keshav@sap.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2022-01-19 10:30:59 +01:00
Nikolay Grechanov
17510f8996
fix: correct typo in log message (#3439)
Closes #3438
2022-01-19 08:41:11 +01:00
Ralf Pannemans
c97625e840
feat(cnbBuild) containerImageName will be defaulted if possible (#3437)
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
Co-authored-by: Sumit Kulhadia <sumit.kulhadia@sap.com>
2022-01-14 16:49:45 +01:00
Anil Keshav
04c4460c78
including vaultSecretFile to parameter generator docu (#3436)
Co-authored-by: anilkeshav27 <you@example.com>
2022-01-14 15:03:29 +01:00
Pavel Busko
1750b75cb8
feat(cnbBuild): preserve maven test results in the workspace (#3429)
Co-authored-by: Pavel Busko <pavel.busko@sap.com>
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
2022-01-14 11:05:11 +01:00
Anil Keshav
f3b65ae43b
feat (npmExecuteScripts) create seperate npmrc file for publish to private repo (#3422)
* creating new npm rc file

* publishing to registry staging

* exposing base64 version of env variables

* changing encoding param

* fixing unit test for the new path

* debugging env var

* remove debug message

* update docu

* changing new npmrc file name

* adding new npmrc to ignore

* adding new npmrc to ignore

Co-authored-by: anilkeshav27 <you@example.com>
2022-01-13 13:08:19 +01:00
Daniel Mieg
8634d8bb12
Add easy mode for AUnit & ATC (#3389)
* remove mandatory flag from config files

* Enable repo.yml as config

* Adapt to merge

* Refactoring

* Refactoring

* avoid panic

* Add comments

* Add easy mode for atc

* Add tests

* Add test

* Refactor

* Add test for MPS

* Updates

* Rename functions

* Add files to gitignore

* Rename

* Renaming

* Renaming

* Renaming

* Improve error messages

* Update documentation

* Add logging

* Rename

* Extend gitignore
2022-01-12 12:02:27 +01:00
Marc Bormeth
78c4a8fe93
Revert "feat: Add debug output to getConfig (#3341)" (#3396)
This reverts commit b760bf48e7.

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-01-11 10:47:03 +01:00
Pavel Busko
547ef5b55d
feat(cnbBuild): remove docker config after parsing (#3417)
Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>
2022-01-11 10:01:15 +01:00
Mayur Belur Mohan
f27cb4e482
ApiProxyUpload Command (#3295)
* ApiProxyUpload Command

* Code Review Fixes

* CodeReview Changes

* CodeReview Fixes

* YAML fixes

* CodeReview Fix

* Code Review Fixes

* CodeReview Fixes

* Code Climate Fixes

* Code Review Fixes

* Code Review Fixes

Co-authored-by: Roland Stengel <r.stengel@sap.com>
Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
2021-12-28 09:31:50 +01:00
Pavel Busko
81fa0ee2d8
feat(cnbBuild): support for fetching binding content from url (#3388)
Co-authored-by: I546443 <sumit.kulhadia@sap.com>
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
2021-12-23 10:21:13 +01:00
Eugene Kortelyov
4d787ded6d
gradleExecuteBuild initial commit (#3337)
* gradleExecuteBuild initial commit

* fmt fixes for metadata_generated

* flow updates, some tests were added

* add gradle path alias, add stage scope to task parameter

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-12-22 15:34:36 +01:00
Christopher Fenner
51feacadbf
chore: align Vault naming (#3372)
* Align Vault naming

* remove duplicate debug  output

* correct message

* align vault naming

* Update vault.md
2021-12-21 11:52:10 +01:00
Anil Keshav
3a0e7e3e86
fetch general purpose credentials from vault (#3380)
Co-authored-by: anilkeshav27 <you@example.com>
2021-12-21 11:00:13 +01:00
Anil Keshav
c34b511fdf
correct directory permission (#3378)
Co-authored-by: Your Name <you@example.com>
2021-12-21 07:48:36 +01:00
Daniel Mieg
2bb6c21337
ABAP environment: add tag support (#3376) 2021-12-20 17:58:58 +01:00
Anil Keshav
fdeffa6ebf
fix (dockerConfigJson) : create directory path before writing to file (#3375)
* creating directory path

* error message correction

Co-authored-by: Your Name <you@example.com>
2021-12-20 17:15:13 +01:00
Oliver Nocon
bad3331597
doc: fix rendering of stage overview (#3371) 2021-12-17 08:45:21 +01:00
Christopher Fenner
9180f54f86
feat(sonar): reuse existing TLS truststore (#3312)
* do not load sap certificates with groovy

* add toggle

* add keytool package

* copy existing default truststore

* ignore import failure

* fix typo

* rename

* extract maven opts

* add todo

* add tests

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-12-16 12:49:15 +01:00
Siarhei Pazdniakou
91ddbf9152
fix(sonar): disable gcp upload when not configured (#3369) 2021-12-15 16:25:46 +01:00
Siarhei Pazdniakou
cd243ee542
feat(gcs): allow upload to gcs from steps (#3034)
* Upload reports to Google Cloud Storage bucket

* Added tests. Made fixes

* Update step generation. GCS client was moved to GeneralConfig

* Code was refactored

* Fixed issues

* Fixed issues

* Code correction due to PR comments

* Improved gcs client and integration tests

* Integrated gcp config. Updated step metadata

* Fixed issues. Added tests

* Added cpe, vault, aliases resolving for reporting parameters

* Added tests

* Uncommented DeferExitHandler. Removed useless comments

* fixed cloning of config

* Added comments for exported functions. Removed unused mock

* minor fix

* Implemented setting of report name via paramRef

* some refactoring. Writing tests

* Update pkg/config/reporting.go

* Update cmd/sonarExecuteScan_generated.go

* Apply suggestions from code review

* Update pkg/config/reporting.go

* Update pkg/config/reporting.go

* fixed removing valut secret files

* Update pkg/config/reporting.go

* restore order

* restore order

* Apply suggestions from code review

* go generate

* fixed tests

* Update resources/metadata/sonarExecuteScan.yaml

* Update resources.go

* Fixed tests. Code was regenerated

* changed somewhere gcp to gcs. Fixed one test

* move gcsSubFolder to input parameters

* fixed removing valut secret files

* minor fix in integration tests

* fix integration tests

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2021-12-15 15:07:47 +01:00
Christopher Fenner
b7e1d28675
fix: prevent endless loop in exit handler (#3363)
* do not fatal in exit handler

* update generated sources

* update golden sources

* update generated sources
2021-12-15 14:26:23 +01:00
Siarhei Pazdniakou
0879fa591a
fix(influx): fix generated output parameters (#3362)
* fixed generated output parameters for influx

* change name to lower case

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2021-12-15 09:40:50 +01:00
Oliver Nocon
cf8dad1edd
doc: fix generation of empty stages (#3354) 2021-12-13 13:05:07 +01:00
Oliver Nocon
cddbdf2ce2
doc: improve stage documentation (#3343)
* remove unnecessary sections in case stage does not contain steps (e.g. confirm stage)
* improve readibiliy of condition section
* fix naming
2021-12-13 11:35:41 +01:00
rosemarieB
e6c5c8a72f
Abap refactoring (#3340)
* Update abapAddonAssemblyKitReleasePackages.go

* add error handling for initAAKaaS

* runtime to config, url.QueryEscape, check return body

* Update abapAddonAssemblyKitCheckCVs_test.go

* add log entrys for testing

* correct yaml

* change unmarshal logic

* Update abapAddonAssemblyKitCheckPV_test.go

* adding utils functionality

* Update bfw_test.go

* reset CheckPV

* reset CheckCVs

* reset ReserveNextPackages

* set back CheckPV and CheckCVs

* moving mock

* renaming

* renaming

* moving mocking to checkCVs test

* fixing unittests

* trying mock with comment

* referencing unittest to mockfile

* Update abapAddonAssemblyKitCheckCVs.go

* Update cmd/abapAddonAssemblyKitCheckPV.go

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>

* Update cmd/abapAddonAssemblyKitReleasePackages.go

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>

* Update cmd/abapAddonAssemblyKitPublishTargetVector.go

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>

* Update cmd/abapAddonAssemblyKitReserveNextPackages.go

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>

* fixing unittests

* fixing mock comment

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>
2021-12-09 12:54:18 +01:00
Marc Bormeth
b760bf48e7
feat: Add debug output to getConfig (#3341)
* Fix Orchestrator detection

* Add unit tests

* Add debug output to getConfig

* Update getConfig.go

* fix whitespaces

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2021-12-08 10:16:54 +01:00
Marc Bormeth
b213af1089
Add Coverage Info to sonarscan.json (#3262)
* Add coverage metrics to report + influx

* Write unit tests

* Add integration test for Sonar Measures Component Service
2021-12-08 09:02:12 +01:00
Pavel Busko
79f7ccd0f5
feat(cnbBuild): increased platform api compatibility (#3330)
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
Co-authored-by: Benjamin Haegenlaeuer <benjamin.haegenlaeuer@sap.com>
2021-12-07 14:06:35 +01:00
kingvvgo
292b1eb7e2
Fix for buildSetting file (#3325)
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-12-06 14:50:22 +01:00
rosemarieB
e90856d5bf
Generic build step (#3323)
* new step abapEnvironmentBuild

* Update piper.go

* Update abapEnvironmentBuild.go

* update yaml file

* Logging for debugging

* Update abaputils.go

* Update connector.go

* assigning connector

* delete debugging logging

* Update abapEnvironmentBuild.go

* certificate to yaml

* Update abapEnvironmentBuild.go

* add scope

* Update abapEnvironmentBuild.go

* Update abapEnvironmentBuild.yaml

* change certificate name in yaml

* test my new gitscript

* logging for debugging

* debugging...

* adding options to client.

* skip verification

* debugging

* debugging...

* switch of transportskipverification

* changing connector return

* deleting additional set options

* fixed timeout error

* adding certificate

* testing without certificate set

* testing with certificate set

* download, publish and value logic

* write values to cpe

* logging

* adding condition on string length

* change publishmethod and some logging

* change download method -> using references

* evaluation of parameter for download

* add case for empty string

* adding unittests

* Update mockClient.go

* make abapEnvironmentBuildUtilsBundle powerful

* refactor abapEnvironmentBuild into pieces

* check error message

* check error message 2

* check error message 3

* check error message 4

* remove check error message

* cleanup

* adding unittests

* unittests and docu

* docu

* docu

* Update abapEnvironmentBuild.md

* removing trailing spaces and adding empty lines in docu

* Update abapEnvironmentBuild.md

* fixing unittest and PR recommen

* Update abapEnvironmentPipelineStageBuild.groovy

* Update abapEnvironmentPipelineStageBuild.groovy

* Update abapEnvironmentPipelineStageBuild.groovy

* Update abapEnvironmentPipelineStageBuild.groovy

* changes derived from pull request

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>
2021-12-06 14:43:37 +01:00
kingvvgo
b29a2f2264
Add Changes for value of docker image (#3303)
* Add Changes for value of docker image

* Get docker image value

* Fix

* Fix unit

* Add chnages for kaniko and mta builds

* Fix

* Test changes

* Test

* Move func ResolveMetadata to stepmeta.go

* Fix

* Change getConfig.go

* Fix getting docker value for mta, npm and kaniko

* Fix according to suggestions

* Add func to get only value of docker image

* Test empty value of docker image

* Fix for getDockerImageValue

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-12-01 07:46:18 +01:00
Pavel Busko
ac09e6e4aa
feat(cnbBuild): refactored buildEnvVars input property, added resourceRef to the buildpacks (#3310)
Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
2021-11-29 11:32:32 +01:00
ffeldmann
d9e30418bc
feat: pipeline reporting, adds logging information to fatal hook and splunk hook (#3308)
* Removes unecessary fields from telemetry, restructuring splunk pkg

* Removes t.skip() and reactivates integration test

* Adjusts tests for fatalHook and helper functions, including log test

* Moves pipelinetelemetry to inner source, removes pipelineTelemetry from telemetry pkg, using generic map[string]interface for splunk

* Removes Read JSON from fatalHook -> moves to inner source

* Removed log output test

* go fmt

* log step telemetry data send to splunk

* Adjusts error logging

* Adds log information in case api information could not be retrieved

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-26 16:11:44 +01:00
Christopher Fenner
950f4287c2
fix: correct env var name for git branch for Jenkins orchestrator implementation (#3311)
* fix: correct env var name for git branch for Jenkins orchestrator implementation

* fix test case
2021-11-26 12:08:22 +01:00
Roland Stengel
6320275f47
Step Parameter Alias deprecate key is ignored (#3158)
* Step Parameter Alias deprecate key is ignored
2021-11-23 15:37:28 +01:00
Eugene Kortelyov
d395b362ed
feat: step to execute shell scripts (#3196)
* shell executor initial commit

* functionality updates

* changes in logging implementation (using internal logging), changes in execution

* remove unused field

* remove duplicate from code

* update vault flow and remove unnecessary params

* update generated step file

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-19 10:05:39 +01:00
ffeldmann
42b92d1bfe
Changes for Pipeline Reporting (#3213)
* Adds GetLog() function to orchestrator

* Fixes BUILD_NUMBER env variable

* Fixes correct env var for JENKINS_HOME

* Adds getEnv to read env variables with default value, adds test for jenkins GetLog() implementation

* Adds possibility to read errorJsons; updates splunk package for log files (WIP)

* Uncommenting dev code

* Adds GetLog() function to orchestrator

* Fixes BUILD_NUMBER env variable

* Fixes correct env var for JENKINS_HOME

* Adds getEnv to read env variables with default value, adds test for jenkins GetLog() implementation

* Adds possibility to read errorJsons; updates splunk package for log files (WIP)

* Uncommenting dev code

* Adds GetRequest function which holds the response in memory (not saved to disk)

* Implements GetLog() function for ADO, adds function to read PipelineRuntime

* PAT has been revoked

* Changes http package, s.t. if password only is required basic auth works too

* Adds env variable for azure token, error handling in case of unauthenticated/nil response

* Adds logging output in case env variable can not be read and fallback variable needs to be used

* Adds usage of environment variables for auth, uses jenkins api

* Adds init functionality for orchestrators, updates GetLog() and GetPipelineStartTime() function

* Adds initaliziation function for orchestrator authetnication

* Adds settings struct for orchestrator authentication

* Adds function to whole logfile to Splunk

* Struct for pipeline related telemetry information

* Increase messagebatch size to 10k

* Changes splunk package to a pointer based implementation, updates generated files and corresponding template and tests for splunk

* Changes telemetry package to pointer based implementation to have multiple telemetry objects, adjusted tests and splunk implementation

* Changes content type to txt

* Send telemetry independent of logfiles, increases amount of messages per file

* Adds JobURL for orchestrators and UnknownOrchestrator as fallback

* telemetry makes use of orchestrator specific information

* Adds orchestrator independent correlationID

* Adds custom fields for pipeline status

* go fmt

* Removes env var test - no env variables are read anymore

* Use UnknownOrchestratorConfigProvider in case the orchestrator can not be initalized

* Removes Custom fields from telemetry as these can not be reflected in SWA

* Adds custom telemetry information (piperHash,..) to each step telemetry information

* Removes falltrough in case no orchestrator has been found

* Updates tests for orchestrator package

* Adds orchestrator import in generated files

* Updates generator files for internal library

* Adds orchestrator telemetry information to steps

* Updates generated files, fatalHook writes to cpe

* Go generate from master, go fmt

* Adds Custom Data field LastErrorCode

* Removes GetLog() test

* Update init_unix.go

* Update docker_integration_test_executor.go

* Update integration_api_cli_test.go

* Reverts go1.17 fmt formatting

* Reverts go1.17 fmt formatting

* Reverts go1.17 fmt formatting

* Renames customTelemetryData to stepTelemetryData

* Adjustments to orchestrator-package, cleanup, adds JobName

* Adjusts commonPipelineEnvironment path

* Adds pipelineTelemetry struct to telemetry package, removes pipeline telemetry structs from splunk package

* Go fmt

* Changes path for errorDetails, adds debug information

* Removes custom fields from step, adds orchestrator, commithash to baseMetadata

* Adjusts tests for telemetry package

* Adds tests for orchestrator

* Updates generated files, initalization of splunk client only if its available in the config

* Fixes typo in helper go

* Update pkg/http/downloader.go

* Update pkg/http/downloader.go

* Update pkg/log/fatalHook.go

* Update fatalHook.go

* Update pkg/splunk/splunk.go

* Update pkg/telemetry/data.go

* Adds GetBuildStatus() and GetAPIInformation() to orchestrators

* error formatting

* Bugfix: dont send telemetry data if disabled, adjusts test

* go fmt

* Use correct error handling

* Update pkg/telemetry/telemetry.go

* Fixes telemetry disabled in the tests

* Fixes http tests

* Log fatal errors to logFile

* Adds CustomReportingConfig to hooks

* Cleanup comments in splunk package

* Adds possibility to send telemetry to custom endpoint

* Adds debug output for the payload

* Debug output for the payload as a string

* Adds test cases for changes in telemetry package

* go fmt

* Adds generated files for new step

* Reverts changes for http tests, causing problems with go1.15, changes need to be applied for newer go version >=1.17

* Adjusts test for sonarExecuteScan

* Adjusts test for sonarExecuteScan

* Adds explanation for customreportingConfig

* Makes disableing of customSend more obvious

* Adds custom step reporting to each step, updates generated files, adjusts helper testdata

* fixes unit test wrong usage of logging

* Send pipeline data altough there has been no error, adjust test cases

* Reverts changes for customReporting

* Updates generated files, removes customReporting

* Removes writing errorDetails to CPE

* Reverts usage of customreporting

* go fmt

* reverts changes in http_test

* reverts changes in http_test

* Skips integration cnb test

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-18 17:50:03 +01:00
Oliver Nocon
6c5434f957
feat(checkIfStepActive): support new CRD style conditions (#3254)
* feat: first parts of new run struct

* add parts for new stage condition handling

* update conditions

* feat: finalize conditions and tests

* feat(checkIfStepActive): support new CRD style conditions

* feat(docs): allow generating stage docs

* chore(docs): make step directory configurable

* fix: tests

* add option to output file

* Update checkIfStepActive_test.go
2021-11-18 07:24:00 +01:00
Anil Keshav
a92dd234b1
feat (buildSettingsInfo) new common cpe which holds build settings json value (#3272)
* create build settings for maven

* cases for when mavenBuild may be present

* fixing unit test for mavenBuild to include cpe

* changing position of buildSettngsJson to be called atfter build runs

* package

* extending the struct for other build types

* adding values for mta build settings

* changing config data type

* adding npm build settings

* unit tests

* fix trailing space

* typo correction in yaml

* Vitalii/build settings info (#3277)

* Add buildsettings package

* Improve buildSetting package for mta, npm

* Add unit-test

* Fix

* Fix

Co-authored-by: Vitalii Sidorov <vitalii.sidorov@sap.com>

* review changes

* removing buildTool param

* changing npm script name

* fix npmExecute tests

* including build settings info in npm struct

Co-authored-by: Your Name <you@example.com>
Co-authored-by: kingvvgo <56587879+kingvvgo@users.noreply.github.com>
Co-authored-by: Vitalii Sidorov <vitalii.sidorov@sap.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-16 15:02:57 +01:00
Philipp Stehle
f9f0cbfd33
enforce that step metadata yaml file is called <step>.yaml (#3226)
Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>
2021-11-15 14:20:20 +01:00
Mayur Belur Mohan
d3b090e63e
ApiKeyValueMapDownload Command (#3245)
* ApiKeyValueMapDownload Command

* CodeReview Fixes
2021-11-15 13:48:14 +01:00
Siarhei Pazdniakou
e97242b7e7
Fixed validation for possibleValues option (#3228)
* Fixed validation for possibleValues option

* Change oneof-custom to possible-values

* go generate

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-15 12:06:48 +01:00
Pavel Busko
a748c533a2
fix(cnbBuild): use relative path for filtering files (#3278)
Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>
2021-11-12 15:31:54 +01:00
tiloKo
54479f7255
abapAddonAssemblyKitPublishTargetVector polling + refactoring (#3271)
* new checks for commitIDs

* new checks for commitIDs

* relocate step from build stage to initial checks + refac

* log list

* fix log + check

* log format

* fix unit tests

* targetVector refac + polling

* refac

* refac 2

* polling

* remove debug output

* remove debug output

Co-authored-by: Christian Luttenberger <42861202+bluesbrother84@users.noreply.github.com>
2021-11-12 14:33:18 +01:00
tiloKo
f1a5b6a918
abapAddonAssemblyKitReserveNextPackages additional checks & move stage (#3247)
* new checks for commitIDs

* new checks for commitIDs

* relocate step from build stage to initial checks + refac

* log list

* fix log + check

* log format

* fix unit tests

Co-authored-by: Christian Luttenberger <42861202+bluesbrother84@users.noreply.github.com>
2021-11-04 22:04:00 +01:00
Christian Volk
90d5ab7ca2
feat(terraformExecute): pass tf outputs to cpe (#3241)
* feat(terraformExecute): pass tf outputs to cpe

* cleanup

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-04 10:28:41 +01:00
Oliver Nocon
31cd2df1bd
chore(docker): add re-use functionality for config.json (#3244)
* feat: func for Docker config.json

Provide re-use function to create/update Docker conifg.json

* add comment

* update WhiteSource step

* fixes and additional tests

* Delete whitesourceExecuteScan.go

* revert whitersource changes

* chore: update formatting

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2021-11-04 10:19:33 +01:00
Anil Keshav
da1327ab9a
feat (cpe) ability to write an empty string to an existing cpe string value (#3243)
* empty cpe values from disk and cpe map on condition

* changing log level

* changing log level from info to edbug

* changing empty logic for empty string

* adding toBeEmptied condition

Co-authored-by: Your Name <you@example.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-11-04 10:02:33 +01:00
Philipp Stehle
0f3b48aaec
feat(cnbBuild): support for paketo bindings (#3236)
* [WIP] bindings support for cnbBuild step

Co-authored-by: Pavel Busko <pavel.busko@sap.com>

* add unit tests

Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>

* switch to mapstruct for more meaningful errors

Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>

* add integration test for bindings

Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>

* Add documentation for cnbBuild.bindings

Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>

* fixed unit tests

Co-authored-by: Pavel Busko <pavel.busko@sap.com>

* apply codeclimate suggestions

Co-authored-by: Philipp Stehle <philipp.stehle@sap.com>

* renamed field "secret" to "key"

Co-authored-by: Pavel Busko <pavel.busko@sap.com>

Co-authored-by: Pavel Busko <pavel.busko@sap.com>
2021-11-03 12:37:26 +01:00
ffeldmann
37853bc569
Whitesource unified agent download resilience (#3230)
* Adds retry for whitesource download in case of 404 not found

* Adds retry mechanism for 'forbidden errors' which occasional happen when downloading the unified agent

Co-authored-by: tiloKo <70266685+tiloKo@users.noreply.github.com>
2021-11-02 15:10:04 +01:00
tiloKo
9464b345d0
abapEnvironmentAssemblePackages store file in workspace instead of cpe (#3232)
* initial refac

* fix unit test, no publish

* fix typo
2021-11-02 11:00:01 +01:00
Mayur Belur Mohan
3ee4339af1
ApiProxyDownload Command (#3197)
* ApiProxyDownload Command

* Lint Fixes

* Lint Fixes

* codereview fixes

* Code Review Fixes

* CodeReview Fixes

* CodeReview Fixes

* Code Review Fixes

* Code Review Changes

* CodeReview Fixes

* CodeReview Fixes

* CodeReview Fix

* CodeReview Fixes

* CodeReviw Fixes

* CodeReview Changes

* CodeReview Fixes

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
2021-11-02 10:30:08 +01:00
sumeet patil
732845507d
Fortify JSON Report (#3212)
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2021-10-29 10:03:01 +02:00
tiloKo
a0ad624b9a
RobustConfirm (#3179)
confirm no longer done based on package status but now based on boolean indicator which is set during assembly step.
Thus confirm can now be placed after release packages.
2021-10-28 11:01:16 +02:00
Umidjon Urunov
53225b958f
protecodeExecuteScan -> file upload has been extended for "binary" uploads (#3156)
* changes to detectExec before master merge

* changes for detectExecuteScan

* self generated code added

* fix syntax errors and update docu

* added unit tests for fail and Group

* fix failOn bug

* add Groups as string array

* add Groups as string array

* tests and validation for groups, failOn

* Updated docs and added more tests

* documentation md files should not be changed

* Handle merge conflicts from PR 1845

* fix merge errors

* remove duplicate groups, merge error

* adding buildCode and buildTool as params

* switching build options

* building maven modules

* parameter correction

* parameter correction

* gnerate with new build parameter

* adding comments

* removing piper lib master and modifying goUtils to download 1.5.7 release

* first cleaning then installing

* multi module maven built

* multi module maven built removing unwanted code

* multi module maven built moving inside switch

* testing

* modifying the default use case to also call maven build

* modifying the default use case to also call maven build wih --

* corrected maven build command

* corrected maven build command with %v

* skipping test runs

* testing for MTA project with single pom

* adding absolute path to m2 path

* clean up

* adding switch for mta and maven and removing env from containers

* commiting changes for new detect step

* correting log message

* code clean up

* unit tests changes to detectExecute

* basic tests for new change

* restoring piperGoUtils to download correct piper binary

* code clean up

* code clean up

* protecodeExecuteScan :: fixing file upload for binaries

* protecodeExecuteScan :: fixing protecode generate file

* Fix upload test

* protecodeExecuteScan -> fixing tests

Co-authored-by: D072410 <giridhar.shenoy@sap.com>
Co-authored-by: Keshav <anil.keshav@sap.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2021-10-21 10:03:42 +02:00
Sven Merk
f655033442
Add retry capability on sporadic WhiteSource error 3000 (#3183)
* fix backslash mess

* Added retry on error 3000

* Fix fmt

* Fix check on error message
2021-10-21 09:37:41 +02:00
Anil Keshav
b1b19dcace
feat (FileUtils) support for untar in fileutils (#3154)
* support for untar in fileutils

* handeling strip component level like tar cli

Co-authored-by: Your Name <you@example.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
Co-authored-by: Thorsten Duda <thorsten.duda@sap.com>
2021-10-20 14:10:39 +02:00
Oliver Nocon
db6b465ff1
chore(doc): conditionally mandatory parameters (#3172)
enhance documentation generation to properly reflect
parameters which are conditionally mandatory.
2021-10-12 12:49:38 +02:00
Oliver Nocon
ba694b6737
fix(doc) proper tab creation for step docs (#3169) 2021-10-11 16:51:54 +02:00
Oliver Nocon
60a114d738
chore(docs): improve step documentation (#3162)
* chore(docs): improve step documentation

* chore: fix test

* chore: add note box

* use latest mkdocs imgage

* add extensions and fix config
2021-10-11 15:22:24 +02:00
Pavel Busko
8a6c0b907f
use jarcoal/httpmock for http calls instead of mock server (#3165)
Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
2021-10-11 11:33:51 +02:00
Pavel Busko
372cef04b4
feat(cnbBuild): added support for project.toml (#3163)
Co-authored-by: Sumit Kulhadia <sumit.kulhadia@sap.com>
Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
2021-10-11 11:10:21 +02:00
Johannes Dillmann
6f13d6078d
Update whitesource go module settings (#3135) 2021-10-06 12:36:05 +02:00
Pavel Busko
2fb2843a2a
fix(generator): use quote template function instead of direct quotes (#3146) 2021-10-05 00:24:26 +02:00
Philipp Stehle
eae9912d50
docs(cnbBuild): replace dead link with own description for dockerConfigJsonCredentialsId (#3137)
* docs(cnbBuild): replace dead link with own description for dockerConfigJsonCredentialsId

* fix: generator does not properly quote descriptions
2021-10-01 14:24:59 +02:00
Johannes Dillmann
4f23507bb7
Support custom tls certs in cnbBuild (#3103)
Co-authored-by: Johannes Dillmann <j.dillmann@sap.com>
Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
Co-authored-by: Pavel Busko <pavel.busko@sap.com>
2021-10-01 13:48:24 +02:00
Pavel Busko
ae8ec77f98
fix(cnbBuild): put all custom buildpacks under single order entry (#3141) 2021-10-01 13:30:06 +02:00
Siarhei Pazdniakou
46bafc40a3
Improve validation of configuration (#3125)
* Implemented validation for the option possibleValues

* Has been added the option mandatoryIf to config with validation

* Fixed issues found during code review

* improved golang template

* Fixed tests. Added validation for mandatoryIf option

* Fix typo

* Fixed tests

* Validation was refactored. Added options

* Added default value for parameters with possibleValues option

* Validation was moved after the configuration resolution

* Canceled some default values

Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-10-01 12:49:05 +02:00
Pavel Busko
4f5efc88d7
cnbBuild: use DockerCredentials secret during custom buildpacks download (#3138) 2021-10-01 10:05:15 +02:00
Pavel Busko
87162284e7
cnbBuild: buildEnvVars argument for setting custom build env vars (#3136) 2021-09-29 18:21:13 +02:00
Christopher Fenner
4525c1daa4
fix: use orchestrator specific stage name (#3127)
* extend orchestator to provide stage name

* use orchestrator specific stage name

* fix test case

* remove comment

* fix test case

* prettify

* change something..

* do not exit

* Update pkg/orchestrator/azureDevOps.go

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-09-29 08:31:45 +02:00
Anil Keshav
0978f1492a
(feat) mtaBuild publish mtar artifacts to remote remote repo (#3104)
* mta build config

* http request to upload mtar

* adding basic auth

* using put

* test file name

* hard coding the mta org and artifact is

* new version

* new version

* mtar group

* errors

* better error message

* log info

* log info

* correct mtar artifact name

* adding teh correct name

* test

* name changes

* clean up

* changing mtarVersion to version

* changing artifact name

* forcing release build

* forcing release build

* force profile

* force profile

* force profile

* force profile

* force profile

* force profile

* force profile

* force profile update

* force profile update

* profile update

* debug

* debug

* debug

* debug

* rewrite xml update

* rewrite xml update

* unmarshal solution

* unmarshal solution

* unmarshal solution

* unmarshal solution

* unmarshal solution

* unmarshal solution

* unmarshal solution

* unmarshal solution

* unmarshal solution

* outputin publish repo url

* removing fetch coordinates condition

* checking settings xml

* fixing artifact id cpe

* release artifact, package and group to cpe

* including versioning type as a cpe

* creating new settings xml file

* creating parent folder

* creating parent folder

* creating parent folder

* creating parent folder

* creating parent folder

* creating parent folder

* creating parent folder

* creating parent folder

* creating parent folder

* creating parent folder

* changing to project settings

* function name change

* using glbl settings xml

* modiying the npm settings

* modiying the npm settings

* modiying the npm settings

* modiying the npm settings

* using file path join for m2 settings file

* generator

* unit tests

* hardening error message

* removing versioningType

* removing versioningType

* new vault profile paths

* error message improvement

* unit test fixes

Co-authored-by: Your Name <you@example.com>
2021-09-23 15:33:30 +02:00
Daniel Mieg
e9b3e79f3a
Change loglevel to debug (#3107) 2021-09-23 10:05:44 +02:00
Eugene Kortelyov
56be54c504
Feature/vault refactoring (#3113)
* refactor vault code

* adjust generator

* wip: fix tests

* regenerate influxdb

* fix test

* add another test

* fix test & docs

* fix formatting

* Minorupdate and fixes

Co-authored-by: Kevin Stiehl <kevin.stiehl@numericas.de>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-09-21 13:06:32 +02:00
Sven Merk
86e8125279
feat(checkmarxExecuteScan): Improve cx report (#2991)
* Improve checkmarx report

* Fix test and fmt

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-09-15 09:45:56 +02:00
Pavel Busko
cba94dcb35
Cnb build custom buildpacks (#3090)
* [WIP] cnbBuild custom buildpacks draft

Co-authored-by: Pavel Busko <pavel.busko@sap.com>

* Store custom buildpacks in the dedicated tmp folder

Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>

* added test

Co-authored-by: Pavel Busko <pavel.busko@sap.com>

* updated documentation

Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>

* use Files for toml files cleanup

Co-authored-by: Pavel Busko <pavel.busko@sap.com>

* Add missing function to the FileUtils interface

Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>

Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com>
2021-09-14 16:14:50 +02:00
Umidjon Urunov
3d341b4b24
protecodeExecuteScan -> adding replace binary option (#2778)
* protecodeExecuteScan -> [draft-1] adding replace binary option

* protecodeExecuteScan -> replace binary option extension

* protecodeExecuteStep :: fixing generete & format checks

* protecodeExecuteStep :: fixing TestUploadScanFileSuccess & clean up debug printings

* Update protecodeExecuteScan_test.go

* protecodeExecuteScan :: removing duplicate test cases

Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2021-09-13 11:13:48 +02:00
larsbrueckner
ab396ce6f3
toolrecord: fix web ui URLs for whitesource, close #6 (#3096) 2021-09-10 13:20:54 +02:00
larsbrueckner
45cb97c8d9
pkg/toolrecord: log json marshalling errors; fix issues in whitesource and blackduck (#3049)
* pkg/toolrecord: log json marshalling errors

* toolrecord package: add internal check to ensure that generated files
are not empty

* cmd/whitesourceExecuteScan.go : rework createToolRecordWhitesource to
include all scanned projects

* pkg/toolrecord: new helper function to override default display values

* cmd/whitesourceExecuteScan: improve toolrecord file

* cmd/detectExecuteScan.go fix toolrecord file creation #3

* pkg/toolrecord: log json marshalling errors

* toolrecord package: add internal check to ensure that generated files
are not empty

* cmd/whitesourceExecuteScan.go : rework createToolRecordWhitesource to
include all scanned projects

* pkg/toolrecord: new helper function to override default display values

* cmd/whitesourceExecuteScan: improve toolrecord file

* fix merge conflict
2021-09-09 10:50:33 +02:00
Siarhei Pazdniakou
d8d533b154
ADO - Vault Secret Rotation (#3084)
* Implemented vault secret rotation for ADO

* Added tests

* Fixed issues
2021-09-08 16:48:12 +02:00
Giridhar Shenoy
b92e7f699c
detectExecuteScan : Policy reports in HTML, JSON and for cumulus (#3057)
* add policy status reports

* add policy status and cumulus json

* update projectver link + test

Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2021-09-07 17:17:03 +02:00
Sven Merk
89124801c6
fortifyExecuteScan: Fix overall report status (#3081)
* fortifyExecuteScan: Fix overall report status

* Update reporting.go
2021-09-01 14:07:12 +02:00
ffeldmann
380f1fbfec
Adds retry for whitesource download in case of 404 not found (#3063)
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-08-19 14:49:24 +02:00
Anil Keshav
d29ba346f2
[feat] https communication enhancement : Eliminate skip tls skip verify in the piper http client (#3062)
* modify wrapper http to hold ca rot

* modifying the http client for maven build

* adding checks

* eliminating seperate jks

* test tls true

* insecure flag remove

* error debug

* storing cert

* sap root cert

* error

* only child cert

* test

* maven test

* moving outside loop

* changing pointer

* dont download existing certs

* typo fix

* removing mavenBuild test

* code clean up

* making hadolint using always cert true

* custom tls link for hadolint trust

* error handel

* extended condition for modifying custom tls

* unit test case

* checing when to add the customLinks

* not breaking existing hadolint client config

Co-authored-by: Your Name <you@example.com>
2021-08-19 11:29:33 +02:00
Oliver Nocon
37cea1b998
chore(docker): do not swallow error (#3056) 2021-08-17 15:52:18 +02:00
Oliver Nocon
5096b3bfe1
fix(checkIfStepActive): respect explicit (de-)activation (#3055) 2021-08-17 11:20:04 +02:00
Mayur Belur Mohan
2d412d9f3c
IntegrationArtifactResource Command (#3027)
* IntegrationArtifactResource Command

* Remove unused code

* Formatting fix

* formatting fix

* formatting fix

* formatting fix

* formatting fix

* CodeReview Fixes

* Code Review Fix

* Code Review Fixes

* Code Review Fixes

* Format fix

* format fix

* format fix

* format fix

* Code Review Fix

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
2021-08-12 09:11:02 +02:00
Oliver Nocon
97b84429f1
feat(Vault): custom prefix for test credentials (#3043)
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2021-08-11 16:20:08 +02:00
Anil Keshav
c66c868d7c
remove schema parameter from cycloneDX for npm build (#3038)
Co-authored-by: Your Name <you@example.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-08-10 16:22:13 +02:00
Daniel Mieg
9c76b89fb8
Add telemetry for abapEnvironment steps (#3016)
* Remove explicit telemetry from signature

* Set log level

* ATC set error category
2021-08-04 17:31:16 +02:00
Oliver Nocon
f308fbfc0d
feat(getConfig) allow reading stage configuration (#3026)
* feat(getConfig) allow reading stage configuration

* update test

* use fix version of Selenium Image for Karma tests
2021-08-04 10:09:02 +02:00
Mayur Belur Mohan
c283b9319d
IntegrationArtifactUnDeploy Command (#3018)
* IntegrationArtifactUnDeploy Command

* formatting fix

* Code Review Fixex

* Code Review Fixes

* remove unused code

* Formating fixes

* formatting fixes

* formatting fix

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
2021-08-02 16:27:16 +02:00
Oliver Nocon
6f32b437be
fix(dockerOptions) allow proper usage of empty values (#3025)
This follows up on #3024
Setting emptyValue to s.th. like `--entrypoint=''` will break in case the argument is properly escaped.

Docker will return with
`container process caused: exec: "''": executable file not found in $PATH`
2021-08-02 14:57:37 +02:00
Giridhar Shenoy
4aa59dbdcb
Move BlackDuck API helper to OS version (#3008)
* feat(detectExecuteScan): generate ip result json

json will currently only be created in success cases.

No information about policy violation details available in the step yet.

* update report name

* Update cmd/detectExecuteScan.go

Co-authored-by: Giridhar Shenoy <giridhar.shenoy@sap.com>

* Update cmd/detectExecuteScan.go

Co-authored-by: Giridhar Shenoy <giridhar.shenoy@sap.com>

* Update cmd/detectExecuteScan_test.go

Co-authored-by: Giridhar Shenoy <giridhar.shenoy@sap.com>

* Update cmd/detectExecuteScan_test.go

Co-authored-by: Giridhar Shenoy <giridhar.shenoy@sap.com>

* move blackduck api package

* fix broken unit test

* added tests for new api calls

Co-authored-by: OliverNocon <oliver.nocon@sap.com>
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-08-02 11:18:58 +02:00
Oliver Nocon
f455a8a4a0
fix(dockerOptions) properly pass empty values (#3024)
it is possible to overwrite the entrypoint for docker execution:
https://docs.docker.com/engine/reference/run/#entrypoint-default-command-to-execute-at-runtime

This is ideally done by passing `entrypoint=''` and not pass two options to the call.
This also helps with escaping issues of the empty value on other systems.

Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2021-08-02 10:21:14 +02:00
Martin Zuber
aa50cfb78d
Improve determining PR key in Azure DevOps provider. (#3007) 2021-08-02 10:08:33 +02:00
Mayur Belur Mohan
2f2fd84193
GetIntegrationArtifactMPLError function (#3000)
* GetIntegrationArtifactMPLError function

* formating fixes

* formating fixes

* formatting fixes

* formatting fixes

* Formatting fixes

* formatting fixes

* Code Review Fixes

* Code Review Fixes

* Code Review Fixes

* Code Review Fixes
2021-07-28 12:00:41 +02:00
Oliver Feldmann
7259ccc726
Remove version from deploy step (#2978) 2021-07-27 09:51:56 +02:00
Siarhei Pazdniakou
7a325e6fc8
Convert step/stage condition logic to golang (#2993)
* Added checkIfStepActive step

* Implemented npmScripts condition. Code was refactored

* Added some unit tests

* Fixed go modules

* Fixed go modules

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-07-26 07:47:43 +02:00
ffeldmann
39858cde2b
fix(splunkHook): Adds check if responseBody is nil (#3002)
* Improved logging of splunk connectivity errors

* Splunk logging

* Moved error logging message

* Bugfix for response body

* Moves response body check, logging of connectivity errors

* Reformatting

* Adds check if response body is nil
2021-07-23 16:02:27 +02:00
larsbrueckner
dbbbe1f0b3
Updates to toolrecord framework (#2986)
* Toolrecord framework -
provide a common entry point for post processing code scan results

Changes to be committed:
	new file:   pkg/toolrecord/REAMDE_toolrecord.md
	new file:   pkg/toolrecord/toolrecord_main.go
	new file:   pkg/toolrecord/toolrecord_test.go

* Add toolrecord file to Checkmarx results
modified:   cmd/checkmarxExecuteScan.go

* Add toolrecord file to Fortify results
	modified:   cmd/fortifyExecuteScan.go

* Add toolrecord file to Whitesource results
modified:   cmd/whitesourceExecuteScan.go

* unset umask (#2927)

* (feat) adds error logging output for downloading reports from whitesource (#2928)

* Add toolrecord file to Protecode results

* address code climate findings (1/2)

* address codeclimate findings (2/2)

* add comments to all methods

* Toolrecord library:
- move all toolrun files into a subdirectory
- fix timestamp generation in filenames

* add protecode group's URL to toolrecord data

* fix syntax error from previous commit in cmd/protecodeExecuteScan.go

* toolrecord: fix projectVersionID and generated URLs in fortifyExecuteScan.go

* cmd/fortifyExecuteScan.go: replace a hard-coded servername with
config.ServerURL

* update description

* add toolrecord file to detectExecuteScan

* toolrecord/whitesource: add project names as context

Co-authored-by: Kevin Stiehl <kevin.stiehl@numericas.de>
Co-authored-by: ffeldmann <felix@bnbit.de>
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2021-07-23 08:48:48 +02:00
Anil Keshav
3c41788405
fix(mavenBuild) looses trust to existing java cacerts (#2977)
* using default java truststore

* default java keytore

* remove trust store

* working directory

* change dir java_home

* env variable

* trying to find jre home

* changing directory to jre home and java home

* trying java jre

* remving $

* trying to search the cacerts

* copying existing cacerts

* removing change directory

* searching for secrutiy folder only

* searching cacerts

* new path for cacert

* path to ca-cert

* new trust store

* changing cacert location

* only adding maven_opts env variable once

* log message

* ca cert path from user

* handelling interface modification

* enhance logs and code clean up

* code clean up

Co-authored-by: Your Name <you@example.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-07-22 11:06:46 +02:00
Mayur Belur Mohan
a763112fe6
integrationArtifactUpload Fixes (#2987)
* integrationArtifactUpload Fixes

* format fixes

* Doc fixes

* Fix unit tests

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
2021-07-16 16:09:55 +02:00
Sven Merk
ee6d46a77c
fix(protecodeExecuteScan): Fix typo in report name (#2982)
* Fix exclude and enhance docs

* Fix test

* Fix test

* Add reporting to checkmarx step

* Improve text

* Add protecode report

* Fix fmt

* Add error handling

* Fix report name
2021-07-16 09:08:28 +02:00
Christopher Fenner
f78777f784
feat(npm): allow to publish artifact to registry (#2871)
* add new paraeters

* update generated sources

* run npm publish

* add repositoryUrl parameter

* handle registry credentials

* rename parameter

* handle base64encoding

* remove vault reference

* make username secret

* add publish method

* use publish method

* use dedicated registry

* use dry run

* fix

* prepend path

* fix workdir

* move code to npm package

* do changes

* update dependencies

* correct property init

* remomve dry-run

* regenerate

* add mock

* add logging

* add debug log

* dry-run

* remove try run

* remove append

* add debug outut

* change

* add debug output

* changes

* cleanup

* use different auth property

* add credential utils

* add debug log outputs

* remove auth handling & reuse writeFile

* rename

* fix debug output

* remove comments

* update comment

* rename function

* update docs

* update generated files

* handle npm ignore

* remove commented code

* add debug output
2021-07-15 14:46:04 +02:00
ffeldmann
4922a75ac1
Improves error logging for Splunk hook (#2966)
* Improved logging of splunk connectivity errors

* Splunk logging

* Moved error logging message

* Bugfix for response body

* Moves response body check, logging of connectivity errors

* Reformatting
2021-07-14 08:48:48 +02:00
ffeldmann
e9d8175c9b
Adds retry mechanism for whitesource in case the download of the unified agent or JRE fails (#2961) 2021-07-13 20:36:36 +02:00
Sven Merk
3e7595920f
feat(protecodeExecuteScan): Add protecode report (#2981)
* Fix exclude and enhance docs

* Fix test

* Fix test

* Add reporting to checkmarx step

* Improve text

* Add protecode report

* Fix fmt

* Add error handling
2021-07-12 12:20:25 +02:00
Sven Merk
9571fd28f4
feat(checkmarxExecuteScan): Reporting for pipeline optimization (#2976)
* Fix exclude and enhance docs

* Fix test

* Fix test

* Add reporting to checkmarx step

* Improve text
2021-07-09 10:19:42 +02:00
Oliver Nocon
805a8fd88f
feat(config): read config/defaults with authentication (#2975)
* feat(config):read config/defaults with authentication

This change allows to use defaults and config files from a protected GitHub repository.

The options `--customConfig` and `--defaultConfig` already allowed to provide a link to an uprotected file.

Now, by passing a value in the form `<hostname>:<token>` to parameter `gitHubTokens` (this parameter can be passed multiple times) a token can be provided for dedicated hosts.

This makes it possible to use a link like
`https://api.github.com/repos/SAP/jenkins-library/contents/resources/my-defaults.yml?ref=master`
as reference to a default file or similarly as reference to a configuration file.

* update generation to allow protected config/defaults

* fix CodeClimate issues

* update missing generations
2021-07-08 15:26:07 +02:00
Roland Stengel
e2fa05587d
RFC Upload GO (#2903)
* RFC Upload GO
- yaml review
- add cpe
- harmonize with solman
2021-07-01 13:11:21 +02:00
Siarhei Pazdniakou
54f2a0d471
Added go-based influxWriteData step (#2890)
* Added go-based influxWriteData step

* Wrote tests & fixed issues

* Fixed issues

* Created go-based step tests. Fixed issues

* Fixed issues

* Integration test was added

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2021-06-30 11:18:49 +02:00
Thorsten Duda
7910df0e8c
new step integrationArtifactTriggerIntegrationTest (#2951)
* new step integrationArtifactTriggerIntegrationTest

* add new step into allow list

* add the new step to main command

* refer cpe

* remove unused unit tests

* Check methods and URLs of http request

* Add TriggerIntegration to mockingutils

* Format code

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
Co-authored-by: Linda Siebert <linda.siebert@sap.com>
2021-06-29 14:50:19 +02:00
Linda Siebert
78a29d782b
CPI - Introduce service key (#2901)
* Switch to service key for CPI GetMplStatus

Introduces read method for service key files, mock utils and tests.

* Use secret text instead of file

* Change serviceKey definition

* Update cpiUpload to use Service Key

retrieved the host and uaa information from service key

* Update cpiDeploy to use service key

retrieved the host and uaa information from service key

* Update cpiServiceEndpoint to use Service Key

retrieved the host and uaa information from service key

* Update cpiDownload to use Service Key

retrieved the host and uaa information from service key

* Update cpiUpdateConfig to use Service Key

retrieved the host and uaa information from service key

* Refactor serviceKey var name

* Fixed references to service key to follow the real format

they should be accessed through oauth instead of uaa because of the format of the json

* Rename ServiceKey to APIServiceKey

To support having a different service key(and for readability), we need to change the name to API.

* Add STAGES and STEPS yaml

add in to each yaml file of cpi integration

* Revert "Add STAGES and STEPS yaml"

This reverts commit aa2665d158.

* Change comments/formatting commonUtils

Make comments more understandable and follow code climate suggestions

* Change documentation files for steps

remove OAuth and host and change credentials to be servicekey

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
Co-authored-by: Thorsten Duda <thorsten.duda@sap.com>
2021-06-28 10:50:33 +02:00
Marc Bormeth
b5357f9437
feat: Add environment information to orchestrator package (#2942)
* Fix Orchestrator detection

* Add unit tests

* Add environment info to orchestrator package
2021-06-25 10:50:56 +02:00
Kevin Stiehl
a48b8afc31
fix(commonPipelineEnvironment): keep json numbers untouched (#2908)
* keep numbers untouched

* rebase master
2021-06-23 20:20:43 +02:00
larsbrueckner
61fe88e199
Add "toolrecord" files to Fortify, Checkmarx, Protecode and Whitesource results (#2929)
* Toolrecord framework -
provide a common entry point for post processing code scan results

Changes to be committed:
	new file:   pkg/toolrecord/REAMDE_toolrecord.md
	new file:   pkg/toolrecord/toolrecord_main.go
	new file:   pkg/toolrecord/toolrecord_test.go

* Add toolrecord file to Checkmarx results
modified:   cmd/checkmarxExecuteScan.go

* Add toolrecord file to Fortify results
	modified:   cmd/fortifyExecuteScan.go

* Add toolrecord file to Whitesource results
modified:   cmd/whitesourceExecuteScan.go

* unset umask (#2927)

* (feat) adds error logging output for downloading reports from whitesource (#2928)

* Add toolrecord file to Protecode results

* address code climate findings (1/2)

* address codeclimate findings (2/2)

* add comments to all methods

Co-authored-by: Kevin Stiehl <kevin.stiehl@numericas.de>
Co-authored-by: ffeldmann <felix@bnbit.de>
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2021-06-23 15:05:00 +02:00
Sven Merk
ab9e154d10
Replace io.Copy (#2934)
* Replace io.Copy

* Test coverage

* Improve test

* Fix fmt

* Improve error handling in test

* Fix code

* Improve test error log

* Fix fmt

* Fix unix file handles

* Fix error message

* Resolve code climate issue
2021-06-23 14:41:52 +02:00
ffeldmann
6671afb909
(feat) adds error logging output for downloading reports from whitesource (#2928) 2021-06-21 13:36:08 +02:00
Kevin Stiehl
792d435a7f
fix(commonPipelineEnvironment) file and directory permissions (#2924) 2021-06-18 09:56:31 +02:00
Kevin Stiehl
173e887064
[CPE] Missing pipeline environment in sonar docker container (#2909)
* execute writepipeline env in sonar

* non exisitng dir is no error

* add log message
2021-06-16 11:46:55 +02:00
Oliver Nocon
0b48bfcc73
feat: retrieve metadata by stepName - corrected (#2892)
* refactored getConfig to allow stepName param for metadata fetching

* extended step generator

* go generate

* Update cmd/getConfig.go

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>

* Update cmd/getConfig.go

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>

* Update cmd/getConfig.go

* update generated files

* update golden files to care for generator update

* update and add tests

* update generated files

* Update cmd/getConfig.go

* Update cmd/getConfig.go

* update/fix formatting

* feat: retrieve metadata by stepName - corrected

* update generation

* update condition logic for defaults

* update generation & tests

* support multiple conditions

* update generation

* Add generated

Co-authored-by: Leander Schulz <leander.schulz01@sap.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
Co-authored-by: Sven Merk <s.merk@sap.com>
2021-06-16 08:43:30 +02:00
Christopher Fenner
367ca6211a
refactor(protecode): simplify protecode calls (#2838)
* simplify protecode calls

* add todos

* reomve todo

* restore go.sum

* Update cmd/protecodeExecuteScan.go

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>

* Apply suggestions from code review

* remove productID

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2021-06-15 22:29:24 +02:00
Sven Merk
a43f46465a
feat(fortifyExecuteScan): HTML report for Fortify (#2879)
* Tune test

* Fix report implementation

* Fix tests

* Fix values

* Fix code and test

* Report writing fix

* Commit generated sources

* Update cmd/fortifyExecuteScan.go

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>

* Externalize report generation

* Fix fmt

* Fix fmt 2

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2021-06-15 14:53:42 +02:00
Kevin Stiehl
d1c8abc6b3
refactor: move common pipeline environment handling to golang (#2823)
* make use of new read,writePipelineEnv Steps in groovy

* remove unused cat

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2021-06-15 14:34:56 +02:00
Sven Merk
7fa31ae9cc
feat(http): Resilience via retry on intermittent communication issues (#2877)
* feat(http): Resilience on connectivity issues

* Update whitesourceExecuteScan.go

* Update splunk_test.go

* Fix initialization

* Change http interaction

* Fix fmt and tests

* Final test fix
2021-06-15 11:13:24 +02:00
Marcus Holl
fe5ce61d9e
rfc upload (#2533)
* Add RFC upload command
2021-06-14 12:36:18 +02:00
Oliver Nocon
4250ca8bed
Revert "feat(getConfig): retrieve metadata by stepName (#2736)" (#2891)
This reverts commit ae4a24c594.
2021-06-14 10:57:44 +02:00
lndrschlz
ae4a24c594
feat(getConfig): retrieve metadata by stepName (#2736)
* refactored getConfig to allow stepName param for metadata fetching

* extended step generator

* go generate

* Update cmd/getConfig.go

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>

* Update cmd/getConfig.go

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>

* Update cmd/getConfig.go

* update generated files

* update golden files to care for generator update

* update and add tests

* update generated files

* Update cmd/getConfig.go

* Update cmd/getConfig.go

* update/fix formatting

Co-authored-by: Leander Schulz <leander.schulz01@sap.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
Co-authored-by: OliverNocon <oliver.nocon@sap.com>
2021-06-14 08:58:41 +02:00
Kevin Stiehl
6c7814e4d5
feat(cpm): Add read and write CPE Go step (#2888)
* add read write cpe go steps

* Update pkg/piperenv/CPEMap.go

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>

* Update pkg/piperenv/CPEMap.go

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>

* Update pkg/piperenv/environment.go

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>

* rename file

* add error handling

* add error handling

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2021-06-11 16:17:40 +02:00
Marc Bormeth
84c3cd399d
fix: orchestrator detection (#2886)
* Fix Orchestrator detection

* Add unit tests

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2021-06-10 23:47:38 +02:00
Marc Bormeth
911d4bc770
feat(sonar): make step orchestrator-agnostic (#2874)
* Make sonarExecuteScan orchestrator-agnostic

* Increase coverage + support empty or false env vars

* Use cleared env for unit tests

* Refactor to standalone package

* Fix review findings

* Fix review findings

* Fix unit test

* Add logging

* Refactor

* Add to codeowners 😎

* Apply suggestions from code review

* Remove unreachable code

* no message

* fix typos

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2021-06-09 09:38:52 +02:00
Christopher Fenner
824cd7d768
fix(jenkins): fix job invocation (#2868)
* update mock

* update signarture

* add test case

* use latest gojenkins

* add integration test

* update mock

* add todo

* add job wrapper

* add job mock

* add test cases

* refactor

* cleanup

* update integration test case
2021-06-02 16:45:22 +02:00
Anil Keshav
a830a35800
Extending mavenBuild step with an option to perform maven deploy with publish flag (#2833)
* modifying detect.maven.excluded.scopes from TEST to test

* new maven alt deployment flags

* changing flag names

* tlsCertificate addtion

* adding publish flags

* new flags

* publish flag

* enhance maven builds

* enhance maven builds

* creating new settings xml

* updating project settings

* changing interface for artifactPreparation that uses the same maven util niterface

* adding general scope to maven params

* global reference

* removing vault tmp

* debuging deployment user

* more debug

* maven build paras

* using smaller case

* adding incorrect error check

* adding deployment flags

* code refactor

* unit tests

* changing scope of paramter for tls certs

* new scope for tls

* remove trailing space in mavenBuild.yaml

* trailing space fix

* typo fix and jenkins secret

* including jenkins credentials for repo pass in the maven build groovy

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-06-01 09:24:36 +02:00
Christopher Fenner
e24b38da24
fix(jenkins): correct interface (#2862)
* update mock

* update signarture

* add test case
2021-05-31 08:54:04 +02:00
Christopher Fenner
62836a64e7
feat(http): expose standard client (#2860)
* expose standard client

* reset go.summ
2021-05-28 12:13:19 +02:00
Christopher Fenner
40c32598a4
feat(jenkins): update jenkins go dependency (#2848)
* update dependency

* use context

* regenerate mock

* decapitalize error messages

* use getBuildFromQueueID

* add comments about mockery

* update mocks

* update tests

* add context parameter

* pull up context

* update mocks

* update tests
2021-05-28 11:12:42 +02:00
ffeldmann
52c25a0dbb
feat(splunk): Adds head commitID of current build to commonPipelineEnvironment (#2844)
* Adds headCommitId, which stores the head commit has of the current build, includes tests and generated files

* Adds headCommitId, which stores the head commit has of the current build, includes tests and generated files

* Go fmt fix

* Fixes artifactoryPrepareVersion test

* Removes xMake CommitId
2021-05-20 13:11:57 +02:00
ravikumarsinghshankarsingh
cac7f2e904
"ignoreSourceFiles" parameter removed from general section and added … (#2814)
* "ignoreSourceFiles" parameter removed from general section and added to specific build tool section

* Update configHelper_test.go

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-05-19 14:57:49 +02:00
Sven Merk
ce06b82450
fix(protecodeExecuteScan): Handling of empty findings (#2818)
* Don't fail if components list is empty.  Resolves failures when scanning images from Crossplane.

* Update formatting with go fmt

* Update pkg/protecode/protecode.go

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>

* Update pkg/protecode/protecode.go

Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>

* Fix change, make consistent

Co-authored-by: d.small@sap.com <d.small@sap.com>
Co-authored-by: dee0 <dsmallzero@gmail.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2021-05-17 13:38:17 +02:00
ffeldmann
b88ebdad6c
feat(splunk) Sending telemetry and logging information to Splunk (#2796)
* Adds inital splunk hook and logCollector

* Adds documentation of the Splunk hook

* Fixes markdown lint issues and removes comment from telemetry.go file

* Fixes markdown lint issues and adds missing generated file

* Markdown linting

* Changes documentation according to review, adds Splunk token automatically during init

* Adds error handling for marshalling hook config

* Markdown lint und correct Splunk token in httpclient

* Registeres Splunk token as secret and adjusts test cases

* Adds missing error handling and removes unnecessary comments

* Creates new function readPipelineEnvironment, adds tests

* Moves MonitoringData struct, edits defaults for json fields

* Adds gitRepository and gitOwner to telemetry information

* Simplifies readCommonPipelineEnvironment function, adds more descriptive errors, adds automated adding of Splunk prefix token

* Adjusts error handling

* Cleaner error logging
2021-05-17 12:14:04 +02:00
Christopher Fenner
3a14a91ae5
refactor(versioning): simplify versioning model method (#2825)
* rename artifactVersion to version

* simplify versioningModel
2021-05-14 09:35:31 +02:00
Oliver Nocon
4b666003c8
feat(reporting) update markdown reports (#2819) 2021-05-11 08:01:02 +02:00
Christopher Fenner
98fac0a455
chore(deprecation): change format of deprecation notice from config command (#2822)
* Update config.go

* Update config.go

* add library name

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-05-10 19:18:16 +02:00
Oliver Nocon
5899746767
chore: update error categories (#2827) 2021-05-10 17:44:28 +02:00
Siarhei Pazdniakou
0673d3fed6
Writing secrets to vault (#2770)
Co-authored-by: Kevin Stiehl <kevin.stiehl@numericas.de>
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-05-06 10:27:23 +02:00
Christopher Fenner
2426486e7b
feat(sonar): add versioningModel and customScanVersion to sonar scan (#2787)
* add versioningModel parameter

* extract versioning model to own package

* move log message

* use versioning method

* add customScanVersion parameter

* use customScanVersion

* adjust docs on other steps

* update test case
2021-05-05 09:02:19 +02:00
pkrasnousov
e9464b2594
feat(whitesourcescan): add param workDir to whitesourcescan (#2791)
* Add dir to whitesource scan

* Add default for "dir" option

* Change param name to workDir

* Change param name WorkDir to ScanPath

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-05-03 10:53:16 +02:00
Mayur Belur Mohan
05973a8fcd
Help document fixes (#2793)
* byte code Fix

* Help Url Fixes

* Yaml Changes

* Error Message changes

Co-authored-by: Oliver Feldmann <oliver.feldmann@sap.com>
2021-04-30 09:43:25 +02:00
Mikalai Dzemidzenka
b82ecb0ff7
convert batsExecuteTests to go implementation (#2737)
* convert batsExecuteTests to go implementation

* added additional test cases, added container definition to batsExecuteTests.yaml

* added influx, for junit added container definition

* added parameter envVars

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-04-29 16:50:23 +02:00
tiloKo
9ac29fd8e6
set User-Agent Header (#2797) 2021-04-29 13:30:25 +02:00
Sven Merk
bf428d1ef9
Fix project lookup query (#2785)
* Fix project lookup

* Added test for space

* Update pkg/fortify/fortify.go

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-04-28 13:59:59 +02:00
Oliver Nocon
b9cd425091
fix(whitesource) proper error message when tokens are not found (#2786) 2021-04-23 11:33:10 +02:00