Code Monkey home page Code Monkey logo

rfennell / azurepipelines Goto Github PK

View Code? Open in Web Editor NEW
336.0 16.0 430.0 33.68 MB

A single Repo to contain the source for ALL my Azure DevOps Build/Release Extensions. The packages can be found in the Azure DevOps Marketplace

Home Page: https://marketplace.visualstudio.com/search?term=fenn&target=VSTS&sortBy=Relevance

License: MIT License

PowerShell 87.15% C# 0.37% HTML 0.12% TypeScript 11.96% JavaScript 0.30% Handlebars 0.11%
vsts powershell typescript azure-devops

azurepipelines's Introduction

Azure DevOps Pipelines Extensions Repo

This repo contains Azure DevOps Services (VSTS) & Server (TFS) Pipeline Extensions. It has evolved over time

  • Initially it contained PowerShell scripts to perform build tasks
  • Next I moved these scripts into VSTS/TFS Build tasks to wrapper PowerShell scripts.
  • Finally the tasks have been placed in VSTS/TFS extensions for ease of installation. Any remaining PowerShell scripts have been moved to this repo

Under Active Support

Extension Public Deployment Status
Artifact PR Description Release Status
Build Utils Release Status
DevTest Labs Release Status
FileCopier Utils Release Status
GenerateReleaseNotes (XPlat) Release Status
Manifest Versioning Release Status
WIKI Updater Release Status
WIKI PDF Exporter Release Status
YAML Generator Release Status

Not supported as deprecated

Extension Public Deployment Status
GenerateReleaseNotes (PowerShell) Release Status - GenerateReleaseNotes Extension (PowerShell)
Pester Release Status - Pester Extension
StyleCop Release Status - StyleCop Extension
Typemock Runner Release Status - Typemock Runner Extension

Building Extensions

For details of how to build and deploy these tasks/extensions see this repo's wiki

Included Extensions in the Repo

For more details of how to use these tasks see this repo's wiki

azurepipelines's People

Contributors

aldodfm avatar alexwiese avatar amjrsl avatar andyward avatar beej126 avatar bm-fez avatar bm-riccardo avatar calidus avatar captainshmaser avatar chrislgardner avatar dan-dekel avatar dasmulli avatar davidflury avatar dependabot[bot] avatar flcdrg avatar gyozob avatar henrikmerlander avatar holisticdeveloper avatar htekdev avatar jawn avatar jpruskin avatar jsalter2013 avatar kennethscott avatar louissung avatar m4sterg avatar mikebazmsft avatar rfennell avatar stan-stani avatar uioporqwerty avatar wizgob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azurepipelines's Issues

Fails when running against a draft build definition

I've added this task to our build, and tested it out with a draft build. It fails when attempting to retrieve the build definition:

2016-05-04T15:25:11.1750165Z ##[debug]Getting build number [MyProduct_Dev_1605.01.DRAFT] using definition ID [119 180]
2016-05-04T15:25:11.1750165Z ##[debug]GET http://teamserver2:8080/tfs/MyCollection//ProductX/_apis/build/builds?api-version=2.0&definitions=119 180&buildnumber=MyProduct_Dev_1605.01.DRAFT with 0-byte payload
2016-05-04T15:25:21.0141995Z ##[error]The remote server returned an error: (400) Bad Request.

The error is that "119 180" is not an integer. Is this build number the format used for a draft build definition?

Full log here:
7_Generate release notes.txt

GenerateReleaseNotes: Can it roll up release notes between deployments to specific environments

Is it possible for the release notes task to roll up the release notes based on the builds that have been generated between deployments to different environments?
For example in my project, every release goes to dev environment, but not all releases make it to test, stage, prod etc.
I would love for the release notes for Prod environment deployment to reflect all the releases/builds that have occurred since last release to Prod.
See:
image

[GenerateReleaseNotes] RuntimeException: Cannot convert null to type "System.DateTime"

I'm getting the following error..

2016-08-22T14:40:47.2216824Z ##[debug]Processing template
2016-08-22T14:40:47.2998067Z ##[error]System.Management.Automation.RuntimeException: Cannot convert null to type "System.DateTime". ---> System.Management.Automation.PSInvalidCastException: Cannot convert null to type "System.DateTime".
2016-08-22T14:40:47.2998067Z ##[error]   at System.Management.Automation.LanguagePrimitives.ThrowInvalidCastException(Object valueToConvert, Type resultType)
2016-08-22T14:40:47.2998067Z ##[error]   at System.Management.Automation.LanguagePrimitives.ConvertNoConversion(Object valueToConvert, Type resultType, Boolean recurse, PSObject originalValueToConvert, IFormatProvider formatProvider, TypeTable backupTable)
2016-08-22T14:40:47.2998067Z ##[error]   at CallSite.Target(Closure , CallSite , Object )
2016-08-22T14:40:47.2998067Z ##[error]   at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
2016-08-22T14:40:47.2998067Z ##[error]   at System.Management.Automation.Interpreter.DynamicInstruction`2.Run(InterpretedFrame frame)
2016-08-22T14:40:47.2998067Z ##[error]   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
2016-08-22T14:40:47.2998067Z ##[error]   --- End of inner exception stack trace ---

conditional items resolving

Hi !

Is it possible to include in template conditions (powershell if ())?

I need to filter associated workitems in build release notes.

Thanks.

[GenerateReleaseNotes]The term 'Get-ServiceEndPoint' is not recognized

I got the following when trying to generate release notes when I am in Release mode. However this issue did not come up when I am in build mode.

[error]System.Management.Automation.CommandNotFoundException: The term 'Get-ServiceEndPoint' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

2016-08-22T14:41:18.8421281Z at System.Management.Automation.CommandDiscovery.LookupCommandInfo(String commandName, CommandTypes commandTypes, SearchResolutionOptions searchResolutionOptions, CommandOrigin commandOrigin, ExecutionContext context)

2016-08-22T14:41:18.8421281Z at System.Management.Automation.CommandDiscovery.LookupCommandProcessor(String commandName, CommandOrigin commandOrigin, Nullable`1 useLocalScope)

2016-08-22T14:41:18.8421281Z at System.Management.Automation.ExecutionContext.CreateCommand(String command, Boolean dotSource)

2016-08-22T14:41:18.8421281Z at System.Management.Automation.PipelineOps.AddCommand(PipelineProcessor pipe, CommandParameterInternal[] commandElements, CommandBaseAst commandBaseAst, CommandRedirection[] redirections, ExecutionContext context)

2016-08-22T14:41:18.8421281Z at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)

2016-08-22T14:41:18.8421281Z at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)

2016-08-22T14:41:18.8421281Z at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)

2016-08-22T14:41:18.8421281Z at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)

Extension does not work with Visual Studio 2015

In my build server I only have Visual Studio 2015 installed and the extension is unable to set dacpac project versions.

The error is:2016-06-06T16:43:14.2928789Z ##[error]Unable to find type [Microsoft.SqlServer.Dac.DacSchemaModelStorageType]. Make sure that the assembly that contains this type is loaded.
2016-06-06T16:43:14.3085043Z ##[error]Unable to find type [Microsoft.SqlServer.Dac.DacSchemaModelStorageType]. Make sure that the assembly that contains this type is loaded.
2016-06-06T16:43:14.3085043Z ##[error]Unable to find type [Microsoft.SqlServer.Dac.DacSchemaModelStorageType]. Make sure that the assembly that contains this type is loaded.

C# 6: property initializer is recognized as syntax error

We installed the 'StyleCop Runner Build Task' on our VSTS to automatically block style violations from beeing merged into our master branch. Locally I didn't receive any errors, but the SC build task reported an error for the following line:

internal IList<IWorker> Workers { get; set; } = new List<IWorker>();

The error message reported by the build task: "SA0102 : CSharp.CsParser : A syntax error has been discovered in file..."

We use a lot of other C# 6 features as well, but the error only shows up for property initializers.

The version of the Visual StyleCop extension installed in my VS is '4.7.59.0'. The build task on the other hand is based on version '4.7.49.0'. I think it's a bug that's already been fixed in the latest version. So maybe updating the build task with the latest version could solve this problem.

Unable to specify an acceptable number of violations in StyleCopy Test Runner.

In Team CIty The Stylecop build step allows for a maximum number of violations that can occur before the analysis is failed. This feature appears to be either not working or missing.

Checking "Test Errors as Warnings" treats all violations as just warning irrespective of the Max. Violation Count. Where as leaving it unchecked, any violations will cause and error even when the Max. Violation Count is set higher that the number of violations.

405 - Method Not Allowed - changing variable

Below is the output from the log of my build. Some of the variables are not getting populated, like releaseid and builddefid.

2016-08-11T15:40:11.6200827Z Executing the powershell script: C:\Builds\Agent2\tasks\BuildVariableTask\1.0.15\BuildVariableTask.ps1

2
2016-08-11T15:40:17.7816092Z ##[debug]collectionUrl = [http:/tfs:8080/tfs/MyProjects/]

3
2016-08-11T15:40:17.7816092Z ##[debug]teamproject = [My Suite]

4
2016-08-11T15:40:17.7816092Z ##[debug]releaseid = []

5
2016-08-11T15:40:17.7816092Z ##[debug]builddefid = []

6
2016-08-11T15:40:17.7816092Z ##[debug]Mode is Prime

7
2016-08-11T15:40:20.8284952Z ##[debug]Getting Build Definition

8
2016-08-11T15:40:21.3128784Z ##[debug]Current value of variable [PatchVersion] is []

9
2016-08-11T15:40:21.3128784Z ##[debug]Manually updating variable

10
2016-08-11T15:40:21.4378760Z ##[error]The property 'value' cannot be found on this object. Verify that the property exists and can be set.

11
2016-08-11T15:40:21.4378760Z ##[debug]Setting variable [PatchVersion] to value []

12
2016-08-11T15:40:21.5003775Z ##[debug]Updating Build Definition for http://tfs.software-answers.com:8080/tfs/SoftwareAnswersProjects//ProgressBook Suite

13
2016-08-11T15:40:22.5003911Z ##[error]Exception calling "UploadString" with "3" argument(s): "The remote server returned an error: (405) Method Not Allowed."

I am using TFS 2015, update 3, on premises. Any idea how to resolve this error?

VersionAssembly using PS environment encoding not file encoding

I've ran into an issue where the AssemblyInfo.cs file was encoded with UTF-8 but the build agent was running in UTF-16 LE (for some reason). This meant that when the version was update and written back to the file it was now in UTF-16 LE encoding.

Not a problem for MSBuild to handle properly but SonarQube was falling over as it was expecting UTF-8, which all the other files were in.

A suggested fix is to get the encoding of the file before reading it in and then specify that same encoding when using Out-File. I've got the fix for this already written and will put in the pull request soon containing it.

401 Unauthorized on build

I get the attached error when running version 1.3 of the task on GenerateReleaseNotes TFS 2015 (14.95.25229.0). Looks like it fails to authorize against the REST services (is there anything else I need enabled / configured?)

2016-08-10T15:48:18.6096302Z ##[debug]releaseid = []

2016-08-10T15:48:18.6096302Z ##[debug]buildid = [23498]

2016-08-10T15:48:18.6106305Z ##[debug]defname = [Seo]

2016-08-10T15:48:18.6116302Z ##[debug]buildnumber = [0.0.2.55]

2016-08-10T15:48:18.6176406Z ##[debug]In Build mode

2016-08-10T15:48:18.6216298Z ##[debug]Getting build details for BuildID [23498]

2016-08-10T15:48:18.8416285Z ##[error]Exception calling "DownloadString" with "1" argument(s): "The remote server returned an error: (401) Unauthorized."

2016-08-10T15:48:18.8436287Z ##[debug]Getting associated work items for build [23498]

2016-08-10T15:48:18.8436287Z ##[debug]Getting associated changesets/commits for build [23498]

2016-08-10T15:48:18.8536528Z ##[error]Exception calling "DownloadString" with "1" argument(s): "The remote server returned an error: (401) Unauthorized."

2016-08-10T15:48:18.8666307Z ##[error]Exception calling "DownloadString" with "1" argument(s): "The remote server returned an error: (401) Unauthorized."

2016-08-10T15:48:18.8706334Z ##[debug]Using template mode [File]

2016-08-10T15:48:18.8726302Z ##[debug]Loading template file [c:\TFS_Scripts\release-notes-template.txt]

2016-08-10T15:48:18.8946281Z ##[debug]Processing template

2016-08-10T15:48:18.9926385Z ##[error]Cannot convert null to type "System.DateTime".

2016-08-10T15:48:19.0076312Z ##[debug] Starting block WI

2016-08-10T15:48:19.0226273Z ##[debug] 0 items

2016-08-10T15:48:19.0416337Z ##[debug] Ending block WI

2016-08-10T15:48:19.0436290Z ##[debug] Starting block CS

2016-08-10T15:48:19.0476285Z ##[debug] 0 items

2016-08-10T15:48:19.0486278Z ##[debug] Ending block CS

2016-08-10T15:48:19.0496285Z ##[debug]Writing output file [E:\BuildAgent_work\69\s\releasenotes.txt].

Method invocation failed because [System.Char] does not contain a method named 'Trim'.

Hi, I installed the 'Generate Release Notes Build Task' plugin in VSTS.
When I add a build step, on build time the following error occurred:

System.Management.Automation.RuntimeException: Method invocation failed because [System.Char] does not contain a method named 'Trim'.
at CallSite.Target(Closure , CallSite , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
at System.Management.Automation.Interpreter.DynamicInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)

I followed this document: https://github.com/rfennell/vNextBuild/wiki/GenerateReleaseNotes%20-Tasks

Pester Runner in Azure PowerShell

@rfennell - this is a great VSTS Task - I have been using it loads. Thank you. I have an enhancement request. I am using it more and more for Integration tests, Smoke tests (post-release, as part of a VSTS Release Configuration), that sort of thing. I am finding that I want to run AzureRM cmdlets in my tests but of course I need to Login-AzureRMAccount. I was wondering if it would be possible to have an "Azure PowerShell" version of the Task (if you know what I mean) or if you could propose a workaround.
Thanks in advance.

Make the GenerateReleaseNotes task for on non-Windows agents

This will require migrating to Node/Javascript. This should not be a major issue for the REST based business logic, but how do we write the template?

Currently the template is in effect markdown with embedded PowerShell, could we use the same model or will be need Node specific templates?

Update Regex Check in ApplyBuildVersionToAppx.ps1

Currently:
$VersionRegex = "\d+\.\d+\.\d+\.\d+"

However, the restrictions for Appx versions from Microsoft are more strict:

(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(\.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){3}

Looks for settings file only in first project folder

In my solution, I have 17 projects. Few of them are unit tests projects. I don't want to run StyleCop on unit tests projects. Also, I want different set of rules for couple of other projects. So, I added settings.stylecop file in all of the projects with the settings reuired for corresponding project. This works fine in my dev environment. But, StyleCop runner task on build server look for settings.stylecop file in the first project folder that it process. If it find one in the first project folder, it uses this file for all the projects. If it doesn't find it in the first project, then it uses default settings file for all the projects.
Please suggest a solution for this.

Unable to Install under TFS 2015 Update 3 - manifest file invalid

We are getting an error message that the extension manifest file is invalid when trying to install StyleCop Runner under Team Foundation Server 2015 Update 3

Steps to reproduce:

  1. Download StyleCop Runner from the Visual Studio Marketplace
  2. Select the vsix file for upload and installation in our Team Foundation Server 2015 Update 3 Server instance
    => Team Foundation Server reports error: Extension manifest file is invalid.

Is there any way to install StyleCop Runner under TFS2015U3 without having to wait for the next release?

Best regards,
Joerg

Support passing version number to Version VSIX task

The Version VSIX task currently expects a build number from which it parses the version. This might be useful in some cases, but in my pipe I determine the version through GitVersion and have the version number already available in a variable.

Therefore it would be nice if the version, as it will be written to the VSIX manifest, can be passed to the task.

Nuspec versioning fails if nuspec file is xml namespaced

I ran into an issue with the nuspec versioning task - it was failing with the following

System.Management.Automation.RuntimeException: The property 'InnerText' cannot be found on this object. Verify that the property exists and can be set.

I tracked this down to this line

$xml.SelectSingleNode("/package/metadata/version").InnerText = $NewVersion

It turned out that my nuspec file had an xml namespace declaration

<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">

which causes the call to SelectSingleNode to fail - I resolved it by removing the namespace declaration from my nuspec file

Not sure that this is a simple fix - apart from adding either name space param or nuspec schema version (which would translate to ns) - some discussion here nuspec schema

that's the only hiccup I had - otherwise these tasks have enable me to delete a lot of ps scripts scattered throughout projects ! - nice work

Getting server 400 & 404 error from "Get Artifact from UNC share"

I tried that on my test server and it works. But when i tried in Production server i got below error -

Error :

Exception calling "DownloadString" with "1" argument(s): "The remote server returned an error: (400) Bad Request."
Exception calling "DownloadString" with "1" argument(s): "The remote server returned an error: (404) Not Found."
Cannot bind argument to parameter 'Path' because it is null.

Generate Release Notes not working when using CI

VSTS Extension you are using

2.0.4 (problem was also on 1.4)

Expected behavior and actual behavior

After Upgrading to TFS Version 15.105.25910.0 the script does not work anymore if the build is startet per CI. It works if I start the build manually. If its started with CI, i get this error message:
"Issues
One or more of the steps defined in the build does not have an associated task definition."
The error appears before running any build steps.
All other build actions are working. If I remove or disable just the "Generate Release Notes" task, it works.

Steps to reproduce the problem

Create and build using CI.
Make a commit to force a CI build.
-> Problem appears in log.

Typemock.ps1 contains syntax errors

My builds fail because of basic syntax issues in the Typemock.ps1 script. Maybe this is related to the PowerShell version that I use, compared to the one you have used for your development, but in my case the task simply doesn't work.

Your code:
if (!Test-Path($runSettingsFile))

My code:
if (!(Test-Path $runSettingsFile))

This fixed it for me.

GenerateReleaseNotes - 401 Unauthorized error thrown when using on-premise TFS 2015 Update 2

We're getting the following error when trying to use this with an on-premise install.

Exception calling "DownloadString" with "1" argument(s): "The remote server returned an error: (401) Unauthorized."

I've seen this happening a lot with our on-premise install and extensions. We use SSL and have configured TFS on port 443 only. We also use an internal CA for our organization. Not sure if this helps track down the issue.

StyleCop Extension - SA1650 rules are not run

The SA1650 Typos in comments does not work inside the StyleCop task

This is related to the issue in my StyleCopCmdLine. That was fixed by making sure the dictionary DLLs were distributed with the EXE. The same fix was made in the project and it worked within a test harness in VS Code, but fails if the same tests are run from the command line (and also if run as a VSTS task)

It appears to be related to not loading the dictionary, but not sure why at this time - under investigation

Release notes generation not working

Starting: Generate release notes


Preparing task execution handler.
Executing the powershell script: C:\a_tasks\GenerateReleaseNotes_661bc005-61be-430f-b994-065bf08c0f39\1.4.7\GenerateReleaseNotes.ps1
Build Number : $($build.buildnumber)
Build started : $("{0:dd/MM/yy HH:mm:ss}" -f [datetime]$build.startTime)
Source Branch : $($build.sourceBranch)

Associated work items

@@WiLoop@@

  • $($widetail.fields.'System.WorkItemType') $($widetail.id) [Assigned by: $($widetail.fields.'System.AssignedTo')] $($widetail.fields.'System.Title')
    @@WiLoop@@
    ###Associated change sets/commits
    @@Csloop@@
  • ID $($csdetail.changesetid)$($csdetail.commitid) $($csdetail.comment)
    @@Csloop@@)

System.ArgumentException: Invalid JSON primitive: .
at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject()
at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth)
at System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer)
at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit)
at Microsoft.PowerShell.Commands.JsonObject.ConvertFromJson(String input, ErrorRecord& error)
at Microsoft.PowerShell.Commands.ConvertFromJsonCommand.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()

System.ArgumentException: Invalid JSON primitive: .
at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject()
at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth)
at System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer)
at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit)
at Microsoft.PowerShell.Commands.JsonObject.ConvertFromJson(String input, ErrorRecord& error)
at Microsoft.PowerShell.Commands.ConvertFromJsonCommand.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()

System.ArgumentException: Invalid JSON primitive: .
at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject()
at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth)
at System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer)
at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit)
at Microsoft.PowerShell.Commands.JsonObject.ConvertFromJson(String input, ErrorRecord& error)
at Microsoft.PowerShell.Commands.ConvertFromJsonCommand.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()

System.Management.Automation.RuntimeException: Cannot convert null to type "System.DateTime". ---> System.Management.Automation.PSInvalidCastException: Cannot convert null to type "System.DateTime".
at System.Management.Automation.LanguagePrimitives.ThrowInvalidCastException(Object valueToConvert, Type resultType)
at System.Management.Automation.LanguagePrimitives.ConvertNoConversion(Object valueToConvert, Type resultType, Boolean recurse, PSObject originalValueToConvert, IFormatProvider formatProvider, TypeTable backupTable)
at CallSite.Target(Closure , CallSite , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
at System.Management.Automation.Interpreter.DynamicInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
--- End of inner exception stack trace ---

System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\a\1\a\artifacts\ReleaseNotes.txt'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at Microsoft.PowerShell.Commands.FileSystemContentReaderWriter.CreateStreams(String filePath, String streamName, FileMode fileMode, FileAccess fileAccess, FileShare fileShare, Encoding fileEncoding)
at Microsoft.PowerShell.Commands.FileSystemProvider.GetContentWriter(String path)

PowerShell script completed with 5 errors.


Finishing: Generate release notes


Release Notes Cannot access the build parameters using a template

This issues as been created to provide a record of Twitter conversation

You usually access the properties of a build in a templates as follows

**Build Number** : $($build.buildnumber)

You would expect to be able to access inner properties in the following manner

**Build Config** : $($build.parameters.BuildConfiguration)

But this does not work

Server 404 error if Git type artifact is linked to pipeline

If a Git type artifact is linked to the release pipeline, the GenerateReleaseNotes task throws this error:
Error:
##[error]System.Management.Automation.MethodInvocationException: Exception calling "DownloadString" with "1" argument(s): "The remote server returned an error: (404) Not Found." ---> System.Net.WebException: The remote server returned an error: (404) Not Found.
at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request)
at System.Net.WebClient.DownloadString(Uri address)
at CallSite.Target(Closure , CallSite , Object , Object )
--- End of inner exception stack trace ---
...

GenerateReleaseNotes not working for external git repos

Firstly I'd like to say that this tool is amazing and works great with everything in VSTS.

The problem I'm currently having is that there are some things that I have to build from custom / external git repositories and the build step results in an empty markdown file.

Pester Task: ModuleVersion error when running task

It looks like the 'Install-Module' command in Pester.ps1 is failing because the VS extension version does not match the version of Pester version. I'm getting the following logged on my on-premise TFS build server when executing the Pester task:

2016-11-18T20:49:18.1814142Z Starting task: Pester Test Runner
2016-11-18T20:49:18.2126716Z Executing the powershell script: C:\TFS\tasks\Pester\4.0.7\Pester.ps1
2016-11-18T20:49:18.4001670Z ##[debug]Running in AMD64 PowerShell
2016-11-18T20:49:18.4157796Z ##[error]The ModuleVersion key in module manifest 'C:\TFS\tasks\Pester\4.0.7\Pester.psd1' specifies module version '3.4.0' which does not match its version folder name at 'C:\TFS\tasks\Pester\4.0.7'. Change the value of the ModuleVersion key to match the version folder name.
2016-11-18T20:49:18.4157796Z ##[debug]Running Pester from [C:\TFS_work\2\a*] output sent to [C:\TFS_work\2\a\Test-Pester.XML]
2016-11-18T20:49:18.7126290Z ##[error]The term 'Invoke-Pester' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
2016-11-18T20:49:18.7283026Z ##[error]Pester returned errors
2016-11-18T20:49:18.7283026Z Finishing task: Pester

Oddly enough this works on the VSTS hosted build server. I'm assuming moving the pester module files to a '3.4.0' subfolder would fix this.

@@WILOOP@@ and @@CILOOP@@ tags are present in output MD file

When inspecting the output markdown file, I see that the build details are present, but the loop tags have not been replaced with Work Items and Commits. Below is the log and a snippet from the output file.

--LOG--
2016-06-22T10:16:39.9643711Z Executing the powershell script: E:\Agent\tasks\GenerateReleaseNotes\1.3.22\GenerateReleaseNotes.ps1
2016-06-22T10:16:40.3550094Z ##[debug]collectionUrl = [https://XXX.visualstudio.com/]
2016-06-22T10:16:40.3550094Z ##[debug]teamproject = [XXX]
2016-06-22T10:16:40.3550094Z ##[debug]releaseid = []
2016-06-22T10:16:40.3550094Z ##[debug]buildid = [3435]
2016-06-22T10:16:40.3550094Z ##[debug]defname = [Nightly Build]
2016-06-22T10:16:40.3706385Z ##[debug]buildnumber = [20160622.1]
2016-06-22T10:16:40.3706385Z ##[debug]In Build mode
2016-06-22T10:16:40.3706385Z ##[debug]Getting build details for BuildID [3435]
2016-06-22T10:16:41.3237744Z ##[debug]Getting associated work items for build [3435]
2016-06-22T10:16:41.3237744Z ##[debug]Getting associated changesets/commits for build [3435]
2016-06-22T10:16:44.8238348Z ##[debug]Using template mode [InLine]
2016-06-22T10:16:44.8238348Z ##[debug]Using in-line template
2016-06-22T10:16:44.9175848Z ##[debug]Processing template
2016-06-22T10:16:45.7769872Z ##[debug]Writing output file [e:\builds\5\a\releasenotes.md].

--RELEASENOTES.MD--

Build Number : 20160622.2
Build started : 22/06/16 06:23:33
Source Branch refs/heads/master

Associated work items

@@WiLoop@@

Associated change sets/commits

@@Csloop@@

GenerateReleaseNotes task uses a preview REST API

At present the GenerateReleaseNotes task relies on the api-version=3.0-preview.2 which is only available on the VSTS url vsrm.visualstudio.com.

When this SDK is available on-prem, probably when the next major version of TFS ships this task needs to be updated to remove the 'hack' used to sort the URL at present

GenerateReleaseNotes - Skip artifact

Our release has links two more than one build type artifacts. Is it possible to create Release notes for only one of them and skip the other ones? Thanks!

release notes creation task failed with errors.

Hi,
tried first time the release notes task and it failed with below errors: is there something i am miising ? or i a m doing wrong ? I am running on windows 2005server.

2016-06-20T06:10:26.4964533Z ##[debug]Loading template file [D:\BuildAgent_work\1\s\Main\Build\release-template.md]
2016-06-20T06:10:26.5454582Z ##[debug]Processing template
2016-06-20T06:10:27.1405177Z ##[error]Cannot convert null to type "System.DateTime".
2016-06-20T06:10:27.1745211Z ##[error]Cannot convert null to type "System.DateTime".
2016-06-20T06:10:27.2835320Z ##[debug]Writing output file [ D:\BuildAgent_work\1\a\releaseNotes.md].
2016-06-20T06:10:27.3115348Z ##[error]Cannot find drive. A drive with the name ' D' does not exist.

$build.finishTime is null

I'm using the basic template provided here.
The "Generate Release Notes" Task ist the last step of my build definition.

I'm getting this error:

[error]NULL kann nicht in den Typ "System.DateTime" konvertiert werden.

In english:
NULL cannot be converted to the type "System.DateTime".

I think, it comes from this line in the basic template:
Build completed $("{0:dd/MM/yy HH:mm:ss}" -f [datetime]$build.finishTime)

Since the build is still running, $build.finishTime must be null.

You should exclude this line from the basic template, or better have some other sort of timestamp there.

When running a build that has no associated work items or commits the generate release notes task fails

2016-03-24T16:35:38.0944568Z ##[error]System.Management.Automation.RuntimeException: Cannot index into a null array.

22
2016-03-24T16:35:38.0944568Z ##[error] at CallSite.Target(Closure , CallSite , Object , Int32 )

23
2016-03-24T16:35:38.0944568Z ##[error] at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)

24
2016-03-24T16:35:38.0944568Z ##[error] at System.Management.Automation.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)

25
2016-03-24T16:35:38.1100758Z ##[error] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)

26
2016-03-24T16:35:38.1100758Z ##[error]System.Management.Automation.RuntimeException: Cannot index into a null array.

27
2016-03-24T16:35:38.1100758Z ##[error] at CallSite.Target(Closure , CallSite , Object , Int32 )

28
2016-03-24T16:35:38.1100758Z ##[error] at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet](CallSite site, T0 arg0, T1 arg1)

29
2016-03-24T16:35:38.1100758Z ##[error] at System.Management.Automation.Interpreter.DynamicInstruction`3.Run(InterpretedFrame frame)

30
2016-03-24T16:35:38.1100758Z ##[error] at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)

Succeeded [False] but Violations [0]

2016-11-11T19:52:56.4958750Z VERBOSE: Processing the folder 
 2016-11-11T19:52:56.4958750Z [C:\****\_work\1\s\src\****.Models]
 2016-11-11T19:52:56.4958750Z VERBOSE: The settings.stylecop passed the parameter 
 2016-11-11T19:52:56.4958750Z [C:\******\_work\1\s\src\Settings.StyleCop]
 2016-11-11T19:52:56.4958750Z VERBOSE: The IsNullOrEmpty check returned [False]
 2016-11-11T19:52:56.4958750Z VERBOSE: The Test-Path check returned [True)]
 2016-11-11T19:52:56.4958750Z VERBOSE: Loading from folder from [C:\******\tasks\StyleCop\1.8.1]
 2016-11-11T19:52:56.4958750Z VERBOSE: Loading DLLs from 
 2016-11-11T19:52:56.5115000Z [C:\******\tasks\StyleCop\1.8.1\StyleCopWrapper.dll]
 2016-11-11T19:52:56.5271250Z VERBOSE: 
 2016-11-11T19:52:56.5271250Z VERBOSE: Base folder [C:\******\_work\1\s\src\***.Models]
 2016-11-11T19:52:56.5271250Z VERBOSE: Settings  [C:\******\_work\1\s\src\Settings.StyleCop]
 2016-11-11T19:52:56.5271250Z VERBOSE: Succeeded  [False]
 2016-11-11T19:52:56.5271250Z VERBOSE: Violations  [0]
 2016-11-11T19:52:56.5271250Z VERBOSE: Log file  [C:\******\_work\1\a\***.Models.stylecop.log]
 2016-11-11T19:52:56.5271250Z VERBOSE: XML results 
 2016-11-11T19:52:56.5271250Z [C:\******\_work\1\a\****.Models.stylecop.xml]

2016-11-11T19:52:56.5271250Z VERBOSE: Succeeded [False]
2016-11-11T19:52:56.5271250Z VERBOSE: Violations [0]

Get Artifact from UNC share issue

Hi,
I am using VSTS and would like to try copying build artifacts from one build definition to another.
I get the following error message:
Getting lastest completed build
Microsoft.PowerShell.Commands.WriteErrorException: Cannot access source path [#/475339/artifact]
Processed: ##vso[task.logissue type=error;]Microsoft.PowerShell.Commands.WriteErrorException: Cannot access source path [#/475339/atrifact]
PowerShell script completed with 1 errors.
I can see that the artifact that should be picked is the one from the other build definition. So they are correctly related.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.