Force user to select a build in Dependencies dropdown
Answered
We have set up Artifact Dependencies in some of our jobs. When a user run the Custom Build dialog, he can skip the Dependencies dropdown since it always have an auto selection (in our case it is Last successful build).
Is there a way to force the user to select a dependency in that dropdown?
Thank you in advance.
Kind regards,
F.
Please sign in to leave a comment.
Hello Fernando,
Unfortunately, looks like this is not possible in current implementation. Could you please shed some light on why this feature could come handy to you, e.g. what is the use case where user should be forced to choose a dependency?
Thank you for your answer, Fedor.
In the case of some important tasks, where dependency selection is critical, some users tend to run the task without selecting a dependency, running it with the auto dependency.
For these cases where choosing the correct dependency is critical for the project, forcing the user to choose one manually would avoid some problems.
Hello Fernando,
Thank you for the details! Just got another question; let us take parameters as an example. You could define a parameter to be prompted on each build start, but if such build is started as a dependency, build with a prompted parameter would still run - the parameter in question would come in empty, though. What behavior would you expect for the artifact dependency which is prompted - e.g. requires explicit choice from user side - if a build itself is triggered as a dependency? Should it fail or default to the auto-select?
For the latter implementation, it might be a question of additional logic on the custom build dialogue only.
I would also like to ask you what are the cases when automatically selected dependency is not applicable? Maybe an additional condition for the auto-selection would work for you? If so, what it could be?
--------------------
First of all, you could populate a feature request on our issue tracker at any time: https://youtrack.jetbrains.com/issues/TW; we would appreciate the details on the use case, as this might allow development team to have a better picture of where this could apply.
Secondly, as a possible workaround, you may use TeamCity REST API to start a build with a custom artifact dependency. This way, you could control it from your end, but it would add some complexity into the workflow (e.g. you would need to collect the available dependencies on your own as well as handle user input to enforce the selection). Still, if this option could work for you, please let me know and I will get back to you with an example of REST API call.
Hello Fedor,
I also have the same necessity as the author of this post.
Explicit use-case would be: I have several build configurations that produce a deployment artifact, in my case let's say a device firmware. I want to also give the users the possibility to deploy the firmware they want on one of the test devices. This would be a build configuration that is only explicitly intended for manual triggering. And without a forced prompt it is possible that the user will just hit the 'Run' button thus deploying the firmware that is selected by default. I would like to avoid such situation.
As a workaround I currently added a boolean build parameter of type 'Prompt' that is by default set to false and gives user hint to select the dependency. Then the very first build step is checking this parameter and cancels the build with some reason text if the value rewmained 'false' (meaning the user did not pay attention)
I hope that helps.
Best regards,
Dima