-
Notifications
You must be signed in to change notification settings - Fork 273
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
Support complex input types #48
Comments
My understanding is that secret variables should be passed into tasks via inputs. If that's not sufficient, can you provide more details about your scenario? |
Hi,
Those tasks help replace tokens with variable values, if we had to ask the users to supply secret variables as parameters it would be unusable. |
We also use pre-defined variable names and variables with a specific prefix in a number of our internal tasks. We simply query all available build variables, iterate through them and act on them based on their name. We currently use the script I blogged about here: This includes the use of Secret variables. We use convention over configuration to make the setup of builds much easier. |
Because we need to configure an n-amount of variables for deployment to Azure, we use a naming convention for variables. We can't know on forehand what and how many variables we should use, its dynamic. When iterating over all variables and checking the names based on the naming convention, we are now able to use variables from VSTS to deploy dynamic to Azure. |
We are considering adding a checkbox so there is an explicit option for the user to grant access to their secrets to a task. Ideally the reflection hack that Jesse put together would not work but that was an artifact of the custom PowerShell host that we are trying to move away from. |
Hi Chris, |
@chrisrpatterson it's only a reflection hack because calling a generic method from powershell isn't easy. The API is otherwise public API and would look quite clean if I had written it in C# instead. So ideally it would look cleaner, but API wise it is supposed to work from a API consumer perspective. |
@chrisrpatterson I'd love this to be part of a permission system. As a sysadmin I would want to review these types of tasks with more rigor than tasks that do not have access to secrets. |
We had an dictionary input for tasks - we could do that. The anti-pattern we are trying to avoid is folks publishing tasks where when you drag them on, you also have to know what secret variables to set. It makes the system fall apart - even though it's fine for your custom tasks. By adding a check box, we are encouraging the fragile pattern. The problem seems to be a collection of data points that feed into a task - not one to one. A dictionary input type on the tasks would solve that. It's the better equivalent of start your variables with MY_PREFIX which is essentially addressing the same problem - scoping a variable set of data for a task to use. Tasks should use inputs. |
If at the same time you fix the recursive expansion of variables, I'll
return my tasks :)
|
@bryanmacfarlane I've been looking for the ability to provide lists and dictionaries in a couple of my tasks. Being able to supply the dictionary keys from a datasource would be a lovely addition. One of my tasks shows a textbox to enter key-value pairs for Check-in Notes. At the moment I've resorted to having my users enter Json. |
Updating the title since getting secret variables was added to task lib (and agent too since it has to pass to the task). The remaining discussion is about more complex input types. |
If the secret value has an '&' character inside, the task will fail. We've tried using this format: |
This issue has had no activity in 90 days. Please comment if it is not actually stale |
Hi,
Currently those functions only support normal variables getting their value through environment variable. It would be great that they also support secret variables like Get-TaskVariable in Microsoft.TeamFoundation.DistributedTask.Task.Internal.
Thanks
The text was updated successfully, but these errors were encountered: