12
Views
3
Comments
[Trigger Pipeline] ADO Multistage Pipeline TriggerManifest is Empty (TriggerPipeline)
trigger-pipeline
Web icon
Forge asset by OutSystems Lab
Application Type
Service
Platform Version
11.23.0 (Build 40636)

Hello, 

We are investigating an issue with triggering our Azure DevOps pipeline from OutSystems and correctly receiving the manifest data. 

We were initially receiving a "400 - BadRequest" error from Azure DevOps when OutSystems attempted to queue a build. The error indicated that root-level TriggerManifest and TriggeredBy parameters were missing in the API request:

Troubleshooting Steps Taken & Current Status:

We initially had TriggerManifest and TriggeredBy defined in our Azure DevOps YAML parameters as per the template provided the outsystems-pipeline repository (using Building an OutSystems pipeline with Azure DevOps Multistage Pipeline Documentation):

Removing these parameters from the main YAML and PublishTriggerManifestJob.yaml successfully triggered the ADO pipeline. We added a powershell script early in the pipeline that prints the content of the Build.TriggerManfest predefined variable via $env:BUILD_TRIGGERMANIFEST, but it consistently outputs an empty string, and so the trigger_manifest.json is always empty when referenced later on during the technical debt job.

TriggerPipeline has been set up to include some applications, and we have also experimented with adding some Pipeline Parameters to see if we can send them across to ADO. Even when supplying TriggeredBy and TriggerManifest as parameters, the same 400 - BadRequest is shown (error is still shown with or without the Pipeline Parameters):

Site properties Feature_UseTriggerManifest and SendTriggeredByParameterInManifest are both set to True.

The primary issue is that even when the Azure DevOps pipeline is successfully triggered by OutSystems (and Feature_UseTriggerManifest is True), the manifest data (specifically the selected "Application Versions" from the TriggerPipeline UI and any configured Pipeline Parameters) is not being populated into the Azure DevOps Build.TriggerManifest predefined variable.

I would think that OutSystems would generate a manifest containing these selected applications and other configured parameters, and send this as the TriggerManifest payload to Azure DevOps, making it accessible via the Build.TriggerManifest ADO variable.

Any assistance would be greatly appreciated!

2019-03-18 15-58-58
Duarte Castaño
Staff

Hi Theo,

You're right in expecting the TriggerPipeline component to send a TriggerManifest payload to Azure DevOps with information like application versions, configured parameters, and other metadata.

A couple of important clarifications based on your setup:

  • When the SendTriggeredByParameterInManifest site property is set to True, the TriggeredBy value is embedded within the TriggerManifest. In this case, you should only define the TriggerManifest parameter in your YAML, not both.

  • If you prefer to handle TriggerManifest and TriggeredBy as separate parameters, set SendTriggeredByParameterInManifest to False and keep both parameters defined in your YAML pipeline.

So, depending on your desired approach, I’d suggest:

Option 1 (recommended for simplicity):

  • Keep SendTriggeredByParameterInManifest = True

  • Only define TriggerManifest as a parameter in your main YAML

OR

Option 2:

  • Set SendTriggeredByParameterInManifest = False

  • Define both the TriggerManifest and TriggeredBy parameters in your YAML

Let us know if adjusting this resolves the issue with the empty manifest in the pipeline.

Cheers,
Duarte

UserImage.jpg
Theo Koorehpaz

Hi Duarte, 

Thank you for your reply. Unfortunately neither one of those options resolves the empty manifest.

For clarity, these are the current configurations (assuming option 1):

Site Properties of TriggerPipeline in LIfetime:

 

Only declaring the TriggerManifest parameter in the YAML:

 Applications configured for the ADO pipeline (that should be included in the Manifest):


Triggering the pipeline:

 

When testing option 2 setting the SendTriggeredByParameterInManifest = False and declaring both TriggerManifest and TriggeredBy in the YAML, the exact same Bad Request error is displayed how TriggerManifest must be provided.

I have a feeling that the manifest data is not being correctly populated or created at all despite having some applications selected. What can we do to ensure that the selected application data and any configured Pipeline Parameters are correctly included in the payload that populates the ADO  variable?

Thanks,

Theo. 

UserImage.jpg
Theo Koorehpaz

My assumption that the TriggerManifest being empty was correct - looking at the logic in Service Studio there was no Input Parameter in the TriggerAzureDevOpsBuild action that the ExtractPipelineInputParameters action required. It was originally empty.

After making these changes it looks like there is a TriggerManifest being sent over, but there could be an issue with double serialization JSON formatting. This is the latest error message:

TriggerManifest input parameter value (from debugger):

"{""ApplicationVersions"":[{""ApplicationKey"":""xxxx"",""ApplicationName"":""Jenkins Test Application"",""VersionKey"":"xxxx""}... 

But what is actually being sent to ADO:

{"definition":{"id":14},"parameters":"{\"TriggerManifest\":\"{\"ApplicationVersions\":[{\"ApplicationKey\":\"xxxx\",\"ApplicationName\":\"Jenkins Test Application\",\"VersionKey\":xxxx"}....

Presumably the JSON is being serialised into another JSON format that ADO is expecting, but the error message is unhelpful. 

ServiceStudio_TI2euzGkDW.png
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.