Skip to content

fix(traffic): When reading from GCP, use the `trafficStatuses` field.

Florian Forster requested to merge fforster/traffic_status into main

fix(traffic): When reading from GCP, use the trafficStatuses field.

When a deployment of the example service failed, GCP reported unexpected traffic assignments in the traffic field. Specifically, after changing traffic assignments manuall so that 100% were assigned to the serving version, GCP reported the following data:

      "traffic": [
        {
          "type": "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION",
          "revision": "example-service-t205j6-i2zv",
          "percent": 100
        },
        {
          "type": "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION",
          "revision": "example-service-t205j6-i2zv",
          "tag": "stable"
        }
      ],

This confused the Runway code to assign 0% of traffic to the stable release.

Instead, use the trafficStatuses field which appears to contain the effective traffic assignments:

      "trafficStatuses": [
        {
          "type": "TRAFFIC_TARGET_ALLOCATION_TYPE_REVISION",
          "revision": "example-service-t205j6-i2zv",
          "percent": 100,
          "tag": "stable",
          "uri": "https://stable---example-service-t205j6-5l55645ohq-ue.a.run.app"
        }
      ],

Reference: team#232 (comment 1982228834)

Merge request reports