stackql / stackql/stackql-deploy-rs

init google scaffold generates incorrect networks INSERT and statecheck

オープン 初心者向け
#59 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Rust
スター
1
フォーク
0
平均マージ
12分
マージ済み PR(30日)
4

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

stackql-deploy init google のエントリーポイントから開始し、生成された Compute Network リソース定義を見つけます。DESCRIBE METHOD google.compute.networks.insert を使用して必須の request-body フィールドを確認し、生成された INSERT と statecheck を issue 内の動作する形式と比較します。新しく生成された Google scaffold が data__ フィールドを使用し、autoCreateSubnetworks と正しく一致し、手動編集なしで build flow を完了すれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
gcp, rust, sql
領域
cloud, devops
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
活発
明瞭さ
明確に書かれている
初心者へのやさしさ
75/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。