Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Artefact Retention Policy (QB-3.1.37) #1538

Jonathan ·
Hello there,

If I make a change to my Artefact Retention Policy, specifically reduce the maximum number of builds that are persisted, when should I see the new policy take effect?

Many thanks
  • replies 15
  • views 5482
  • stars 0
robinshen ADMIN ·
QuickBuild cleans up artifacts based on retention policy every night (12:00PM). So it will see artifacts being cleaned up next morning.
Jonathan ·
That would imply that I have made an error somewhere. My retention policy is set as.

"Retain artifacts for a specified number of builds" with the value of ${vars.getValue("artefacts_time_to_live")}

artefacts_time_to_live has been set to 30, however I still see over 560 builds in one configuration even though this was set yesterday.

Is there any reason why this approach should not work?

Many thanks
robinshen ADMIN ·
Hi Jonathan,

This only cleans up artifacts (files published by "publish artifacts" step) of the build , and leave other records intact, including build entry, changes, and reports.

To remove the build records completely, please switch to "advanced setting" of the configuration, and set "cleanup strategy" there.

Regards
Robin
Jonathan ·
Okay, I misunderstood the purpose of the "Artefact Retention Policy" setting, however:

I went back and checked the artefacts from the configuration in question. I found that I was able to view and download artefacts from older builds than those specified in my artefact retention policy.

Moreover, I noticed that the Cleanup Strategy Reserve Days and Reserve Count edit boxes do not sport the icon which suggests you can embed scripts, does this mean that the Cleanup Strategy does not support scripting?

Regards
Jonathan
robinshen ADMIN ·
If artifact retention does not work, please check QB system log at around 12:00PM to see if there are any errors printed. For build cleanup strategy, the fields you mentioned does not support scripting by now, please submit an improvement request for that at track.pmease.com.

Regards
Robin
Jonathan ·
I have submitted a change request to enable scripting in the Build Cleanup Strategy fields: http://track.pmease.com/browse/QB-1004.

I have also looked back at the quickbuild.log.x files for my server, unfortunately due to the amount of logging it appears that no more than 4 hours of logs are being saved. Is there anyway that I can increase the number of log entries that are stored in each file before they roll over. Or failing that simply lower the logging level to only record errors?
robinshen ADMIN ·
The entry "log4j.appender.file.MaxFileSize" and "log4j.appender.file.MaxBackupIndx" in "conf/log4j.properties" allows to tune system log size and retention time.
Jonathan ·
Okay, the logging is working:

My Artifact Retention Policy is as follows (defined in the root):
Setting - Retain artifacts for specified number of builds
Value - ${vars.getValue("artefacts_time_to_live")}

The relevant variable (also defined in the root):
Name - artefacts_time_to_live
Value - 0

However this threw the follow exception:

2011-08-08 00:00:00,207 [DefaultQuartzScheduler_Worker-45] ERROR org.quartz.core.JobRunShell - Job default.841f83b0-da78-4eeb-82b7-92070b0185fd threw an unhandled Exception:
com.pmease.quickbuild.QuickbuildException: Failed to evaluate below expression:
mvel:vars.getValue("artefacts_time_to_live")
at com.pmease.quickbuild.util.ExceptionUtils.wrapException(ExceptionUtils.java:90)
at com.pmease.quickbuild.DefaultScriptEngine.evaluate(DefaultScriptEngine.java:93)
at com.pmease.quickbuild.DefaultScriptEngine.interpolate(DefaultScriptEngine.java:105)
at com.pmease.quickbuild.DefaultScriptEngine$Interpolator.intercept(DefaultScriptEngine.java:282)
at com.pmease.quickbuild.plugin.artifact.RetainByBuilds$$EnhancerByCGLIB$$9c70a7d8.getBuilds(<generated>)
at com.pmease.quickbuild.plugin.artifact.RetainByBuilds.getCount(RetainByBuilds.java:30)
at com.pmease.quickbuild.plugin.artifact.RetainByBuilds$$EnhancerByCGLIB$$9c70a7d8.CGLIB$getCount$2(<generated>)
at com.pmease.quickbuild.plugin.artifact.RetainByBuilds$$EnhancerByCGLIB$$9c70a7d8$$FastClassByCGLIB$$f019a8fa.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215)
at com.pmease.quickbuild.DefaultScriptEngine$Interpolator.intercept(DefaultScriptEngine.java:273)
at com.pmease.quickbuild.plugin.artifact.RetainByBuilds$$EnhancerByCGLIB$$9c70a7d8.getCount(<generated>)
at com.pmease.quickbuild.plugin.artifact.ArtifactCleanupVisitor.visit(ArtifactCleanupVisitor.java:28)
at com.pmease.quickbuild.entitymanager.impl.DefaultBuildManager.execute(DefaultBuildManager.java:418)
at com.pmease.quickbuild.taskschedule.DefaultTaskScheduler$HelperTask.execute(DefaultTaskScheduler.java:103)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: [Error: vars.getValue("artefacts_time_to_live"): null]
[Near : {... Unknown ....}]
^
[Line: 1, Column: 0]
at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:372)
at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:137)
at org.mvel2.optimizers.dynamic.DynamicOptimizer.optimizeAccessor(DynamicOptimizer.java:63)
at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:137)
at org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:41)
at org.mvel2.MVEL.executeExpression(MVEL.java:1053)
at com.pmease.quickbuild.plugin.basis.BasisPlugin$12.evaluate(BasisPlugin.java:155)
at com.pmease.quickbuild.DefaultScriptEngine.evaluate(DefaultScriptEngine.java:87)
... 14 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:957)
at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:314)
... 21 more
Caused by: java.lang.NullPointerException
at com.pmease.quickbuild.variable.VariableAccessor.get(VariableAccessor.java:50)
at com.pmease.quickbuild.variable.VariableAccessor.getValue(VariableAccessor.java:56)
... 27 more
2011-08-08 00:00:00,208 [DefaultQuartzScheduler_Worker-45] ERROR org.quartz.core.ErrorLogger - Job (default.841f83b0-da78-4eeb-82b7-92070b0185fd threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: com.pmease.quickbuild.QuickbuildException: Failed to evaluate below expression:
mvel:vars.getValue("artefacts_time_to_live")]
at org.quartz.core.JobRunShell.run(JobRunShell.java:227)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: com.pmease.quickbuild.QuickbuildException: Failed to evaluate below expression:
mvel:vars.getValue("artefacts_time_to_live")
at com.pmease.quickbuild.util.ExceptionUtils.wrapException(ExceptionUtils.java:90)
at com.pmease.quickbuild.DefaultScriptEngine.evaluate(DefaultScriptEngine.java:93)
at com.pmease.quickbuild.DefaultScriptEngine.interpolate(DefaultScriptEngine.java:105)
at com.pmease.quickbuild.DefaultScriptEngine$Interpolator.intercept(DefaultScriptEngine.java:282)
at com.pmease.quickbuild.plugin.artifact.RetainByBuilds$$EnhancerByCGLIB$$9c70a7d8.getBuilds(<generated>)
at com.pmease.quickbuild.plugin.artifact.RetainByBuilds.getCount(RetainByBuilds.java:30)
at com.pmease.quickbuild.plugin.artifact.RetainByBuilds$$EnhancerByCGLIB$$9c70a7d8.CGLIB$getCount$2(<generated>)
at com.pmease.quickbuild.plugin.artifact.RetainByBuilds$$EnhancerByCGLIB$$9c70a7d8$$FastClassByCGLIB$$f019a8fa.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215)
at com.pmease.quickbuild.DefaultScriptEngine$Interpolator.intercept(DefaultScriptEngine.java:273)
at com.pmease.quickbuild.plugin.artifact.RetainByBuilds$$EnhancerByCGLIB$$9c70a7d8.getCount(<generated>)
at com.pmease.quickbuild.plugin.artifact.ArtifactCleanupVisitor.visit(ArtifactCleanupVisitor.java:28)
at com.pmease.quickbuild.entitymanager.impl.DefaultBuildManager.execute(DefaultBuildManager.java:418)
at com.pmease.quickbuild.taskschedule.DefaultTaskScheduler$HelperTask.execute(DefaultTaskScheduler.java:103)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
... 1 more
Caused by: [Error: vars.getValue("artefacts_time_to_live"): null]
[Near : {... Unknown ....}]
^
[Line: 1, Column: 0]
at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:372)
at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:137)
at org.mvel2.optimizers.dynamic.DynamicOptimizer.optimizeAccessor(DynamicOptimizer.java:63)
at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:137)
at org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:41)
at org.mvel2.MVEL.executeExpression(MVEL.java:1053)
at com.pmease.quickbuild.plugin.basis.BasisPlugin$12.evaluate(BasisPlugin.java:155)
at com.pmease.quickbuild.DefaultScriptEngine.evaluate(DefaultScriptEngine.java:87)
... 14 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:957)
at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:314)
... 21 more
Caused by: java.lang.NullPointerException
at com.pmease.quickbuild.variable.VariableAccessor.get(VariableAccessor.java:50)
at com.pmease.quickbuild.variable.VariableAccessor.getValue(VariableAccessor.java:56)
... 27 more
robinshen ADMIN ·
This is a bug when use scripts in retention field. Will be fixed in next patch release.
drdt ·
Is this also fixed in 4.0 Beta? I am not seeing my artifacts being cleaned up at all and i am also using a variable.
robinshen ADMIN ·
Yes, this is included in 4.0 M2. However artifacts are only cleaned up overnight. If not, please watch the system log to see if there is any errors printed.
norman ·
I'd like to see a checkbox that says "Keep recommended builds", so good builds can be kept for as long as desired while normal cleanup occurs.
robinshen ADMIN ·
Please file an improvement request for this at track.pmease.com
Productivity ·
Was the "Keep recommended builds" suggestion ever implemented? I think it is a pretty good idea to keep some build artifacts indefinitely, no matter what is the artifact cleanup strategy.

Also, if there could be a way to manually delete a recommended build's artifacts that was preserved that way (because we don't need it anymore), it would be even better.
robinshen ADMIN ·
Since there are different requirements to build cleanup. We suggest to do it with a maintenance configuration running customized script. A tutorial is created here on how to do the job:
http://wiki.pmease.com/display/QB50/Com ... p+Strategy