1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00
sap-jenkins-library/resources/metadata
Oliver Feldmann 810d197665
[ANS] Step implementation (#3764)
* Add ans implementation

* Remove todo comment

* Rename test function

Co-authored-by: Linda Siebert <39100394+LindaSieb@users.noreply.github.com>

* Better wording

Co-authored-by: Linda Siebert <39100394+LindaSieb@users.noreply.github.com>

* Add reading of response body function

* Use http pkg ReadResponseBody

* Check read error

* Better test case description

* Fix formatting

* Create own package for read response body

* Omit empty nested resource struct

* Separate Resource struct from Event struct

* Merge and unmarshall instead of only unmarshalling

* Improve status code error message

* Remove unchangeable event fields

* Separate event parts

* Change log level setter function

* Restructure ans send test

* Revert exporting readResponseBody function

Instead the code is duplicated in the xsuaa and ans package

* Add check correct ans setup request

* Add set options function for mocking

* Review fixes

* Correct function name

* Use strict unmarshalling

* Validate event

* Move functions

* Add documentation comments

* improve test

* Validate event

* Add logrus hook for ans

* Set defaults on new hook creation

* Fix log level on error

* Don't alter entry log level

* Set severity fatal on 'fatal error' log message

* Ensure that log entries don't affect each other

* Remove unnecessary correlationID

* Use file path instead of event template string

* Improve warning messages

* Add empty log message check

* Allow configuration from file and string

* Add sourceEventId to tags

* Change resourceType to Pipeline

* Use structured config approach

* Use new log level set function

* Check correct setup and return error

* Mock http requests

* Only send log level warning or higher

* Use new function name

* One-liner ifs

* Improve test name

* Fix tests

* Prevent double firing

* Reduce Fire test size

* Add error message to test

* Reduce newANSHook test size

* Further check error

* Rename to defaultEvent in hook struct

* Reduce ifs further

* Fix set error category test

The ansHook Fire test cannot run in parallel, as it would affect the
other tests that use the error category.

* Change function name to SetServiceKey

* Validate event

* Rename to eventTemplate in hook struct

* Move copy to event.go

* Fix function mix

* Remove unnecessary cleanup

* Remove parallel test

The translation fails now and again when parallel is on.

* Remove prefix test

* Remove unused copyEvent function

* Fix ifs

* Add docu comment

* Register ans hook from pkg

* register hook and setup event template seperately

* Exclusively read eventTemplate from environment

* setupEventTemplate tests

* adjust hook levels test

* sync tests- wlill still fail

* migrate TestANSHook_registerANSHook test

* fixes

* Add ans send event step

* Fix tests

* Add groovy wrapper

* Add groovy wrapper test

* Fix function names

* Reduce ifs

* Fix docu

* We always set the timestamp

* Validate event

* Test unknown field in json

* Make test list test

* Set all event fields as separate parameters

* Generate and fix code

* Review fixes

* Format test file

* Format go code

* Fix common steps tests

* Print event to console if verbose

Co-authored-by: Linda Siebert <39100394+LindaSieb@users.noreply.github.com>
Co-authored-by: Roland Stengel <r.stengel@sap.com>
2022-06-21 15:45:07 +02:00
..
abapAddonAssemblyKitCheckCVs.yaml Docu updates abap steps (#2910) 2021-06-17 21:28:15 +02:00
abapAddonAssemblyKitCheckPV.yaml add scope (#3291) 2021-11-23 08:50:46 +01:00
abapAddonAssemblyKitCreateTargetVector.yaml Docu updates abap steps (#2910) 2021-06-17 21:28:15 +02:00
abapAddonAssemblyKitPublishTargetVector.yaml increase default timeout to 16min (#3732) 2022-04-13 09:03:22 +02:00
abapAddonAssemblyKitRegisterPackages.yaml Docu updates abap steps (#2910) 2021-06-17 21:28:15 +02:00
abapAddonAssemblyKitReleasePackages.yaml Abap refactoring (#3340) 2021-12-09 12:54:18 +01:00
abapAddonAssemblyKitReserveNextPackages.yaml Abap refactoring (#3340) 2021-12-09 12:54:18 +01:00
abapEnvironmentAssembleConfirm.yaml Enable classic cts (#3728) 2022-04-12 14:39:42 +02:00
abapEnvironmentAssemblePackages.yaml Enable classic cts (#3728) 2022-04-12 14:39:42 +02:00
abapEnvironmentBuild.yaml Generic step input from addon descriptor (#3467) 2022-02-07 20:34:11 +01:00
abapEnvironmentCheckoutBranch.yaml Cloud Platform -> BTP (#3634) 2022-03-14 15:12:35 +01:00
abapEnvironmentCloneGitRepo.yaml Cloud Platform -> BTP (#3634) 2022-03-14 15:12:35 +01:00
abapEnvironmentCreateSystem.yaml Cloud Platform -> BTP (#3634) 2022-03-14 15:12:35 +01:00
abapEnvironmentCreateTag.yaml Add ABAP step: createTag (#3633) 2022-05-23 15:15:22 +02:00
abapEnvironmentPullGitRepo.yaml Cloud Platform -> BTP (#3634) 2022-03-14 15:12:35 +01:00
abapEnvironmentPushATCSystemConfig.yaml Space removed due to incorrect Link building to Comm.Scen. in long Description (#3593) 2022-03-01 09:23:11 +01:00
abapEnvironmentRunATCCheck.yaml Feature: ATC & AUNIT - ObjectSetLibrary(OSL) usage (#3755) 2022-04-27 13:30:43 +02:00
abapEnvironmentRunAUnitTest.yaml Add easy mode for AUnit & ATC (#3389) 2022-01-12 12:02:27 +01:00
ansSendEvent.yaml [ANS] Step implementation (#3764) 2022-06-21 15:45:07 +02:00
apiKeyValueMapDownload.yaml ApiKeyValueMapDownload Command (#3245) 2021-11-15 13:48:14 +01:00
apiKeyValueMapUpload.yaml ApiKeyValueMapUpload Command (#3407) 2022-03-07 11:03:44 +01:00
apiProviderDownload.yaml New piper step APIProviderDownload contribution (#3349) 2022-03-09 13:07:23 +01:00
apiProviderUpload.yaml ApiProviderUpload Command (#3663) 2022-05-16 11:52:04 +02:00
apiProxyDownload.yaml ApiProxyDownload Command (#3197) 2021-11-02 10:30:08 +01:00
apiProxyList.yaml ApiProxyList Command (#3794) 2022-06-21 13:08:00 +02:00
apiProxyUpload.yaml ApiProxyUpload Command (#3295) 2021-12-28 09:31:50 +01:00
artifactPrepareVersion.yaml feat(artifactPrepareVersion): context-sensitive versioningType (#3579) 2022-03-22 08:31:59 +01:00
awsS3Upload.yaml Create awsS3Upload (#3737) 2022-05-18 10:37:54 +02:00
azureBlobUpload.yaml Create azureBlobUpload (#3766) 2022-06-15 09:41:02 +02:00
batsExecuteTests.yaml convert batsExecuteTests to go implementation (#2737) 2021-04-29 16:50:23 +02:00
checkmarxExecuteScan.yaml feat(checkmarxExecuteScan): convert Checkmarx xml report to SARIF (#3696) 2022-04-04 16:12:35 +02:00
cloudFoundryCreateService.yaml cfcli update (#3777) 2022-05-17 08:53:19 +02:00
cloudFoundryCreateServiceKey.yaml cfcli update (#3777) 2022-05-17 08:53:19 +02:00
cloudFoundryCreateSpace.yaml cfcli update (#3777) 2022-05-17 08:53:19 +02:00
cloudFoundryDeleteService.yaml cfcli update (#3777) 2022-05-17 08:53:19 +02:00
cloudFoundryDeleteSpace.yaml cfcli update (#3777) 2022-05-17 08:53:19 +02:00
cloudFoundryDeploy.yaml cfcli update (#3777) 2022-05-17 08:53:19 +02:00
cnbBuild.yaml cnbBuild: add alias for imageNames for easier valueMapping in helmDeploy (#3822) 2022-06-15 14:17:46 +02:00
containerExecuteStructureTests.yaml fix(dockerOptions) properly pass empty values (#3024) 2021-08-02 10:21:14 +02:00
containerSaveImage.yaml fix (whitesourceExecuteScan) keep tar extension for target image donwload (#3774) 2022-05-13 18:56:41 +02:00
detectExecuteScan.yaml fix(optimization) use proper cpe reference (#3683) 2022-03-31 10:52:54 +02:00
fortifyExecuteScan.yaml fix(fortify):add SSC project identifier to ouput and JSON report (#3787) 2022-05-20 10:24:16 +02:00
gaugeExecuteTests.yaml Add gcs upload to gaugeExecuteTests step (#3410) 2022-01-24 12:13:33 +01:00
gctsCloneRepository.yaml fix(typo): found by misspell (#2064) 2020-09-24 07:41:06 +02:00
gctsCreateRepository.yaml Improve validation of configuration (#3125) 2021-10-01 12:49:05 +02:00
gctsDeploy.yaml disable http retry (#3447) 2022-01-20 10:46:24 +01:00
gctsExecuteABAPQualityChecks.yaml Creating a new scenario for gcts pipeline steps (#3711) 2022-04-07 09:45:14 +02:00
gctsExecuteABAPUnitTests.yaml Creating a new scenario for gcts pipeline steps (#3711) 2022-04-07 09:45:14 +02:00
gctsRollback.yaml Creating a new scenario for gcts pipeline steps (#3711) 2022-04-07 09:45:14 +02:00
githubCheckBranchProtection.yaml enforce that step metadata yaml file is called <step>.yaml (#3226) 2021-11-15 14:20:20 +01:00
githubCommentIssue.yaml enforce that step metadata yaml file is called <step>.yaml (#3226) 2021-11-15 14:20:20 +01:00
githubCreateIssue.yaml enforce that step metadata yaml file is called <step>.yaml (#3226) 2021-11-15 14:20:20 +01:00
githubCreatePullRequest.yaml enforce that step metadata yaml file is called <step>.yaml (#3226) 2021-11-15 14:20:20 +01:00
githubPublishRelease.yaml feat(githubRelease): publish multiple assets (#3702) 2022-04-08 11:29:07 +02:00
githubSetCommitStatus.yaml enforce that step metadata yaml file is called <step>.yaml (#3226) 2021-11-15 14:20:20 +01:00
gitopsUpdateDeployment.yaml feat(gitopsUpdateDeployment) forcePush (#3665) 2022-04-07 16:33:46 +02:00
golangBuild.yaml fix (golang) : publish binaries to custom in cpe (#3767) 2022-05-05 15:06:42 +02:00
gradleExecuteBuild.yaml feat(gradleExecuteBuild, fortifyExecuteScan): gradle improvements (#3807) 2022-06-07 10:24:10 +02:00
hadolintExecute.yaml feat(hadolint): allow config secret from vault (#3353) 2021-12-14 13:42:06 +01:00
helmExecute.yaml fix(helmExecute): respect version from Chart (#3780) 2022-05-18 08:58:01 +02:00
influxWriteData.yaml enforce that step metadata yaml file is called <step>.yaml (#3226) 2021-11-15 14:20:20 +01:00
integrationArtifactDeploy.yaml Remove version from deploy step (#2978) 2021-07-27 09:51:56 +02:00
integrationArtifactDownload.yaml CPI - Improve serviceKey parameter name and description (#2958) 2021-07-01 10:07:57 +02:00
integrationArtifactGetMplStatus.yaml Refactor all instances of iFlow to be integrationFlow (#2992) 2021-08-04 16:42:25 +02:00
integrationArtifactGetServiceEndpoint.yaml Refactor all instances of iFlow to be integrationFlow (#2992) 2021-08-04 16:42:25 +02:00
integrationArtifactResource.yaml IntegrationArtifactResource Command (#3027) 2021-08-12 09:11:02 +02:00
integrationArtifactTriggerIntegrationTest.yaml Refactor all instances of iFlow to be integrationFlow (#2992) 2021-08-04 16:42:25 +02:00
integrationArtifactUnDeploy.yaml IntegrationArtifactUnDeploy Command (#3018) 2021-08-02 16:27:16 +02:00
integrationArtifactUpdateConfiguration.yaml CPI - Improve serviceKey parameter name and description (#2958) 2021-07-01 10:07:57 +02:00
integrationArtifactUpload.yaml Make packageId optional (#3019) 2021-07-29 14:29:47 +02:00
isChangeInDevelopment.yaml Implement Release 3.0.0 of CM-Client (#3664) 2022-04-05 12:33:19 +02:00
jsonApplyPatch.yaml Add schema patch step in go (#1683) 2020-06-18 14:50:46 +02:00
kanikoExecute.yaml feat(kanikoExecute): Trim names for multi-image builds (#3617) 2022-03-11 09:47:44 +01:00
karmaExecuteTests.yaml Add gcs upload to karmaExecuteTests step (#3431) 2022-01-24 12:06:35 +01:00
kubernetesDeploy.yaml chore(kubernetesDeploy): bump docker image to helm 3.8.1 (#3470) 2022-03-30 13:23:16 +02:00
malwareExecuteScan.yaml feat(docker): use crane for pulling docker images (#3652) 2022-03-23 10:02:00 +01:00
mavenBuild.yaml feat: support cpe credentials for multiple repos (#3641) 2022-03-17 08:01:00 +01:00
mavenExecute.yaml Remove image pull policy from steps defaults (#2310) 2020-11-05 10:58:32 +01:00
mavenExecuteIntegration.yaml Add gcs upload to mavenExecuteIntegration step (#3432) 2022-01-20 08:18:57 +01:00
mavenExecuteStaticCodeChecks.yaml enforce that step metadata yaml file is called <step>.yaml (#3226) 2021-11-15 14:20:20 +01:00
mtaBuild.yaml feat: support cpe credentials for multiple repos (#3641) 2022-03-17 08:01:00 +01:00
newmanExecute.yaml Add gcs upload to newmanExecute step (#3408) 2022-01-24 12:21:41 +01:00
nexusUpload.yaml chore(mbt): update mbt image (#3186) 2021-11-15 14:04:16 +01:00
npmExecuteLint.yaml feat(npmExecuteLint): support to run package installation and usage of custom runScript (#3191) 2021-10-22 13:01:22 +02:00
npmExecuteScripts.yaml feat: support cpe credentials for multiple repos (#3641) 2022-03-17 08:01:00 +01:00
pipelineCreateScanSummary.yaml feat(pipelineCreateSummary): enhance content with reference link (#2837) 2021-05-19 07:57:44 +02:00
protecodeExecuteScan.yaml feat(docker): use crane for pulling docker images (#3652) 2022-03-23 10:02:00 +01:00
pythonBuild.yaml feat (pythonBuild) enable creation of a virtual environment (venv) (#3746) 2022-04-26 14:15:24 +02:00
shellExecute.yaml feat (shellExecute) extend shellExecute to accept script arguments (#3823) 2022-06-10 16:10:46 +02:00
sonarExecuteScan.yaml Adjust sonarExecuteScan step (#3527) 2022-02-25 13:09:50 +01:00
terraformExecute.yaml fix(vault): update terraform secretName parameter to follow naming convention (#3365) 2021-12-15 20:12:57 +01:00
transportRequestDocIDFromGit.yaml solman upload split git documentation (#2831) 2021-06-10 10:16:22 +02:00
transportRequestReqIDFromGit.yaml RFC Upload Documentation (#2922) 2021-07-08 11:07:08 +02:00
transportRequestUploadCTS.yaml TransportRequestUploadFile migration to Go - CTS (#3098) 2021-09-16 13:18:03 +02:00
transportRequestUploadRFC.yaml RFC Upload Documentation (#2922) 2021-07-08 11:07:08 +02:00
transportRequestUploadSOLMAN.yaml Implement Release 3.0.0 of CM-Client (#3664) 2022-04-05 12:33:19 +02:00
uiVeri5ExecuteTests.yaml Add gcs upload to uiVeri5ExecuteTests step (#3409) 2022-01-24 15:18:27 +01:00
vaultRotateSecretId.yaml chore: align Vault naming (#3372) 2021-12-21 11:52:10 +01:00
whitesourceExecuteScan.yaml fix(optimization) use proper cpe reference (#3683) 2022-03-31 10:52:54 +02:00
xsDeploy.yaml Remove image pull policy from steps defaults (#2310) 2020-11-05 10:58:32 +01:00