1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00
Commit Graph

25 Commits

Author SHA1 Message Date
Jordi van Liempt
0ba4c2206c
chore(deps): Replace io/ioutil package (#4494)
* update all deprecated ioutil usages

* forgotten changes

* add missing imports

* undo changing comment

* add missing 'os' import

* fix integration test

---------

Co-authored-by: I557621 <jordi.van.liempt@sap.com>
Co-authored-by: Gulom Alimov <gulomjon.alimov@sap.com>
2023-08-16 12:57:04 +02:00
Jk1484
ffc931aad1
feat(golangBuild): use 'unit' build tag to include tests during test execution (#4345)
* Added unit tag as argument. Added description to runTests command. Changed code generator to have unit build tag in generated unit test files.

* Added unit build tag to all unit test files.

* added to new unit test unit build tag

* Update verify-go.yml

* small fix

---------

Co-authored-by: Muhammadali Nazarov <Muhammadali.Nazarov@acronis.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2023-05-03 21:02:11 +05:00
Adrien
1552570fd0
fix(checkmarxExecuteScan): Fail with a clear error message if no projectName (#4124)
* Fail with a clear error message if no projectName
2022-11-15 10:51:23 +05:30
Oliver Nocon
a46f796bcd
chore: cleanup reporting & some incorrect file usage in tests (#3943)
* chore: cleanup reporting & some incorrect file usage in tests

* cleanup interface

* chore: remove comment

* preserve error handling

* Rename FileUtils.go to fileUtils.go

* clean up formatting

* chore: address static check findings

* fix brittle test

* chore: cleanup formatting
2022-08-09 10:57:02 +02:00
thtri
2536a9f598
feat(checkmarxExecuteScan): Support threshold for Low finding per Query name (#3938)
* feat(checkmarx): Support threshold for Low finding per Query name

Co-authored-by: sumeet patil <sumeet.patil@sap.com>
2022-08-05 00:17:07 +02:00
Oliver Nocon
d640d72dc6
feat: improve vulnerability reporting via GitHub issues (#3924)
* feat: improve vulnerability reporting via GitHub issues

* feat: update reports

* chore: add tls cert links

* only write log on error

* chore: update formatting

* chore: update handling of direct dependencies

* chore: fix linting issue

* chore: minor updates
2022-08-02 08:26:26 +02:00
Oliver Nocon
f6a6448631
chore: fix linting issues (#3878)
* chore: fix linting issues

* add more fixes

* correct formatting

* Delete depl.yaml
2022-07-21 09:04:21 +02:00
Eng Zer Jun
0f4e30e9db
test: use T.TempDir to create temporary test directory (#3721)
This commit replaces `ioutil.TempDir` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `ioutil.TempDir`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2022-07-12 15:19:12 +02:00
xgoffin
903f273012
feat(checkmarxExecuteScan): added API to get description, incorporated to SARIF file (#3814) 2022-06-01 15:48:56 +02: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
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
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
Sven Merk
2997714a02
checkmarxExecuteScan: Improve error message on compliance issues (#3083)
* Update checkmarxExecuteScan.go

* Fix test
2021-09-07 13:10:11 +02:00
Sven Merk
1ddd966249
Enforce non-incremental scans when optimized and scheduled (#3039)
* Enfore non-incremental scans when optimized

* Update resources/metadata/checkmarx.yaml

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

* Update generated file

Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2021-08-10 11:27:28 +02:00
Fabian Reh
44ca6db57c
Fix checkmarx execute scan (#2765)
* Remove error check on preset conversion

Signed-off-by: Fabian Reh <fabian.reh@sap.com>
2021-04-19 10:15:07 +02:00
Fabian Reh
9f55c4360d
Fix checkmarx execute scan (#2747)
* Fixes infinite recursion

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Adds test for infinite recursion

Signed-off-by: Fabian Reh <fabian.reh@sap.com>
2021-04-08 09:16:47 +02:00
Fabian Reh
bb62252600
Refactor(checkmarxExecuteScan): filterFileGlob (#2490)
* * Fixes filterFileGlob as it did not evaluate all patterns
* Adapts unit tests to cover all functionality

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* * Fixes comment

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* * Adds tests for error cases
* Adds mock utils to mock external calls for errors

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* * Adds test for os.Open

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Cleans code

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Makes test OS independent

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Makes TestFilterFileGlob run in parallel

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Marks all tests to run in parallel

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Add tests and error handling for string conversion and zip file

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Add tests and error handling for write file

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Add tests and error handling for write file

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Add tests and error handling for PathMatch

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Refactor zipFolder method to reduce complexity

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* simplify parameters

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Revert "simplify parameters"

This reverts commit 0bfc582808.

* Revert "Revert "simplify parameters""

This reverts commit 102633cf2d.

* Extract getWorkspace to reduce parameters

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Adapts tests to new error handling of 0 files zip

Only logs error for 0 files zip if no other errors appeared

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* Extract method to reduce complexity

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* rename method

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* remove method needing many parameters

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* remove strconv api

Signed-off-by: Fabian Reh <fabian.reh@sap.com>

* remove project variable as project is created in this method

Signed-off-by: Fabian Reh <fabian.reh@sap.com>
2021-04-08 07:05:37 +02:00
Sven Merk
5d1782aa01
checkmarxExecuteScan: adapt to 9.2 api (#2363)
* Update checkmarxExecuteScan.go

* api mods

* Switch default

* Fix decode

* mod marshalling

* Fix unmarshalling

* Code fmt and small fix

* Optimize preset handling

* Integer handling

* Fix test

* cleanup

* go fmt

* Improve test
2020-11-25 13:47:26 +01:00
Oliver Nocon
15b3957137
checkmarxExecuteScan: update error handling (#2084)
* checkmarxExecuteScan: update error handling

* Update cmd/checkmarxExecuteScan.go

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>

* include PR feedback

Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-09-29 09:23:31 +02:00
Christopher Fenner
6999380ee3
chore(go): simplify code using gofmt -s (#2065) 2020-09-24 08:58:53 +02:00
Sven Merk
4ae46823b1
Fix PR feature (#2048)
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-09-22 12:36:22 +02:00
Sven Merk
612d3a645b
Support verify only mode for SAST tools (#2018)
* Support verify only mode for SAST

* Include feedback

* Add tests

* Fix imports
2020-09-18 08:19:34 +02:00
Sven Merk
51158d2457
checkmarxExecuteScan: Fix access to projects (#1997) 2020-09-10 11:14:58 +02:00
Sven Merk
3139255312
Fix chars in checkmarx test, improve development.md (#1154)
* Fix chars in test

* Update DEVELOPMENT.md

* Update DEVELOPMENT.md

* Update DEVELOPMENT.md
2020-02-06 09:43:19 +01:00
Sven Merk
cbe368fe36
Checkmarx as golang (#1075)
* Added base functionality for checkmarx interaction

* Extend http client with file upload capabilities

* Latest changes

* Add debug logging

* Introduce Uploader interface

* Add tests for checkmarx client

* Hook new checkmarx command

* Improve coverage

* Add tests

* Improved test coverage and fixed code

* Add influx reporting

* Add alternation capabilities

* Add groovy step

* Try fix cmd

* Enhancements

* Fix report generation

* Final performance improvements

* Fix code

* Structure code, cleanup

* Improvements

* Fix codeclimate issue

* Update groovy

* Adapt latest changes to http

* Fix test

* Fix http tests

* Fix test

* Fix test

* Fix test 2

* Fix code

* Fix code 2

* Fix code

* Code

* Fix

* Fix

* Add report and link handling

* Fix returns, add groovy test

* Review comments

* Added doc template

* Docs update

* Remove SAP internals

* Better status display

* Add name to link

* Fix test

* Fix

* Fix verbose handling

* Fix verbose handling 2

* Fix verbose handling 3

* Fix

* Tiny improvements

* Regenerate

* Fix test

* Fix test code

* Fix verbosity issue

* Fix test

* Fix test

* Fix test
2020-01-27 23:40:53 +01:00