Oliver Nocon
43f51ba90a
Revamp documentation generation for golang steps ( #1781 )
...
* Revamp documentation generation for golang steps
* Add and update tests
* Add tests, add step outputs
* Add tests, add step outputs
* Update rendering
* fix merge conflict
* update generated files
* Update pkg/config/stepmeta.go
* Update pkg/config/stepmeta.go
* Update pkg/generator/helper/docuHelper.go
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
* Include PR feedback
* update tests
* Fix Jenkins dependecy indication
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-07-16 09:10:15 +02:00
Oliver Nocon
eafe383d54
Add error category parsing to cmd execution ( #1703 )
...
* Add error category parsing to cmd execution
It is now possible to define `ErrorCategoryMapping` as a `map[string][]string` on a `Command`.
The format contains the category as key which has a list of error patterns assigned.
Example:
```
cmd := Command{
ErrorCategoryMapping: map[string][]string
"build": {"build failed"},
"compliance": {"vulnerabilities found", "outdated components found"},
"test": {"some tests failed"},
},
}
```
Setting this map triggers console log parsing when executing a command.
If a match is found the error category is stored and
it will automatically be added to the `errorDetails.json`.
* clean up go.mod
* fix test
* fix test
* Update DEVELOPMENT.md
* fix tests
* address long console content without line breaks
* scan condition update
* fix test
* add missing comment for exported function
* Update pkg/command/command.go
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-06-24 10:04:05 +02:00
Christopher Fenner
c42553593e
fix: remove unused variables from generated step coding ( #1698 )
...
* remove unused parameters from generated code
* update steps
* update steps
* correct golden files
Co-authored-by: Stephan Aßmus <stephan.assmus@sap.com>
2020-06-23 18:05:21 +02:00
Maximilian Lenkeit
10e5bf98f8
artifactPrepareVersion: remember original artifact version ( #1600 )
...
* Update resources.go
* expose originalArtifactVersion parameter
* re-generate steps
* adjust golden files for generator changes
2020-05-28 10:05:22 +02:00
Sven Merk
af2a01c064
Fortify implementation in golang ( #1428 )
2020-05-25 19:48:59 +02:00
Oliver Nocon
7f7d0bce89
Piper steps: Issue SUCCESS message ( #1478 )
...
* Piper steps: Issue SUCCESS message
Log `SUCCESS` message in all steps by default if no error occured
* Update additional generated steps
* Update generated step
2020-05-18 21:52:54 +02:00
Oliver Nocon
37a6d456fe
Fix generator for custom steps ( #1522 )
2020-05-08 10:41:01 +02:00
Stephan Aßmus
082b249cc0
Fix logrus buffer issue ( #1511 )
2020-05-06 13:35:40 +02:00
lndrschlz
39e30ff1b4
Added hook configuration; added sentry hook and tests ( #1497 )
...
* Added hook configuration; added sentry hook and tests
* steps generated by step framework
* added comments and renamed correlationID
* formatted comment on NewSentryHook method
* fix generator step tests
2020-05-05 08:36:24 +02:00
Christopher Fenner
6eb8dc8191
docs: add possible value for bool parameters ( #1486 )
2020-04-30 06:39:48 +02:00
Christopher Fenner
3a4d4b2de7
docs: add general config parameters to GO docs ( #1471 )
...
* extract StepConfiguration generation to separate file
* add general options to parameter and config table
* fix test case
* remove telemetry flag from docs
* Revert "extract StepConfiguration generation to separate file"
This reverts commit df80dab8cd
.
2020-04-29 14:40:11 +02:00
Oliver Nocon
43947e6ef5
Pass golang error details to Jenkins pipeline ( #1443 )
...
Do not exit with os.Exit(1) but using log.Entry().Fatal() instead
* Golang: forward error details
* extend groovy wrapper to provide proper error message
* create closure for error handling
2020-04-28 07:42:02 +02:00
Christopher Fenner
8455306a5e
docs: add code blocks to parameters table ( #1460 )
...
* add code blocks
* set parameters name in code block
* change test cases
* set parameters name in code block
* add step configuratio caption
* remove details caption
* add code block for docker settings
* add code block for stash content
* add code block for defaults
* add code block for sidecar image & name
* correct test cases
* add code block for docker
* correct test cases
2020-04-27 12:16:41 +02:00
Christopher Fenner
1660f4df48
docs: remove dangling whitespaces ( #1459 )
...
* omit <nil> in parameter table
* remove additional whitespaces
* add newline
* remove whitespaces
* adjust test cases
* fix whitespaces
2020-04-24 21:48:28 +02:00
Christopher Fenner
96439972e2
docs: show possible values in step documentation ( #1453 )
...
* add possibleValues to model
* include possible values into docs
2020-04-24 14:13:02 +02:00
Christopher Fenner
2100632b54
docs: omit <nil> in parameter table ( #1450 )
...
* omit <nil> in parameter table
* adjust test case
2020-04-24 11:21:33 +02:00
Oliver Nocon
75a10742d3
Step generator: correct error handling ( #1429 )
...
Do not exit with os.Exit(1) but using log.Entry().Fatal() instead
2020-04-20 16:52:57 +02:00
Daniel Kurzynski
ce4be51362
Mask secrets ( #1382 )
2020-04-16 14:37:45 +02:00
Christopher Fenner
60b7d3a8df
refactor(sonar): implement Sonar step in GO ( #1042 )
...
* refactor(sonar): add initial metadata file for GO-based sonar step
* refactor(sonar): add initial generated files for GO-based sonar step
* refactor(sonar): add initial step file for GO-based sonar step
* refactor(sonar): add sonar cmd to executable
* refactor(sonar): cleanup metadata file
* fix(go): use capital TLS in golang names
* add download of Sonar scanner cli
* move download & unzip methods to FileUtils
* download certificate files
* use http.Downloader
* update generated code
* add slice prefix function
* update sonar step
* add test cases
* update docs
* use node:lts image
* use latest sonar-scanner
* add test cases
* use latest sonar-scanner
* fix test case
* change things
* return errors on functions
* limit changeID visibility
* use lowercase scm provider
* add test case for legacy PRs
* add test case
* update docs
* use local temp dir
* extend parameter visibility to GENERAL
* use SONAR_AUTH_TOKEN
* remove comments
* update generated code
* Apply suggestions from code review
* change to private fields
* use setter for sonar options & environment
* remove obsolete return statement
* add comment about Downloader mock
* add test case for custom options
* handle custom options
* refactor slice functions
* fix go fmt
* fix generated step code
* update docs
2020-03-23 10:38:31 +01:00
Oliver Nocon
8fbeddb26c
Golang step metadata: Config aliases for steps ( #1293 )
...
* Golang step metadata: Config aliases for steps
This will ease following scenarios:
* config migration due to step name changes
* re-use of more general config, e.g. `mavenExecute` in `mavenBuild`
* fix CodeClimate finding
* Fix panic if original stage config does not exist yet
2020-03-19 17:24:35 +01:00
Florian Geckeler
48fa0a7521
Add 'Code generated by' header to stepGoTemplate
2020-02-21 12:56:09 +01:00
Oliver Nocon
a5d4c64bf4
Correct step generator ( #1190 )
2020-02-18 08:31:54 +01:00
Oliver Nocon
ec4fb1b186
Update generator ( #1188 )
...
Provide better starting point for new steps
2020-02-17 13:30:30 +01:00
Oliver Nocon
9c1bd04752
Streamline step generation ( #1142 )
...
* Streamline step generation
* Include PR feedback, update DEVELOPMENT.md
Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2020-02-04 10:46:43 +01:00
Christopher Fenner
768c6aa399
fix: generator for custom steps ( #1139 )
2020-01-31 15:39:45 +01:00
Oliver Nocon
b542d15998
Enhance telemetry reporting ( #1133 )
...
* Enhance telemetry reporting
* Use central telemetry data object
* Add duration
Co-Authored-By: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
2020-01-31 14:06:08 +01:00
Christopher Fenner
aa3fb8adb4
feat(go): add telemetry reporting ( #1100 )
...
* Add telemetry support
* First round telemetry
* Add telemetry flag
* fix: move files to avoid import cycles
* add noTelemetry as global config option
* Respect telemetry configuration for reporting
* add site id, swa endpoint
* correct logger initialization
* add http logic
* rename init method
* rename consts & types
* convert struct to payload
* convert data to payload string
* move activation flag out of data structure
* extract types to own file
* build query using net/url
* correct field mapping
* extract notify coding to own file
* cleanup parameter mapping
* preare base data
* fix codeclimate issue
* correct test case
* fill values from env
* test all fields
* untrack notify.go
* ignore empty custom values
* cleanup data.go
* add test cases
* cleanup
* add usage reporting to karma step
* add usage reporting to step generator
* externalise siteID
* correct custom field names
* test env handling
* simplify method signature
* revert parameter negation
* correct import
* adjust golden file
* inclease log level
* ignore test case
* Revert "inclease log level"
This reverts commit 70cae0e029
.
* add test case for envvars
* remove duplicate reporting
* remove duplicate reporting
* correct format
* regenerate checkmarx file
* add log message on deactivation
* rename function
* add comments to understand SWA mapping
Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
2020-01-29 13:17:54 +01:00
Oliver Nocon
73ab887f25
Add kubernetesDeploy step ( #1073 )
...
* Add kubernetesDeploy step
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2020-01-24 14:30:27 +01:00
Oliver Nocon
a46b57e6b4
Persisted pipeline environment for golang library ( #1091 )
...
* Use commonPipelineEnvironment in go binary
* Update groovy part incl. tests
* Rework structure and naming
* Support influx resources in steps
* Update tests and some cleanups
* Add correct defer handling
* Address PR feedback
* Fix test
* Update resources.go
Co-authored-by: Sven Merk <33895725+nevskrem@users.noreply.github.com>
2020-01-15 12:16:25 +01:00
Oliver Nocon
4f57738888
Detect: Add golang implementation ( #1049 )
...
Add detect golang implementation
2019-12-13 09:55:45 +00:00
redehnroV
0b3bfcbcd5
fixed docu generation layout ( #1014 )
2019-11-26 15:26:37 +01:00
redehnroV
9559832a19
Merge branch 'master' into sv-docuGen
2019-11-22 07:49:40 +01:00
Oliver Nocon
e671094308
Use piper binary for githubPublishRelease ( #990 )
...
* Use piper binary for githubPublishRelease
2019-11-21 16:34:22 +01:00
Sven Merk
79e002cc5e
Merge branch 'master' into sv-docuGen
2019-11-21 16:13:50 +01:00
Oliver Nocon
0f33f7a2ef
Consider custom defaults in config.yml ( #995 )
...
* Consider custom defaults in config.yml
2019-11-21 16:09:57 +01:00
Sascha Vornheder
7558884f0b
fixed wrong format
2019-11-21 11:18:56 +01:00
Sascha Vornheder
f79f5e64ad
fixed codeclimate
2019-11-21 11:15:08 +01:00
Sascha Vornheder
957bd6ad4b
fixed codeclimate
2019-11-21 11:12:30 +01:00
Sascha Vornheder
c61b3a6e6c
removed unused code
2019-11-20 15:08:03 +01:00
Sascha Vornheder
39f6fd57c6
fixed issue with context defaults during docu generation
2019-11-20 14:36:07 +01:00
Sascha Vornheder
75b62547e3
fixed test
2019-11-20 11:29:13 +01:00
Sascha Vornheder
cdaa7dfd52
added dockerOptions to the docu generation
2019-11-20 10:50:23 +01:00
Sascha Vornheder
001895a228
added dockerOptions to the docu generator
2019-11-20 09:05:10 +01:00
Sascha Vornheder
5ba375250d
removed complexity added volumeMount
2019-11-18 11:14:45 +01:00
Sascha Vornheder
737e0e9c5b
added more tests
2019-11-14 15:09:12 +01:00
Sascha Vornheder
e763194779
added some tests, fixed CodeClimat findings
2019-11-14 13:59:31 +01:00
Sascha Vornheder
1a609e5418
fixed some codeclimate issues
2019-11-13 14:43:53 +01:00
Sascha Vornheder
c6f5dbf5ee
refactored docuHelper and added general test
2019-11-13 14:34:04 +01:00
Sascha Vornheder
b5b4f60bc4
fixed helper test
2019-11-12 14:21:23 +01:00
Sascha Vornheder
85570095c5
Fix CodeClimate finding
2019-11-12 13:55:32 +01:00