Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: Separate keptn configure monitoring from keptnInit (Breaking change) #80

Closed
2 tasks
christian-kreuzberger-dtx opened this issue Jan 24, 2022 · 2 comments · Fixed by #93
Closed
2 tasks
Assignees
Labels
breaking-change type:feature New feature or request that provides value to the stakeholders/end-users

Comments

@christian-kreuzberger-dtx
Copy link
Contributor

Problem statement.
As a user I would like to create a project, add some files (slo, sli, additional configuration), and then configure monitoring afterwards.

E.g.:

    stage('Initialize Keptn Project') {
        // Initialize the Keptn Project - ensures the Keptn Project is created with the passed shipyard
        keptn.keptnInit project:"${project}", service:"${service}", stage:"${firststage}", shipyard: ".keptn/shipyard.yaml"
    }

    stage('Add files to Keptn Project') {
        // Upload quality gate files
        keptn.keptnAddResources('keptn/dynatrace/dynatrace.conf.yaml','dynatrace/dynatrace.conf.yaml')
        // Upload SLI and SLO files
        keptn.keptnAddResources('.keptn/dynatrace/sli.yaml','dynatrace/sli.yaml')
        keptn.keptnAddResources('.keptn/slo.yaml','slo.yaml')
    }

    stage('Configure monitoring solution') {
        keptn.keptnConfigureMonitoring('dynatrace')
    }

Current functionality

At the moment this functionaltiy is hidden within the keptnInit function, e.g.:

        keptn.keptnInit project:"${project}", service:"${service}", stage:"${firststage}", monitoring: "dynatrace", shipyard: ".keptn/shipyard.yaml"

However, depending on the monitoring solution this might fail, because additional files are required (dynatrace.conf, sli.yaml, slo.yaml).

Definition of Done

  • New function keptnConfigureMonitoring implemented and documented in README
  • keptnInit parameter monitoring removed (BREAKING CHANGE)
@pcjeffmac
Copy link
Contributor

I set my pipeline to use this release,

@Library('[email protected]')_
import sh.keptn.Keptn
def keptn = new sh.keptn.Keptn()

I changed my pipeline to use the new function,
keptn.keptnConfigureMonitoring monitoring:"dynatrace"

However, I get this error in the Jenkins console.

hudson.remoting.ProxyException: groovy.lang.MissingPropertyException: No such property: keptnEnrichedArgs for class: sh.keptn.Keptn
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:66)
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:471)
	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.getProperty(DefaultInvoker.java:39)
	at com.cloudbees.groovy.cps.impl.PropertyAccessBlock.rawGet(PropertyAccessBlock.java:20)
	at sh.keptn.Keptn.keptnConfigureMonitoring(Keptn.groovy:222)
	at WorkflowScript.run(WorkflowScript:43)
	at ___cps.transform___(Native Method)
	at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.get(PropertyishBlock.java:74)
	at com.cloudbees.groovy.cps.LValueBlock$GetAdapter.receive(LValueBlock.java:30)
	at com.cloudbees.groovy.cps.impl.PropertyishBlock$ContinuationImpl.fixName(PropertyishBlock.java:66)
	at jdk.internal.reflect.GeneratedMethodAccessor300.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at com.cloudbees.groovy.cps.impl.ContinuationPtr$ContinuationImpl.receive(ContinuationPtr.java:72)
	at com.cloudbees.groovy.cps.impl.ConstantBlock.eval(ConstantBlock.java:21)
	at com.cloudbees.groovy.cps.Next.step(Next.java:83)
	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:174)
	at com.cloudbees.groovy.cps.Continuable$1.call(Continuable.java:163)
	at org.codehaus.groovy.runtime.GroovyCategorySupport$ThreadCategoryInfo.use(GroovyCategorySupport.java:136)
	at org.codehaus.groovy.runtime.GroovyCategorySupport.use(GroovyCategorySupport.java:275)
	at com.cloudbees.groovy.cps.Continuable.run0(Continuable.java:163)
	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.access$001(SandboxContinuable.java:18)
	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:402)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:314)
	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:278)
	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:139)
	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Finished: FAILURE

@christian-kreuzberger-dtx
Copy link
Contributor Author

@pcjeffmac I am moving your issue to #96

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change type:feature New feature or request that provides value to the stakeholders/end-users
Projects
None yet
3 participants