<< Back to previous view

[QB-3568] Able to create user custom function in somewhere and share in everywhere.
Created: 07/May/20  Updated: 19/Feb/21

Status: Closed
Project: QuickBuild
Component/s: None
Affects Version/s: 10.0.11
Fix Version/s: None

Type: New Feature Priority: Major
Reporter: Jerry Lee Assigned To: Robin Shen
Resolution: Won't Fix Votes: 0
Remaining Estimate: 4 weeks Time Spent: Unknown
Original Estimate: 4 weeks
Environment: N/A


 Description   
Hello, I have an query to improve QuickBuild's admin experience.

In my case, I've implemented various steps to make essential system.
Usually, I create the function(func_A) in steps to use.
Therefore, to change the function(func_A), I need to modify all the steps where that function(func_A) located.
Sometimes, it causes human error and hard to change it.

I'm not sure that this is an good idea but I would like to ask you.

If user could implement user defined function(func_A) in somewhere like Configuration, Plugin and QuickBuild could share, it would be very nice.
A function(func_A) need to be written at once and steps and variables do not need to re-write that whole function(func_A) all the time.

Of course I know that it could be done by adding function(func_A) in QuickBuild source code, but it requires restart to apply it when it modified.

So, if it is possoble, why don't you implment this kind of feature in QuickBuild?
Thanks.

 Comments   
Comment by Robin Shen [ 07/May/20 10:28 AM ]
You may define a variable named "funcA" say in root configuration with value set to body of that function, and use groovy's Eval facility to evaluate value of variable "funcA" as code like below:

groovy:
Eval.me(vars.getValue("context", ["build":build, "configuration":configuration], "funcA"));

Inside body of funcA you may access context.build, context.configuration to currently running build/configuration. etc.
Generated at Fri Apr 26 21:21:04 UTC 2024 using JIRA 189.