Skip to content

Commit cc250ff

Browse files
committed
chore: update samples #369
1 parent 63e4325 commit cc250ff

File tree

6 files changed

+264
-53
lines changed

6 files changed

+264
-53
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# this github action publishes a new integration version
16+
# it also includes any overrides present in overrides.json and config-vars files.
17+
# this sample is using the example in samples/scaffold-example
18+
19+
name: apply-sample-action
20+
permissions: read-all
21+
22+
# Controls when the workflow will run
23+
on: push
24+
25+
env:
26+
ENVIRONMENT: 'dev'
27+
PROJECT_ID: ${{ vars.PROJECT_ID }}
28+
REGION: ${{ vars.REGION }}
29+
WORKLOAD_IDENTITY_PROVIDER_NAME: ${{ vars.PROVIDER_NAME }}
30+
SERVICE_ACCOUNT: ${{ vars.SERVICE_ACCOUNT }}
31+
32+
jobs:
33+
34+
integrationcli-action:
35+
36+
permissions:
37+
contents: 'read'
38+
id-token: 'write'
39+
40+
name: Apply integration version
41+
runs-on: ubuntu-latest
42+
timeout-minutes: 20
43+
44+
steps:
45+
- name: Checkout Code
46+
uses: actions/checkout@1e31de5234b9f8995739874a8ce0492dc87873e2 #v4
47+
48+
- name: Authenticate Google Cloud
49+
id: 'gcp-auth'
50+
uses: google-github-actions/auth@6fc4af4b145ae7821d527454aa9bd537d1f2dc5f #v2.1.7
51+
with:
52+
workload_identity_provider: '${{ env.WORKLOAD_IDENTITY_PROVIDER_NAME }}'
53+
service_account: '${{ env.SERVICE_ACCOUNT }}'
54+
token_format: 'access_token'
55+
56+
- name: Calculate variables
57+
id: 'calc-vars'
58+
run: |
59+
echo "SHORT_SHA=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_OUTPUT
60+
61+
- name: Create and Publish Integration
62+
id: 'publish-integration'
63+
uses: docker://us-docker.pkg.dev/appintegration-toolkit/images/integrationcli:latest #pin to version of choice
64+
with:
65+
args: integrations apply --env=${{ env.ENVIRONMENT}} --folder=. --userlabel=${{ steps.calc-vars.outputs.SHORT_SHA }} --wait=true --proj=${{ env.PROJECT_ID }} --reg=${{ env.REGION }} --token ${{ steps.gcp-auth.outputs.access_token }}
Lines changed: 35 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,70 @@
11
{
2+
"name": "projects/102128743119/locations/us-west1/integrations/sample/versions/a87f7b88-73fa-4ff0-9fac-135c12a2caff/testCases/a11fcb3c-bd72-4ad2-83ea-f2c8c50b6f5c",
23
"displayName": "test1",
3-
"name": "projects/100000000000/locations/us-west1/integrations/sample/versions/f8145f7e-173c-4c1e-ad35-c6392853b628/testCases/dc4a4be5-1625-4f0b-a8c6-b81dce8f8620",
4+
"triggerId": "api_trigger/sample_API_1",
45
"testTaskConfigs": [
56
{
6-
"assertions": [
7-
{
8-
"assertionStrategy": "ASSERT_SUCCESSFUL_EXECUTION",
9-
"parameter": {
10-
"value": {}
11-
}
12-
}
13-
],
7+
"taskNumber": "1",
148
"mockConfig": {
15-
"mockStrategy": "SPECIFIC_MOCK_STRATEGY"
9+
"mockStrategy": "NO_MOCK_STRATEGY"
1610
},
1711
"task": "JsonnetMapperTask",
1812
"taskConfig": {
19-
"displayName": "Data Transformer (Preview)",
13+
"task": "JsonnetMapperTask",
14+
"taskId": "1",
2015
"nextTasks": [
2116
{
2217
"taskId": "2"
2318
}
2419
],
25-
"task": "JsonnetMapperTask",
2620
"taskExecutionStrategy": "WHEN_ALL_SUCCEED",
27-
"taskId": "1"
28-
},
29-
"taskNumber": "1"
21+
"displayName": "Data Transformer (Preview)",
22+
"position": {
23+
"x": -210,
24+
"y": 126
25+
}
26+
}
3027
},
3128
{
29+
"taskNumber": "2",
30+
"mockConfig": {
31+
"mockStrategy": "SKIP_MOCK_STRATEGY"
32+
},
3233
"assertions": [
3334
{
34-
"assertionStrategy": "ASSERT_SUCCESSFUL_EXECUTION",
35-
"parameter": {
36-
"value": {}
37-
}
35+
"assertionStrategy": "ASSERT_SUCCESSFUL_EXECUTION"
3836
}
3937
],
40-
"mockConfig": {
41-
"mockStrategy": "SPECIFIC_MOCK_STRATEGY",
42-
"parameters": [
43-
{
44-
"key": "`Task_2_responseHeader`",
45-
"value": {
46-
"stringValue": "test"
47-
}
48-
},
49-
{
50-
"key": "`Task_2_responseBody`",
51-
"value": {
52-
"stringValue": "test"
53-
}
54-
},
55-
{
56-
"key": "`Task_2_responseStatus`",
57-
"value": {
58-
"stringValue": "tesst"
59-
}
60-
}
61-
]
62-
},
6338
"task": "GenericRestV2Task",
6439
"taskConfig": {
65-
"displayName": "Call REST Endpoint",
6640
"task": "GenericRestV2Task",
41+
"taskId": "2",
6742
"taskExecutionStrategy": "WHEN_ALL_SUCCEED",
68-
"taskId": "2"
69-
},
70-
"taskNumber": "2"
43+
"displayName": "Call REST Endpoint",
44+
"position": {
45+
"x": -210,
46+
"y": 252
47+
}
48+
}
7149
}
7250
],
51+
"createTime": "2025-02-02T22:17:04.257119Z",
52+
"updateTime": "2025-02-02T22:18:32.915372Z",
7353
"triggerConfig": {
7454
"label": "API Trigger",
75-
"properties": {
76-
"Trigger name": "sample_API_1"
77-
},
7855
"startTasks": [
7956
{
8057
"taskId": "1"
8158
}
8259
],
83-
"triggerId": "api_trigger/sample_API_1",
60+
"properties": {
61+
"Trigger name": "sample_API_1"
62+
},
63+
"triggerType": "API",
8464
"triggerNumber": "1",
85-
"triggerType": "API"
86-
},
87-
"triggerId": "api_trigger/sample_API_1"
65+
"triggerId": "api_trigger/sample_API_1",
66+
"position": {
67+
"x": -210
68+
}
69+
}
8870
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"inputParameters": {}
3+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"name": "projects/102128743119/locations/us-west1/integrations/sample/versions/a87f7b88-73fa-4ff0-9fac-135c12a2caff/testCases/a11fcb3c-bd72-4ad2-83ea-f2c8c50b6f5c",
3+
"displayName": "test1",
4+
"triggerId": "api_trigger/sample_API_1",
5+
"testTaskConfigs": [
6+
{
7+
"taskNumber": "1",
8+
"mockConfig": {
9+
"mockStrategy": "NO_MOCK_STRATEGY"
10+
},
11+
"task": "JsonnetMapperTask",
12+
"taskConfig": {
13+
"task": "JsonnetMapperTask",
14+
"taskId": "1",
15+
"nextTasks": [
16+
{
17+
"taskId": "2"
18+
}
19+
],
20+
"taskExecutionStrategy": "WHEN_ALL_SUCCEED",
21+
"displayName": "Data Transformer (Preview)",
22+
"position": {
23+
"x": -210,
24+
"y": 126
25+
}
26+
}
27+
},
28+
{
29+
"taskNumber": "2",
30+
"mockConfig": {
31+
"mockStrategy": "SKIP_MOCK_STRATEGY"
32+
},
33+
"assertions": [
34+
{
35+
"assertionStrategy": "ASSERT_SUCCESSFUL_EXECUTION"
36+
}
37+
],
38+
"task": "GenericRestV2Task",
39+
"taskConfig": {
40+
"task": "GenericRestV2Task",
41+
"taskId": "2",
42+
"taskExecutionStrategy": "WHEN_ALL_SUCCEED",
43+
"displayName": "Call REST Endpoint",
44+
"position": {
45+
"x": -210,
46+
"y": 252
47+
}
48+
}
49+
}
50+
],
51+
"createTime": "2025-02-02T22:17:04.257119Z",
52+
"updateTime": "2025-02-02T22:18:32.915372Z",
53+
"triggerConfig": {
54+
"label": "API Trigger",
55+
"startTasks": [
56+
{
57+
"taskId": "1"
58+
}
59+
],
60+
"properties": {
61+
"Trigger name": "sample_API_1"
62+
},
63+
"triggerType": "API",
64+
"triggerNumber": "1",
65+
"triggerId": "api_trigger/sample_API_1",
66+
"position": {
67+
"x": -210
68+
}
69+
}
70+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"inputParameters": {}
3+
}
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
{
2+
"displayName": "test1",
3+
"name": "projects/100000000000/locations/us-west1/integrations/sample/versions/f8145f7e-173c-4c1e-ad35-c6392853b628/testCases/dc4a4be5-1625-4f0b-a8c6-b81dce8f8620",
4+
"testTaskConfigs": [
5+
{
6+
"assertions": [
7+
{
8+
"assertionStrategy": "ASSERT_SUCCESSFUL_EXECUTION",
9+
"parameter": {
10+
"value": {}
11+
}
12+
}
13+
],
14+
"mockConfig": {
15+
"mockStrategy": "SPECIFIC_MOCK_STRATEGY"
16+
},
17+
"task": "JsonnetMapperTask",
18+
"taskConfig": {
19+
"displayName": "Data Transformer (Preview)",
20+
"nextTasks": [
21+
{
22+
"taskId": "2"
23+
}
24+
],
25+
"task": "JsonnetMapperTask",
26+
"taskExecutionStrategy": "WHEN_ALL_SUCCEED",
27+
"taskId": "1"
28+
},
29+
"taskNumber": "1"
30+
},
31+
{
32+
"assertions": [
33+
{
34+
"assertionStrategy": "ASSERT_SUCCESSFUL_EXECUTION",
35+
"parameter": {
36+
"value": {}
37+
}
38+
}
39+
],
40+
"mockConfig": {
41+
"mockStrategy": "SPECIFIC_MOCK_STRATEGY",
42+
"parameters": [
43+
{
44+
"key": "`Task_2_responseHeader`",
45+
"value": {
46+
"stringValue": "test"
47+
}
48+
},
49+
{
50+
"key": "`Task_2_responseBody`",
51+
"value": {
52+
"stringValue": "test"
53+
}
54+
},
55+
{
56+
"key": "`Task_2_responseStatus`",
57+
"value": {
58+
"stringValue": "tesst"
59+
}
60+
}
61+
]
62+
},
63+
"task": "GenericRestV2Task",
64+
"taskConfig": {
65+
"displayName": "Call REST Endpoint",
66+
"task": "GenericRestV2Task",
67+
"taskExecutionStrategy": "WHEN_ALL_SUCCEED",
68+
"taskId": "2"
69+
},
70+
"taskNumber": "2"
71+
}
72+
],
73+
"triggerConfig": {
74+
"label": "API Trigger",
75+
"properties": {
76+
"Trigger name": "sample_API_1"
77+
},
78+
"startTasks": [
79+
{
80+
"taskId": "1"
81+
}
82+
],
83+
"triggerId": "api_trigger/sample_API_1",
84+
"triggerNumber": "1",
85+
"triggerType": "API"
86+
},
87+
"triggerId": "api_trigger/sample_API_1"
88+
}

0 commit comments

Comments
 (0)