Skip to content

Commit e71b8ae

Browse files
- Slow progress.
1 parent 946cc25 commit e71b8ae

File tree

5 files changed

+113
-3
lines changed

5 files changed

+113
-3
lines changed

internal/stackql/execution/mono_valent_execution.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,6 +1525,7 @@ func GetMonitorExecutor(
15251525
operationDescriptor := getOpDescriptor(body)
15261526
endTime, endTimeOk := body["endTime"]
15271527
prStr := provider.GetName()
1528+
//nolint:nestif // acceptable for now
15281529
if endTimeOk && endTime != "" {
15291530
targetLink, targetLinkOK := body["targetLink"]
15301531
if targetLinkOK {

test/python/stackql_test_tooling/flask/gcp/app.py

Lines changed: 56 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,62 @@ def v1_storage_buckets_insert():
3232
return render_template('buckets-insert-generic.jinja.json', bucket_name=bucket_name), 200, {'Content-Type': 'application/json'}
3333
return '{"msg": "Disallowed"}', 401, {'Content-Type': 'application/json'}
3434

35+
@app.route('/compute/v1/projects/testing-project/global/networks', methods=['GET'])
36+
def projects_testing_project_global_networks():
37+
return render_template('route_27_template.json'), 200, {'Content-Type': 'application/json'}
38+
39+
@app.route('/compute/v1/projects/<project_name>/global/networks', methods=['POST'])
40+
def compute_networks_insert(project_name: str):
41+
# Validate the incoming query
42+
body = request.get_json()
43+
operation_id = '1000000000001'
44+
operation_name = 'operation-100000000001-10000000001-10000001-10000001'
45+
network_name = body['name']
46+
target_link = f'https://www.googleapis.com/compute/v1/projects/{ project_name }/global/networks/{ network_name }',
47+
if not body or 'name' not in body:
48+
return '{"msg": "Invalid request body"}', 400, {'Content-Type': 'application/json'}
49+
if not project_name:
50+
return '{"msg": "Invalid request: project not supplied"}', 400, {'Content-Type': 'application/json'}
51+
if project_name == 'mutable-project' and network_name == 'auto-test-01':
52+
return render_template(
53+
'global-operation.jinja.json',
54+
target_link=target_link,
55+
operation_id=operation_id,
56+
operation_name=operation_name,
57+
project_name=project_name,
58+
kind='compute#operation',
59+
operation_type='insert',
60+
progress=0
61+
), 200, {'Content-Type': 'application/json'}
62+
return '{"msg": "Disallowed"}', 401, {'Content-Type': 'application/json'}
63+
64+
@app.route('/compute/v1/projects/<project_name>/global/operations/<operation_name>', methods=['GET'])
65+
def projects_testing_project_global_operation_detail(project_name: str, operation_name: str):
66+
if project_name == 'mutable-project' and 'operation-100000000001-10000000001-10000001-10000001':
67+
operation_id = '1000000000001'
68+
network_name = 'auto-test-01'
69+
target_link = f'https://www.googleapis.com/compute/v1/projects/{ project_name }/global/networks/{ network_name }'
70+
return render_template(
71+
'global-operation.jinja.json',
72+
target_link=target_link,
73+
operation_id=operation_id,
74+
operation_name=operation_name,
75+
project_name=project_name,
76+
kind='compute#operation',
77+
operation_type='insert',
78+
progress=100,
79+
end_time='2025-07-05T19:43:34.491-07:00',
80+
), 200, {'Content-Type': 'application/json'}
81+
return '{"msg": "Disallowed"}', 401, {'Content-Type': 'application/json'}
82+
83+
@app.route('/compute/v1/projects/<project_name>/global/networks/<network_name>', methods=['GET'])
84+
def projects_testing_project_global_network_detail(project_name: str, network_name: str):
85+
return render_template(
86+
'networks-insert-generic-mature.jinja.json',
87+
project_name=project_name,
88+
network_name=network_name
89+
), 200, {'Content-Type': 'application/json'}
90+
3591
@app.route('/v1/projects/testing-project-three/locations/global/keyRings/testing-three/cryptoKeys', methods=['GET'])
3692
def v1_projects_testing_project_three_locations_global_keyRings_testing_three_cryptoKeys():
3793
return render_template('route_1_template.json'), 200, {'Content-Type': 'application/json'}
@@ -188,9 +244,6 @@ def projects_testing_project_zones_australia_southeast1_a_disks():
188244
def projects_testing_project_zones_australia_southeast1_b_disks():
189245
return render_template('route_26_template.json'), 200, {'Content-Type': 'application/json'}
190246

191-
@app.route('/compute/v1/projects/testing-project/global/networks', methods=['GET'])
192-
def projects_testing_project_global_networks():
193-
return render_template('route_27_template.json'), 200, {'Content-Type': 'application/json'}
194247

195248
@app.route('/compute/v1/projects/testing-project/regions/australia-southeast1/subnetworks', methods=['GET'])
196249
def projects_testing_project_regions_australia_southeast1_subnetworks():
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"kind": "{{ kind if kind else 'compute#operation' }}",
3+
"id": "{{ operation_id if operation_id else '1000000000001' }}",
4+
"name": "{{ operation_name }}",
5+
"operationType": "insert",
6+
"targetLink": "{{ target_link }}",
7+
"targetId": "{{ target_id if target_id else '2000000000002' }}",
8+
"status": "{{ 'DONE' if progress and progress > 99 else 'RUNNING' }}",
9+
"user": "[email protected]",
10+
"progress": {{ progress }},
11+
"insertTime": "2025-07-05T19:42:34.488-07:00",
12+
"startTime": "2025-07-05T19:42:34.491-07:00",
13+
{% if end_time %}"endTime": "{{ end_time }}",{% endif %}
14+
"selfLink": "https://www.googleapis.com/compute/v1/projects/{{ project_name }}/global/operations/{{ operation_name }}"
15+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"kind": "compute#network",
3+
"id": "{{ network_id if network_id else '1000000000000001' }}",
4+
"creationTimestamp": "2025-07-05T19:42:34.483-07:00",
5+
"name": "{{ network_name }}",
6+
"selfLink": "https://www.googleapis.com/compute/v1/projects/{{ project_name }}/global/networks/{{ network_name }}",
7+
"selfLinkWithId": "https://www.googleapis.com/compute/v1/projects/{{ project_name }}/global/networks/{{ network_id if network_id else '1000000000000001' }}",
8+
"autoCreateSubnetworks": false,
9+
"routingConfig": {
10+
"routingMode": "REGIONAL",
11+
"bgpBestPathSelectionMode": "LEGACY"
12+
},
13+
"networkFirewallPolicyEnforcementOrder": "AFTER_CLASSIC_FIREWALL"
14+
}

test/robot/functional/stackql_mocked_from_cmd_line.robot

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8506,3 +8506,30 @@ Insert Returning Simple Projection
85068506
... ${EMPTY}
85078507
... stdout=${CURDIR}/tmp/Insert-Returning-Simple-Projection.tmp
85088508
... stderr=${CURDIR}/tmp/Insert-Returning-Simple-Projection-stderr.tmp
8509+
8510+
Insert Async Returning Simple Projection
8511+
[Documentation] PLACEHOLDER. Insert a row into a table and return projected new object values. For **asynchronously** created objects.
8512+
${inputStrSQLite} = Catenate
8513+
... insert into google.storage.buckets( project, data__name) select 'testing-project', 'silly-bucket' returning projectNumber, name, location, json_extract(iamConfiguration, '$.publicAccessPrevention') ic;
8514+
${inputStrPostgres} = Catenate
8515+
... insert into google.storage.buckets( project, data__name) select 'testing-project', 'silly-bucket' returning projectNumber, name, location, json_extract_path_text(iamConfiguration, 'publicAccessPrevention') ic;
8516+
${outputStr} = Catenate SEPARATOR=\n
8517+
... |---------------|--------------|----------|-----------|
8518+
... |${SPACE}projectNumber${SPACE}|${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}name${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}|${SPACE}location${SPACE}|${SPACE}${SPACE}${SPACE}${SPACE}ic${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}|
8519+
... |---------------|--------------|----------|-----------|
8520+
... |${SPACE}${SPACE}100000000001${SPACE}|${SPACE}silly-bucket${SPACE}|${SPACE}US${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}${SPACE}|${SPACE}inherited${SPACE}|
8521+
... |---------------|--------------|----------|-----------|
8522+
${inputStr} = Set Variable If "${SQL_BACKEND}" == "postgres_tcp" ${inputStrPostgres} ${inputStrSQLite}
8523+
Should Stackql Exec Inline Equal Both Streams
8524+
... ${STACKQL_EXE}
8525+
... ${OKTA_SECRET_STR}
8526+
... ${GITHUB_SECRET_STR}
8527+
... ${K8S_SECRET_STR}
8528+
... ${REGISTRY_NO_VERIFY_CFG_STR}
8529+
... ${AUTH_CFG_STR}
8530+
... ${SQL_BACKEND_CFG_STR_CANONICAL}
8531+
... ${inputStr}
8532+
... ${outputStr}
8533+
... ${EMPTY}
8534+
... stdout=${CURDIR}/tmp/Insert-Returning-Simple-Projection.tmp
8535+
... stderr=${CURDIR}/tmp/Insert-Returning-Simple-Projection-stderr.tmp

0 commit comments

Comments
 (0)