Skip to content

Commit

Permalink
feat: remove SAP web analytics reporting (#4773)
Browse files Browse the repository at this point in the history
* improve vault logging

* remove swa calls

* Revert "improve vault logging"

This reverts commit 8335bbf.
  • Loading branch information
CCFenner authored Jan 15, 2024
1 parent 86a59eb commit 70b860f
Show file tree
Hide file tree
Showing 45 changed files with 2 additions and 261 deletions.
7 changes: 1 addition & 6 deletions src/com/sap/piper/Utils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,7 @@ def generateSha1(input) {

void pushToSWA(Map parameters, Map config) {
try {
parameters.actionName = parameters.get('actionName') ?: 'Piper Library OS'
parameters.eventType = parameters.get('eventType') ?: 'library-os'
parameters.jobUrlSha1 = generateSha1(env.JOB_URL ?: '')
parameters.buildUrlSha1 = generateSha1(env.BUILD_URL ?: '')

Telemetry.notify(this, config, parameters)
echo "SAP web analytics is disabled. Please remove any remaining use of 'pushToSWA' function!"
} catch (ignore) {
// some error occured in telemetry reporting. This should not break anything though.
echo "[${parameters.step}] Telemetry Report failed: ${ignore.getMessage()}"
Expand Down
10 changes: 0 additions & 10 deletions vars/artifactSetVersion.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,6 @@ void call(Map parameters = [:], Closure body = null) {
config = configHelper.addIfEmpty('timestamp', getTimestamp(config.timestampTemplate))
.use()

new Utils().pushToSWA([
step: STEP_NAME,
stepParamKey1: 'buildTool',
stepParam1: config.buildTool,
stepParamKey2: 'artifactType',
stepParam2: config.artifactType,
stepParamKey3: 'scriptMissing',
stepParam3: parameters?.script == null
], config)

def artifactVersioning = ArtifactVersioning.getArtifactVersioning(config.buildTool, script, config)
def currentVersion = artifactVersioning.getVersion()

Expand Down
3 changes: 0 additions & 3 deletions vars/buildExecute.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ void call(Map parameters = [:]) {
.addIfEmpty('buildTool', script.commonPipelineEnvironment.getBuildTool())
.use()

// telemetry reporting
utils.pushToSWA([stepParam1: config.buildTool, 'buildTool': config.buildTool], config)

switch(config.buildTool){
case 'maven':
mavenBuild script: script
Expand Down
8 changes: 1 addition & 7 deletions vars/checkChangeInDevelopment.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,6 @@ void call(parameters = [:]) {
// for the following parameters we expect a value provided from outside
.withMandatoryProperty('changeManagement/endpoint')

new Utils().pushToSWA([
step: STEP_NAME,
stepParamKey1: 'scriptMissing',
stepParam1: parameters?.script == null
], configuration)

def changeId = getChangeDocumentId(script, configuration)

configuration = configHelper.mixin([changeDocumentId: changeId?.trim() ?: null], ['changeDocumentId'] as Set)
Expand Down Expand Up @@ -186,4 +180,4 @@ static void addPipelineWarning(Script script, String heading, String message) {
"""

script.createSummary(icon: "warning.gif", text: html)
}
}
6 changes: 0 additions & 6 deletions vars/checksPublishResults.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,6 @@ void call(Map parameters = [:]) {
error "[ERROR] Configuration of the aggregation view is no longer possible. Migrate any thresholds defined here to tool specific quality gates. (piper-lib/${STEP_NAME})"
}

new Utils().pushToSWA([
step: STEP_NAME,
stepParamKey1: 'scriptMissing',
stepParam1: parameters?.script == null
], configuration)

// JAVA
if(configuration.pmd.active) {
report(pmdParser(createToolOptions(configuration.pmd)), configuration.pmd, configuration.archive)
Expand Down
5 changes: 0 additions & 5 deletions vars/containerPushToRegistry.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ void call(Map parameters = [:]) {
config.sourceRegistry = dockerUtils.getRegistryFromUrl(config.sourceRegistryUrl)
}

// telemetry reporting
new Utils().pushToSWA([
step: STEP_NAME
], config)

if (!config.dockerImage)
config.dockerImage = config.sourceImage

Expand Down
6 changes: 0 additions & 6 deletions vars/debugReportArchive.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ void call(Map parameters = [:]) {
.mixin(parameters, PARAMETER_KEYS)
.use()

utils.pushToSWA([
step: STEP_NAME,
stepParamKey1: 'scriptMissing',
stepParam1: parameters?.script == null
], configuration)

boolean shareConfidentialInformation = configuration?.get('shareConfidentialInformation') ?: false

Map result = DebugReport.instance.generateReport(script, shareConfidentialInformation)
Expand Down
8 changes: 0 additions & 8 deletions vars/dockerExecute.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,6 @@ void call(Map parameters = [:], body) {

SidecarUtils sidecarUtils = new SidecarUtils(script)

utils.pushToSWA([
step: STEP_NAME,
stepParamKey1: 'scriptMissing',
stepParam1: parameters?.script == null,
stepParamKey2: 'kubernetes',
stepParam2: isKubernetes()
], config)

if (isKubernetes() && config.dockerImage) {
List dockerEnvVars = []
config.dockerEnvVars?.each { key, value ->
Expand Down
6 changes: 0 additions & 6 deletions vars/dockerExecuteOnKubernetes.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,6 @@ void call(Map parameters = [:], body) {
.addIfEmpty('uniqueId', UUID.randomUUID().toString())
.use()

utils.pushToSWA([
step : STEP_NAME,
stepParamKey1: 'scriptMissing',
stepParam1 : parameters?.script == null
], config)

if (!config.containerMap && config.dockerImage) {
config.containerName = 'container-exec'
config.containerMap = [(config.get('dockerImage')): config.containerName]
Expand Down
6 changes: 0 additions & 6 deletions vars/dubExecute.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ void call(Map parameters = [:], body = null) {
.mixin(parameters, PARAMETER_KEYS)
.use()

new Utils().pushToSWA([
step: STEP_NAME,
stepParamKey1: 'scriptMissing',
stepParam1: parameters?.script == null
], configuration)

if (!fileExists('dub.json') && !fileExists('dub.sdl')) {
error "[${STEP_NAME}] Neither dub.json nor dub.sdl was found."
}
Expand Down
6 changes: 0 additions & 6 deletions vars/gatlingExecuteTests.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ void call(Map parameters = [:]) {
.withMandatoryProperty('pomPath')
.use()

utils.pushToSWA([
step: STEP_NAME,
stepParamKey1: 'pomPath',
stepParam1: config.pomPath,
], config)

def appUrls = parameters.get('appUrls')
if (appUrls && !(appUrls instanceof List)) {
error "The optional parameter 'appUrls' needs to be a List of Maps, where each Map contains the two entries 'url' and 'credentialsId'."
Expand Down
2 changes: 0 additions & 2 deletions vars/healthExecuteCheck.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ void call(Map parameters = [:]) {
.withMandatoryProperty('testServerUrl')
.use()

new Utils().pushToSWA([step: STEP_NAME], config)

def checkUrl = config.testServerUrl
if(config.healthEndpoint){
if(!checkUrl.endsWith('/'))
Expand Down
6 changes: 0 additions & 6 deletions vars/influxWriteData.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ void call(Map parameters = [:]) {
.addIfNull('customDataMapTags', InfluxData.getInstance().getTags().findAll({ it.key != 'jenkins_custom_data' }))
.use()

new Utils().pushToSWA([
step: STEP_NAME,
stepParamKey1: 'scriptMissing',
stepParam1: parameters?.script == null
], config)

if (!config.artifactVersion) {
//this takes care that terminated builds due to milestone-locking do not cause an error
echo "[${STEP_NAME}] no artifact version available -> exiting writeInflux without writing data"
Expand Down
2 changes: 0 additions & 2 deletions vars/mailSendNotification.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ void call(Map parameters = [:]) {
.mixin(parameters, PARAMETER_KEYS)
.use()

new Utils().pushToSWA([step: STEP_NAME], config)

//this takes care that terminated builds due to milestone-locking do not cause an error
if (script.commonPipelineEnvironment.getBuildResult() == 'ABORTED') return

Expand Down
6 changes: 0 additions & 6 deletions vars/multicloudDeploy.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,6 @@ void call(parameters = [:]) {

Map config = configHelper.use()

utils.pushToSWA([
step : STEP_NAME,
stepParamKey1: 'enableZeroDowntimeDeployment',
stepParam1 : config.enableZeroDowntimeDeployment
], config)

def index = 1
def deployments = [:]

Expand Down
10 changes: 0 additions & 10 deletions vars/neoDeploy.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,6 @@ void call(parameters = [:]) {
if(deployMode != DeployMode.MTA && ! extensionFileNames.isEmpty())
error "Extensions (${extensionFileNames} found for deploy mode ${deployMode}. Extensions are only supported for deploy mode '${DeployMode.MTA}')"

utils.pushToSWA([
step: STEP_NAME,
stepParamKey1: 'deployMode',
stepParam1: configuration.deployMode == 'mta'?'mta':'war', // ['mta', 'warParams', 'warPropertiesFile']
stepParamKey2: 'warAction',
stepParam2: configuration.warAction == 'rolling-update'?'blue-green':'standard', // ['deploy', 'deploy-mta', 'rolling-update']
stepParamKey3: 'scriptMissing',
stepParam3: parameters?.script == null,
], configuration)

if(configuration.neo.credentialType == 'UsernamePassword'){
withCredentials([usernamePassword(
credentialsId: configuration.neo.credentialsId,
Expand Down
6 changes: 0 additions & 6 deletions vars/npmExecute.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ void call(Map parameters = [:], body = null) {
.mixin(parameters, PARAMETER_KEYS)
.use()

new Utils().pushToSWA([
step: STEP_NAME,
stepParamKey1: 'scriptMissing',
stepParam1: parameters?.script == null
], configuration)

try {
if (!fileExists('package.json')) {
error "[${STEP_NAME}] package.json is not found."
Expand Down
6 changes: 0 additions & 6 deletions vars/pipelineStashFilesAfterBuild.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ void call(Map parameters = [:]) {
.mixin(parameters, PARAMETER_KEYS)
.use()

utils.pushToSWA([
step: STEP_NAME,
stepParamKey1: 'scriptMissing',
stepParam1: parameters?.script == null
], config)

config.stashIncludes.each {stashKey, stashIncludes ->
def useDefaultExcludes = !config.noDefaultExludes.contains(stashKey)
utils.stashWithMessage(stashKey, "[${STEP_NAME}] no files detected for stash '${stashKey}': ", stashIncludes, config.stashExcludes[stashKey]?:'', useDefaultExcludes)
Expand Down
6 changes: 0 additions & 6 deletions vars/pipelineStashFilesBeforeBuild.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ void call(Map parameters = [:]) {
.mixin(parameters, PARAMETER_KEYS)
.use()

utils.pushToSWA([
step: STEP_NAME,
stepParamKey1: 'scriptMissing',
stepParam1: parameters?.script == null
], config)

config.stashIncludes.each {stashKey, stashIncludes ->
def useDefaultExcludes = !config.noDefaultExludes.contains(stashKey)
utils.stashWithMessage(stashKey, "[${STEP_NAME}] no files detected for stash '${stashKey}': ", stashIncludes, config.stashExcludes[stashKey]?:'', useDefaultExcludes)
Expand Down
4 changes: 0 additions & 4 deletions vars/piperPipelineStageAcceptance.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ void call(Map parameters = [:]) {
.use()

piperStageWrapper (script: script, stageName: stageName) {

// telemetry reporting
utils.pushToSWA([step: STEP_NAME], config)

// Prefer the newer multicloudDeploy step if it is configured as it is more capable
if (config.multicloudDeploy) {
durationMeasure(script: script, measurementName: 'deploy_test_multicloud_duration') {
Expand Down
4 changes: 0 additions & 4 deletions vars/piperPipelineStageAdditionalUnitTests.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ void call(Map parameters = [:]) {
.use()

piperStageWrapper (script: script, stageName: stageName) {

// telemetry reporting
utils.pushToSWA([step: STEP_NAME], config)

if (config.batsExecuteTests) {
durationMeasure(script: script, measurementName: 'bats_duration') {
batsExecuteTests script: script
Expand Down
4 changes: 0 additions & 4 deletions vars/piperPipelineStageBuild.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ void call(Map parameters = [:]) {
.use()

piperStageWrapper (script: script, stageName: stageName) {

// telemetry reporting
utils.pushToSWA([step: STEP_NAME], config)

durationMeasure(script: script, measurementName: 'build_duration') {

buildExecute script: script
Expand Down
4 changes: 0 additions & 4 deletions vars/piperPipelineStageCompliance.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ void call(Map parameters = [:]) {
.use()

piperStageWrapper (script: script, stageName: stageName) {

// telemetry reporting
utils.pushToSWA([step: STEP_NAME], config)

if (config.sonarExecuteScan) {
durationMeasure(script: script, measurementName: 'sonar_duration') {
sonarExecuteScan script: script
Expand Down
3 changes: 0 additions & 3 deletions vars/piperPipelineStageInit.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,6 @@ void call(Map parameters = [:]) {
echo "piper-lib-os configuration: ${script.commonPipelineEnvironment.configuration}"
}

// telemetry reporting
utils.pushToSWA([step: STEP_NAME], config)

piperInitRunStageConfiguration script: script, stageConfigResource: config.stageConfigResource

// CHANGE_ID is set only for pull requests
Expand Down
4 changes: 0 additions & 4 deletions vars/piperPipelineStageIntegration.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ void call(Map parameters = [:]) {
.use()

piperStageWrapper (script: script, stageName: stageName) {

// telemetry reporting
utils.pushToSWA([step: STEP_NAME], config)

boolean publishResults = false
try {
writeTemporaryCredentials(script: script) {
Expand Down
4 changes: 0 additions & 4 deletions vars/piperPipelineStageMavenStaticCodeChecks.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ void call(Map parameters = [:]) {
.use()

piperStageWrapper(stageName: stageName, script: script) {

// telemetry reporting
utils.pushToSWA([step: STEP_NAME], config)

if (config.mavenExecuteStaticCodeChecks) {
mavenExecuteStaticCodeChecks(script: script)
}
Expand Down
4 changes: 0 additions & 4 deletions vars/piperPipelineStagePRVoting.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ void call(Map parameters = [:]) {
.use()

piperStageWrapper (script: script, stageName: stageName) {

// telemetry reporting
utils.pushToSWA([step: STEP_NAME], config)

durationMeasure(script: script, measurementName: 'voter_duration') {

//prevent push to registry in case of docker/kaniko
Expand Down
4 changes: 0 additions & 4 deletions vars/piperPipelineStagePerformance.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ void call(Map parameters = [:]) {
.use()

piperStageWrapper (script: script, stageName: stageName) {

// telemetry reporting
utils.pushToSWA([step: STEP_NAME], config)

if (config.multicloudDeploy) {
durationMeasure(script: script, measurementName: 'deploy_performance_multicloud_duration') {
multicloudDeploy(script: script, stage: stageName)
Expand Down
3 changes: 0 additions & 3 deletions vars/piperPipelineStagePost.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ void call(Map parameters = [:]) {
vaultRotateSecretId script: script
}

// telemetry reporting
utils.pushToSWA([step: STEP_NAME], config)

influxWriteData script: script
if(env.BRANCH_NAME == parameters.script.commonPipelineEnvironment.getStepConfiguration('', '').productiveBranch) {
if(parameters.script.commonPipelineEnvironment.configuration.runStep?.get('Post Actions')?.slackSendNotification) {
Expand Down
4 changes: 0 additions & 4 deletions vars/piperPipelineStagePromote.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ void call(Map parameters = [:]) {
.use()

piperStageWrapper (script: script, stageName: stageName) {

// telemetry reporting
utils.pushToSWA([step: STEP_NAME], config)

durationMeasure(script: script, measurementName: 'promote_duration') {
if (config.containerPushToRegistry) {
containerPushToRegistry script: script
Expand Down
4 changes: 0 additions & 4 deletions vars/piperPipelineStageRelease.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ void call(Map parameters = [:]) {
.use()

piperStageWrapper (script: script, stageName: stageName) {

// telemetry reporting
utils.pushToSWA([step: STEP_NAME], config)

// Prefer the newer multicloudDeploy step if it is configured as it is more capable
if (config.multicloudDeploy) {
durationMeasure(script: script, measurementName: 'deploy_release_multicloud_duration') {
Expand Down
3 changes: 0 additions & 3 deletions vars/piperPipelineStageSecurity.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ void call(Map parameters = [:]) {
}

if (securityScanMap.size() > 0) {
// telemetry reporting
utils.pushToSWA([step: STEP_NAME], config)

parallel securityScanMap.plus([failFast: false])
}
}
Expand Down
Loading

0 comments on commit 70b860f

Please sign in to comment.