stackql / stackql/stackql-deploy-rs

init google scaffold generates incorrect networks INSERT and statecheck

Abierto Apto para principiantes
#59 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
Rust
Estrellas
1
Forks
0
Merge medio
12 min
PR fusionados (30 d)
4

Descripción

Summary

The Google scaffold generated by stackql-deploy init google contains two issues in the generated VPC resource definition:

  1. The google.compute.networks.insert statement does not use the method-specific data__ fields required for the request body.
  2. The generated statecheck compares autoCreateSubnetworks with false, which did not match the deployed resource in my validation. Comparing it with 0 worked correctly.

After correcting both, I successfully validated the complete stackql-deploy build flow against a real GCP project.

Reproduction

Generate a Google stack:

stackql-deploy init google

Then run the generated stack with a valid GCP project.

The generated network resource contains an INSERT similar to:

INSERT INTO google.compute.networks
(project, name, autoCreateSubnetworks, routingConfig)
SELECT
  '{{ project }}',
  '{{ vpc_name }}',
  false,
  '{"routingMode": "REGIONAL"}';

When executed against google.compute.networks.insert, this resulted in a GCP HTTP 400 response:

Required field 'resource' not specified

Issue 1: generated INSERT fields

For this provider method, project is the path parameter, while the request-body fields use the data__ prefix.

The working INSERT is:

INSERT INTO google.compute.networks
(project, data__name, data__autoCreateSubnetworks, data__routingConfig)
SELECT
  '{{ project }}',
  '{{ vpc_name }}',
  false,
  '{"routingMode": "REGIONAL"}';

The method contract can be inspected directly with:

DESCRIBE METHOD google.compute.networks.insert;

Provider reference:

https://google-provider.stackql.io/services/compute/networks#insert-examples

The Google provider itself is working correctly; this appears to be an issue with the generated init google scaffold for this resource.

Issue 2: generated statecheck

The generated statecheck contains:

AND autoCreateSubnetworks = false

During validation, this returned no matching row even though the VPC had autoCreateSubnetworks disabled.

Changing it to:

AND autoCreateSubnetworks = 0

matched the deployed resource correctly and allowed the statecheck to pass.

End-to-end validation

After applying both changes, the stack completed successfully through the full resource lifecycle:

exists
create
statecheck
exports
successfully deployed resource
build complete

The deployment completed successfully against a real GCP project.

Expected behavior

A project generated by:

stackql-deploy init google

should produce a working scaffold that can be built without manually correcting the generated SQL.

For the generated Compute Network resource, the scaffold should:

  • use the method-specific data__ fields required by google.compute.networks.insert
  • generate a statecheck expression that correctly matches the returned autoCreateSubnetworks value

Root cause

The issue is in the generated Google scaffold for the Compute Network resource, rather than the stackql-deploy runtime or the Google provider specification.

The provider issue originally opened during diagnosis has been closed after confirming the provider method works correctly with the proper INSERT contract.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza en el punto de entrada stackql-deploy init google y localiza la definición del recurso Compute Network generado. Usa DESCRIBE METHOD google.compute.networks.insert para verificar los campos obligatorios del cuerpo de la solicitud y, después, compara el INSERT y statecheck generados con las formas funcionales del issue. La tarea está terminada cuando un scaffold de Google recién generado usa los campos data__, coincide correctamente con autoCreateSubnetworks y completa el flujo de compilación sin ediciones manuales.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
gcp, rust, sql
Área
cloud, devops
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Activo
Claridad
Bien especificado
Aptitud para principiantes
75/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.