Triggering Build on Package Update - azure-devops

I'm looking for options that would allow us to trigger/queue builds (XAML Build Definitions within Azure DevOps) when a new package is available in either Azure DevOps Artifacts or Artifactory.
We've developed a common framework library, which we build, package and post to a NuGet Repository (either Artifactory or Azure DevOps Artifacts). Naturally, each time we post, we increment the version number: x.y.z.n, x.y.z.n+1, x.y.z.n+2...
We also have other components which reference this common framework using NuGet Floating versions: x.y.z.* Some of these components have interfaces that other components also reference and so on.
We want to trigger the rebuilds of components when a new version of a referenced package is posted to the repository.
For example: If a change to our Common Framework is made and a new version (x.y.z.15 for example) is posted to the NuGet Repository, we want to trigger/queue all the other builds which reference the Common Framework Package Version x.y.z.*.
We've been looking for existing tools to do this but so far no luck. Here are some ideas/strategies we have:
1) Does something exist or could something be built to subscribe to a Library in a Repository, that build could be triggered when a new version appears
2) Should we build a list of all the package references and builds which need to be triggered somewhere and write a program to do this.
3) Can we chain builds within Azure DevOps or can they subscribe to successful builds - forget about the Repository - just trigger from successful builds of the components you depend on... everything is in the same Azure DevOps code repository.
While we're using Azure DevOps, we're not using the GIT repository, we're using the older VS Repo and we've got the older XAML builds, not the Pipelines yet.

Related

Pipeline on Azure Devops is failing

a month ago we had a solution (big one) in .net framework 4.7.2. This was building fine on azure devops pipeline.
Now we ported our solution to net5.
Everything is working in visual studio but on azure devops, the pipeline is failing.
We had to change our Microsoft.Interop.Word (and excel, and outlook) to a com reference. Because net5 is multiplatform and interop is not.
Because we removed the nuget packages and changed to com reference the pipeline is failing.
Does anyone know how to handle this specific problem?
We can't remove the interop.excel and etc from our projects because they are dependent on it.
Beneath you see the result we have.
It feels like we have tried everything to make it work again on azure devops.
have you consider self-hosted agent since you have requirement to stay the external library in this case Microsoft.Office.Interops and I don't think Microsoft Azure DevOps Pipeline agent support that currently.
With self-hosted agent, you install the PIAs and link your library/com references to the paths.
There is problem with assembly in the code, your code may be building on local environment as it is getting references for all assemblies however when you checking in the code pipelines could not fetch the assemblies through nuget package restore, if you are referencing assembly from local machine, make sure you add its nuget package reference package.config file, so nuget restore will restore the package
can you try below
Link

How should c# references be handled when working with DevOps artifacts?

I am new to DevOps. I will explain my structure first.
Project 1>
Repo 1
Repo 2
I am trying to make two build pipelines one that will build Repo 1 and a second that will build repo 2.
Repo 2 has a dependency on Repo1.dll.
I understand that I can publish the Repo1.dll and then download the artifact in repo2's pipeline.
My trouble is, our developers normal workflow is to have both repo's running in debug on their machines using a project reference. I am having trouble understanding how to reference Repo 1 from Repo 2 in a way that the artifact can be used in DevOps and project reference can be used on the developers machines.
How should c# references be handled when working with DevOps artifacts?
The best way to do this is using the NuGet.
When you build Repo 1 and create the nuget package Package1. Then publish this package Package1 to the Azure devops feed.
Now, add this package Package1 to the solution2 in the Visual Studio from the feed.
When we update the repo1, we need to build the NuGet package, publish it to the feed, then update the refernces package version to refer to the package you just publish.

Azure Dev Ops, Private Nuget feed, options to develop / test nuget packages?

I am looking for practical options to develop and test private nuget packages.
We have a set of "core" code that is delivered securely through an Azure Artifact Feed. We have various "consuming" applications that use the core nuget packages.
As a small-medium team, one person may be developing the core nuget as well as consuming it.
Today we check-in / merge the code for the nuget package. Make sure the Pull request is approved / passes. Then the build updates the Azure Artifact feed.
Then we come back to the "consuming" app and can update the package. Works great if you fix / add the feature the first time. However, slows down productivity when treating this as an iterative development approach.
Looking for simple options for a small team. Random thoughts on options:
Push nuget "alpha" package straight from developer's machine to Azure Artifact feed. Symbol server too?
Do something with an Azure build to allow "feature" branches to publish to Azure Artifact feed somehow?
Push to local nuget feed. Include pdbs so it can be debugged?
Temporarily break the nuget reference directly for local copy of dll(s)?
Re-think using nuget packages as a whole?
Push nuget "alpha" package straight from developer's machine to Azure Artifact feed. Symbol server too?
It depends on whether you need to debug it. If you need do debug this "alpha" package, you have to push the symbol package to the symbol server.
Note: You do not need to push the "alpha" package to the symbol server, just the symbol package.
Do something with an Azure build to allow "feature" branches to
publish to Azure Artifact feed somehow?
There is a task Push NuGet packages, we could use it to publish to Azure Artifact feed during build, no matter which branch it is on. It depends on whether you have enough permissions for the Azure Artifact feed, you can check it from Artifacts->Settings->Feed settings->Permissions:
Push to local nuget feed. Include pdbs so it can be debugged?
No, you also have to include the source code. Check this thread for some more details.
And there is a lightweight solution how to debugged nuget package on local feed on a network share.
Temporarily break the nuget reference directly for local copy of
dll(s)?
Re-think using nuget packages as a whole?
The answer is yes, when we develop the project on the local, use project reference is better than nuget, check my another post for some more details:
Ticket: Project reference VS NuGet.
Hope this helps.

VSTS How do we trigger automated build of one project when there is a checkin in another project

In VSTS I have 2 Git projects (ProjectA,ProjectB). If ProjectA is updated then automated build is triggered. I would also like ProjectB to trigger also after ProjectA. How do I configure this in VSTS?
I check the trigger section but I not Build completion Add option is disabled. Is this the feature I should be using?
Although the build system supports chained builds, those builds must reside within the same team project. Team Projects are intended for isolation of unrelated resources with no dependencies. Since you have dependencies between these repos, ideally, they should not be in separate team projects.
Some options:
Script it using the REST APIs.
Make a build definition in Team Project A for the repo hosted in Team Project B, then use chained builds.
Host your related repos and build/release definitions in the same team project.

NuGet release channels

I am currently designing an automated build environment for releasing of various NuGet packages for my organisation.
As it stands, I want to be able to produce various "levels" of stability for NuGet releases, starting with triggered (i.e: builds made by POST hooks on the develop branch) as a replacement for nightlies, followed by source promoted to alpha/beta, RC then "stable" packages.
NuGet has stable and prerelease options for package retrieval, however, prerelease cannot distinguish between different prerelease stages, such as 1.2.3-beta123 and 1.2.3-alpha123 etc.
Is there any way to allow package consumers to select the "lowest" level of stability they would like to subscribe to? AFAIK, the only solution is to create different feeds that are selectively published to during the build process, then work from there. Refer to something like the Xamarin Studio Update setting below;
This is not something that is built in to NuGet. NuGet separates NuGet packages by their source.
Some teams publish nightly builds to MyGet and only publish official release NuGet package builds to nuget.org but that is just a split of pre-release from release which you could do on one package source.