TeamCity finish build trigger not firing - triggers

I have a TeamCity job which builds our website from a given branch. I am trying to get a build which runs a couple of automated Selenium tests against that site that was just built.
The build configuration I want to kick off another build configuration when it finishes is called "Site Alpha – Feature Branch QA Builds", but it doesn't seem to fire any finish build triggers, so I went back to basics.
I tried setting up 2 new jobs for testing, "test trigger build > run" and "test triggered build >plain_run > plain". Both do simple command line "echo" statements and the second one has a finish build trigger configured to fire when the first one finishes. This works perfectly.
I added another finish build trigger to "test triggered build >plain_run > plain" to build when "Site Alpha – Feature Branch QA Builds" finishes. When I build "Site Alpha – Feature Branch QA Builds" the finish build trigger on "test triggered build >plain_run > plain" does not fire.
All 3 build configurations are compatible with all of the build agents.
I am using TeamCity Enterprise 8.0.1 (build 27435) and accessing it in Firefox 31.0
(1) "Build Triggers" configuration page for "test triggered build >plain_run > plain"
(2) Build log for "test trigger build > run" (#6 here triggered #1 in image (3), #7 here triggered #3 in image (3) )
(3) build log for "test triggered build >plain_run > plain" (#2 triggered manually, #1 and #3 triggered by above, image (2) )
(4) build log for "Site Alpha – Feature Branch QA Builds" (being built regularly, but hasn't fired trigger once)

When you say the dependent build does not fire, does it actually show up as queued or does it give any error message
If it shows up as queued, it will normally have a message to explain why it is not running
If it throws an error instead of getting into a queue , you can debug the error
If it is none of the above , try forcing a manual run and see if that throws any error or is succeeding. In case it is succedding can you please attach a snapshot of your issue
You can also edit the build configuration, you can see the build agents where this target can run on. If there are no build agents, you need to figure out why it can not run on any build agent

Related

Can I delete a Github workflow run within the workflow itself?

We developed a CI system that runs via Github actions on self-hosted runners.
In order to prevent building unnecessarily, we incorporated a pre-build job that triggers a build only if the commit message has [trigger ci] anywhere.
Now we are facing a slight annoyance: Even if the build job doesn't run, we still have a workflow run show up in the workflow runs list, as expected, but it has basically become a copy of the commit history and very hard to navigate or find which workflows did actually build.
Is there any way that I can delete a workflow run from the workflow runs list conditionally, within the workflow itself? This way, we can keep only the runs that did trigger a build, and delete the ones that skipped building.

Triggering a build on completion of another build when a Pull Request comes in

We have a web application in an Azure DevOps repo and there's a branch policy on the master branch that kicks off a build when a pull request is created. This validates that it compiles and performs code quality checks and the like.
We also have some integration tests (using Mocha and Selenium) that live in another repo. I would like to run the integration tests when a PR against master is created.
As far as I know I cannot have the same build pull from two different repos (without using extensions and it seems cleaner to me to have two separe builds anyway). So I thought I would have another build just to run the integration tests. The build that pulls from the webapp repo would have a final step where it would deploy to an integration tests environment and then the second build would get the latest version of the integration tests and run them against the integration tests environment. I created a Build Completion trigger on the integration tests build that is triggered by the completion of the webapp build.
The problem is that when I queue the webapp build manually, it will launch the integration tests build when done. But when the webapp build is queued by an incoming PR, the integration tests build does not get triggered.
Is this a bug in Azure DevOps or am I going about this wrong?
Also in my side builds from PR doesn't trigger another builds (with Build Completion trigger), I don't know if it's a bug or it's by design.
Anyway, there is a workaround - the final step in the first build will trigger the second build. how? with Trigger Build task.
You just need to change the branch because it will be a merge branch from the PR that doesn't exist in the tests repository:
You can also do it without install extensions with PowerShell task and the Rest API.

Is it possible to re-run Validation stage alone (without re-build) in VSTS?

Is it possible to re-run Validation stage alone (without re-build) in VSTS?
Some of our tests fail intermittently and we would like to Re-run tests (or better just the failed tests) alone to qualify pull request.
The way to re-run validation stage (part of tasks in your build definition) only in VSTS is using private agent to build, set clean as false in Get sources step and disable the tasks you want to skip. Detail steps as below:
Specify a private agent for the build definition
If you have not a private agent, you can refer the document like Deploy an agent on Windows, then specify the private agent for your build definition.
Set Clean option as false in Get sources step
In Get sources steps, set Clean option as false.
Disable the tasks you want to skip for re-build
Select the tasks you want to skip -> Disable selected task(s) -> Save build definition.
Re-build PR validation build manually
In the pull request page -> click … button -> Queue build.
Then the PR validation build will be queued with only part of tasks executed.
Recovery the build definition
After execute the validation for your debug, then you need to recover and save the build definition.

VSTS How to make a Release be triggered automatically upon successful Build completion?

I often do the following, through VSTS web UI:
Queue a build. Wait for it to finish.
If the build finished successfully, release it.
I want for step 2 to trigger automatically upon step 1 completion, so I won't have to babysit it. How can I do it?
Within your release definition:
In the old editor:
On the Artifacts tab, link the build as an artifact source
On the Triggers tab, turn on Continuous Deployment.
In the new editor:
On the pipelines tab, click the + button to add an artifact source.
Click the lightning bolt icon next to the artifact and set the Continuous Deployment trigger to enabled.
That will create a release. For any environments upon which you want to immediately start deployment, make sure the pipeline is configured so that they start after the release is created.
For the record, this is extremely well-documented.

Teamcity constantly rebuilding a pull request even though the last build failed and there have been no further commits

I have TeamCity set up to build Github pull requests as per these instructions: http://blog.jetbrains.com/teamcity/2013/02/automatically-building-pull-requests-from-github-with-teamcity/
I have added a VCS build trigger so that TeamCity polls Github looking for changes. This has no special settings enabled.
My build involves a shell script to set up dependencies and an Ant script to run PHPUnit. Right now, the Ant script fails (tests don't pass) with exit code 1. The build shows as a fail, and that should be that. However, every time the VCS build trigger looks for changes, it seems to find some, even though there have been no more commits. It then runs yet another build of the same merge commit and keeps repeating the build endlessly.
Why is it constantly thinking that there are changes when there are not?