GoogleCloudPlatform / application-integration-management-toolkit

This tool lets you interact with Application Integration, Integration Connectors or Apigee Integration/Connector APIs. The tool lets you manage (create, del, get, list) integrations, connections etc.
Apache License 2.0
22 stars 16 forks source link

Trigger overrides not replacing values in the integration JSON file. #250

Closed Sarmistha91 closed 4 months ago

Sarmistha91 commented 4 months ago

Steps Taken:

  1. Created overrides file (./overrides/overrides.json) and added trigger override details along with param overrides.
  2. Overrides file has the below details: { "param_overrides": [ { "key": "_httpDummy", "defaultValue": { "stringValue": "https://DEV.httpbin.org/get" } } ], "trigger_overrides": [ { "serviceAccount": "int-sa@apigeedev.iam.gserviceaccount.com" //dummy one } ] }
  3. All the param overrides values are correctly being replaced. But trigger overrides are not working.
ssvaidyanathan commented 4 months ago

@Sarmistha91 - the info you provided is not sufficient 1) Which version of the cli are you using? 2) What is the command you are running? 3) Did you try running with the debug flag on to see what is being sent to the Integration API?

To debug you just need to run export INTEGRATIONCLI_DEBUG=true

Sarmistha91 commented 4 months ago

@ssvaidyanathan - FYI -

  1. Version - v0.76.0

After analyzing the overrides.go code base of https://github.com/GoogleCloudPlatform/application-integration-management-toolkit/blob/main/internal/client/integrations/overrides.go , We did some changes to trigger_overrides object defined in our overrides.json file (added triggerNumber, projectId and tpoicName and defined the serviceAccount field in different format based on your overrides.go file). Adding sample for your reference.

"trigger_overrides": [        {            "triggerNumber": "2",

           "projectId": "apigeedev",            "topicName": "sample-outbound",            "serviceAccount": "int-sa"        }    ]

Then it was able to successfully replace these and create the integration.

Would really appreciate some documentation around how to define the overrides file and what all parameters are needed for each object/array defined in the overrides.go. This way it becomes easier for developers.

ssvaidyanathan commented 4 months ago

@Sarmistha91 - the idea is to NOT create this file on your own.

There is a command called "scaffold", you can just run that command pointing to your integration and it will download everything for you including the config variables and the overrides.

Once its in your machine, you can update the values and then use the "apply" command with the "--wait=true", it will just push everything in the right order and also wait for things to configure. Check out this post for more info

srinandan commented 4 months ago

It appears this issue is now resolved. If that's not the case, please reopen with the information requested by @ssvaidyanathan