Newly created build process parameters not showing up - tfs

When I add a new parameter in the Process Parameter Metadata Editor, checkin my changes, and go back to edit the definition or queue a build from it, the parameter is not showing. Here is the parameter in the editor:
Other custom parameters I added in the past show up fine. For example, this one shows up fine:
So..I would expect my new parameter to show up the same way this one works.
I tried closing and re-opening VS2013 (I have update 4) and changing to another build controller, but get same behavior. How do I fix this?

A parameter must be defined at the Build Arguments level (the place you found the Build Parameters Metadata).
Afterwards, the Metadata defines how it shows up, which editors it uses, and what description should be shown on it.

That's about the metadata, but you need to add your parameter in the Arguments tab.
You will find it in the XAML Workflow editor at the bottom three buttons/tabs: Variables, Arguments and Imports.

Related

Is there a method to display dynamic information to the user BEFORE a build?

Within the Jenkins UI, on the project page, you can use the Description Setter plugin to set a description AFTER a build. Is there any way to dynamically set this before a build? I would want to pull information from a file in the workspace that shows information about files that will be changed when the user builds the project.
Edit: While I haven't found a way to dynamically set the project description, I did find that I can create an Active Choices Reactive Reference Parameter, give it a descriptive name that serves as a title, and then read the contents of a file containing HTML with a Groovy script like so..
// The contents of the file should be HTML
String contents = new File('/tmp/some_file.html').text
return contents
So I made this my last parameter, and it shows the information that I need to show, before the end user clicks the build button. Solves my problem.
I'm going to leave this question open though, in case someone has a better idea.
While I haven't found a way to dynamically set the project description, I did find that I can create an Active Choices Reactive Reference Parameter (this requires the Active Choices plugin),
Give it a descriptive name that serves as a title, and then read the contents of a file containing HTML with a Groovy script like so..
// The contents of the file should be HTML
String contents = new File('/tmp/some_file.html').text
return contents
You will need to select a Choice Type of: Formatted HTML.
So I made this my last parameter, and it shows the information that I need to show, before the end user clicks the build button. Solves my problem.

Default array content in build process

I have added a new argument into the argument-list, which should have default values.
It is declared as a System.String[] but I can't figure out how to give it values. Giving values through Queue new Build works fine, but it is time taking to type in all values each time.
I guess it's pretty simple but I just can't figure out how the Syntax is working while editing a build process.
Thanks in Advance
You need to add it to Metadata and change the item of View this parameter when dropdownlist in Process Parameter metadata editor (e.g. Only while editing a definition).
You also can specify default value of that parameter when edit build process template, such as {"str1","str2"}.
There is a similar thread: How to put build process parameters into categories in TFS?

read data from file and use the data as multiple checkboxes in extended choice parameter in Jenkins

I have a file with a list of cases that i would like to be able to use as multiple selection check box in my Jenkins project.
example: jenkins.properties
case01_successful_Connection
case02_successful_Disconnection
case03_unsuccessful_Connection
...
The list of cases (in the file) can be from time to time get bigger or smaller!
So, how can Jenkins now read those cases and create during "Build with parameters" the needed check boxes so that the user can select or not the cases?
How should the properties file look like?
Which plug-in should i use to achieve this?
Use the Extended Choice Parameter plugin
Setup new parameter, let's call it mychoice
Select "Type" as Checkboxes
Choose a "Delimeter", for example ,
Under "Choose Source for Value", select Property File
Specify location of property file, it has to be an absolute location, not relative.
Specify "Property Key" that's in the property file, for example "mychoice_values"
Type the following in your property file:
mychoice_values=choice1,choice2,choice3
Every time "Build with parameters" is invoked, it will read that property file, find line that starts with mychoice_values, and will present 3 checkboxes called choice1, choice2, and choice3.
If the property file changes, new choices will be presented
With the answer from Slav and my additional settings I managed to solve my question:
In addition:
1. i added "Default Value" = None
2. i added in the property file: mychoice_values=choice1,choice2,choice3,None (None)
With the above settings 4 check boxes are created and by default the None check box is pre-selected!
It is not perfect the solution, because the user has to uncheck the None box if he checks other boxes! Prefect would be, if None check box would be unchecked automatically when other check boxes are selected!!!

How do I change the Build number format parameter while queuing a build

I am using Visual Studio Online for Source Control and Build processes. I created a new build definition using the TfvcContinuousDeploymentTemplate.12.xaml. When Queuing a new build from within VS I have the chance to change some parameters, but I can't change the Build number format. What determines what shows up on that parameter list and how can I make sure the Build number format appears there?
My suggestion is to investigate modifying the build template to:
1) Take a custom input value, which I believe you can change on each invocation of the build; and
2) Finding the appropriate step to interrogate the existing Build Number and modify it based on this input.
This should get you started:
http://msdn.microsoft.com/en-us/library/dd647551.aspx
Alternatively, you could remove the Build Number Activity in its entirety and substitute your own – but I don’t think these measures are warranted in this case. This would get you started down that trail:
http://blogs.msdn.com/b/willbar/archive/2010/01/21/generating-custom-build-number-in-tfs-build-2010.aspx
HTH –
jlo
To show the property you have to edit the template, expand the arguments, search for Metadata and click on the ellipse towards the right of the row. Find the property you want, in my case it is BuildNumberFormat and change the View this parameter when: Always show the parameter

TFS Build error: TF215097 - The following keys from the input dictionary do not map to arguments and must be removed

I received the following error after removing several arguments from my build template and updating the corresponding build definition:
TF215097: An error occurred while initializing a build for build definition \Automated Deployments\AutoDeploy-Kentico-Test:
Exception Message: The values provided for the root activity's arguments did not satisfy the root activity's requirements:
'DynamicActivity': The following keys from the input dictionary do not map to arguments and must be removed: ServerDeploymentScriptLocation, DestinationBinDirectory. Please note that argument names are case sensitive.
Parameter name: rootArgumentValues (type ArgumentException)
Exception Stack Trace: at System.Activities.Validation.ActivityValidationServices.ValidateRootInputs(Activity rootActivity, IDictionary`2 inputs)
at System.Activities.Hosting.WorkflowInstance.InitializeCore(IDictionary`2 workflowArgumentValues, IList`1 workflowExecutionProperties)
at System.Activities.Hosting.WorkflowInstance.Initialize(IDictionary`2 workflowArgumentValues, IList`1 workflowExecutionProperties)
at System.Activities.WorkflowApplication.EnsureInitialized()
at System.Activities.WorkflowApplication.Enqueue(InstanceOperation operation, Boolean push)
at System.Activities.WorkflowApplication.WaitForTurn(InstanceOperation operation, TimeSpan timeout)
at System.Activities.WorkflowApplication.InternalRun(TimeSpan timeout, Boolean isUserRun)
at Microsoft.TeamFoundation.Build.Hosting.BuildWorkflowInstance.Start()
at Microsoft.TeamFoundation.Build.Hosting.BuildWorkflowManager.TryStartWorkflow(WorkflowRequest request, WorkflowManagerActivity activity, BuildWorkflowInstance& workflowInstance, Exception& error, Boolean& syncLockTaken)
Obviously TFS is angry because there are keys in the "input dictionary" that shouldn't be, and that's probably because I removed them. The problem is I have non clue where TFS is finding this values where it shouldn't find them.
How can this error be corrected?
I think I had a similar issue when I removed arguments to my build definition but the build definition still retained the default values to the arguments. I would recommend trying:
Put the arguments back into the build definition
Edit the build definition and delete the default values of the arguments so they are blank
Remove the arguments again.
You could also try searching the xaml of the build template for the following values:
ServerDeploymentScriptLocation
DestinationBinDirectory
I experienced the same problem when removing arguments from the build process template. Existing build definitions using the updated template reported the same error but after updating the definition the problem went away. I simply edited a value and then changed it back and saved the definition.
One or more of the parameters have been removed from the build template XAML file, in this case ServerDeploymentScriptLocation and DestinationBinDirectory.
However, the parameter and its value still exist in TFS's build definition database.
To fix this, the build template definition needs to be refreshed and saved. In the process tab, there is a Refresh button that will reload and refresh the build definition, after which it can be saved.
To do this:
In Team Explore, select Builds.
Under "All Build Definitions", select the build to fix, right-click, "Edit Build Definition"
In the left pane, select "Process".
In the right pane, there's a bordered area labelled "Build process template", in the right of which is a "Show details" option. Expand the section by pressing the down arrow.
Press the Refresh button. (In my case, I was really pedantic, and selected another build definition, saved it, then re-selected the original definition, and re-saved).
Initiate another build.
Source: http://geekswithblogs.net/jakob/archive/2010/04/21/getting-tf215097-error-after-modifying-a-build-process-template-in.aspx

Resources