Skip to content

Commit 50aeb2e

Browse files
authored
Merge pull request #41 from stackql/feature/updates
2.0.4 updates
2 parents 3109353 + 40e2245 commit 50aeb2e

78 files changed

Lines changed: 3779 additions & 2142 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/settings.local.json

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/release-footer.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
### Download
2+
3+
| Platform | Architecture | Asset |
4+
|----------|--------------|-------|
5+
| Linux | x86_64 | `stackql-deploy-linux-x86_64.tar.gz` |
6+
| Linux | arm64 | `stackql-deploy-linux-arm64.tar.gz` |
7+
| macOS | Universal (Apple Silicon + Intel) | `stackql-deploy-macos-universal.tar.gz` |
8+
| Windows | x86_64 | `stackql-deploy-windows-x86_64.zip` |
9+
10+
Each archive contains a single binary named `stackql-deploy` (or `stackql-deploy.exe` on Windows). Verify your download with `SHA256SUMS`.
11+
12+
### Install (quick)
13+
14+
**Linux / macOS:**
15+
16+
```sh
17+
curl -L https://get-stackql-deploy.rs -o stackql-deploy.tar.gz && tar xz stackql-deploy.tar.gz
18+
```
19+
20+
**Windows (PowerShell):**
21+
22+
```powershell
23+
Invoke-WebRequest -Uri https://get-stackql-deploy.rs -OutFile stackql-deploy.zip
24+
Expand-Archive stackql-deploy.zip -DestinationPath .
25+
```
26+
27+
**cargo:**
28+
29+
```sh
30+
cargo install stackql-deploy
31+
```
32+
33+
---
34+
35+
Full documentation: [stackql-deploy.io](https://stackql-deploy.io) - Source: [github.com/stackql/stackql-deploy](https://github.com/stackql/stackql-deploy)

.github/workflows/release.yml

Lines changed: 42 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,38 @@ jobs:
132132
path: ${{ matrix.artifact-name }}.*
133133
if-no-files-found: error
134134

135+
universal-macos:
136+
name: Universal macOS binary
137+
needs: build
138+
runs-on: macos-latest
139+
steps:
140+
- uses: actions/download-artifact@v8
141+
with:
142+
name: stackql-deploy-macos-arm64
143+
path: arm64
144+
- uses: actions/download-artifact@v8
145+
with:
146+
name: stackql-deploy-macos-x86_64
147+
path: x86_64
148+
- name: Extract binaries
149+
run: |
150+
tar -xzf arm64/stackql-deploy-macos-arm64.tar.gz -C arm64
151+
tar -xzf x86_64/stackql-deploy-macos-x86_64.tar.gz -C x86_64
152+
- name: Create universal binary
153+
run: |
154+
lipo -create arm64/stackql-deploy x86_64/stackql-deploy \
155+
-output stackql-deploy
156+
tar -czf stackql-deploy-macos-universal.tar.gz stackql-deploy
157+
- uses: actions/upload-artifact@v8
158+
with:
159+
name: stackql-deploy-macos-universal
160+
path: stackql-deploy-macos-universal.tar.gz
161+
if-no-files-found: error
162+
135163
# Runtime smoke test on each platform before releasing
136164
runtime-test:
137165
name: Runtime Test (${{ matrix.os }})
138-
needs: build
166+
needs: [build, universal-macos]
139167
strategy:
140168
fail-fast: false
141169
matrix:
@@ -192,23 +220,32 @@ jobs:
192220
193221
release:
194222
name: Create GitHub Release
195-
needs: [build, runtime-test]
223+
needs: [build, runtime-test, universal-macos]
196224
runs-on: ubuntu-latest
197225
permissions:
198226
contents: write
199227
steps:
200-
- name: Download all build artifacts
228+
- uses: actions/checkout@v6
229+
- name: Download selected build artifacts
201230
uses: actions/download-artifact@v8
202231
with:
203232
path: artifacts/
204-
pattern: stackql-deploy-*
233+
pattern: stackql-deploy-@(linux-*|windows-*|macos-universal)
205234
- name: Collect archives and generate SHA256SUMS
206235
run: |
207236
mkdir -p dist
208237
find artifacts/ -type f \( -name '*.tar.gz' -o -name '*.zip' \) \
209238
-exec mv {} dist/ \;
210239
cd dist
211240
sha256sum * | tee SHA256SUMS
241+
- name: Build release body
242+
run: |
243+
VERSION=${GITHUB_REF_NAME#v}
244+
echo "## stackql-deploy ${GITHUB_REF_NAME}" > release-body.md
245+
echo "" >> release-body.md
246+
awk "/^## $VERSION/{found=1; next} found && /^## /{exit} found{print}" CHANGELOG.md >> release-body.md
247+
echo "" >> release-body.md
248+
cat .github/release-footer.md >> release-body.md
212249
- name: GH Release
213250
uses: softprops/action-gh-release@v2.6.0
214251
with:
@@ -219,68 +256,7 @@ jobs:
219256
dist/*.tar.gz
220257
dist/*.zip
221258
dist/SHA256SUMS
222-
body: |
223-
## stackql-deploy ${{ github.ref_name }}
224-
225-
### What's new
226-
227-
This release ships the **Rust rewrite** of `stackql-deploy` — a complete
228-
ground-up reimplementation that replaces the original Python package.
229-
230-
Key improvements over the Python version:
231-
232-
- **Single self-contained binary** — no Python runtime, pip, or virtualenv required.
233-
Drop the binary on any supported platform and run.
234-
- **Faster startup and execution** — Rust compile-time optimisations mean commands
235-
that previously took seconds to initialise now start instantly.
236-
- **Smaller install footprint** — the stripped Linux x86_64 binary is under 10 MB;
237-
no transitive Python dependencies to manage.
238-
- **Statically linked on Linux** — works on any glibc >= 2.17 distro without
239-
installing extra system libraries.
240-
- **Native Windows and macOS ARM64 support** — pre-built for all five major targets
241-
(see assets below).
242-
243-
### Download
244-
245-
| Platform | Architecture | Asset |
246-
|----------|--------------|-------|
247-
| Linux | x86_64 | `stackql-deploy-linux-x86_64.tar.gz` |
248-
| Linux | arm64 | `stackql-deploy-linux-arm64.tar.gz` |
249-
| macOS | Apple Silicon (arm64) | `stackql-deploy-macos-arm64.tar.gz` |
250-
| macOS | Intel (x86_64) | `stackql-deploy-macos-x86_64.tar.gz` |
251-
| Windows | x86_64 | `stackql-deploy-windows-x86_64.zip` |
252-
253-
Each archive contains a single binary named `stackql-deploy` (or
254-
`stackql-deploy.exe` on Windows). Verify your download with `SHA256SUMS`.
255-
256-
### Migrating from the Python package
257-
258-
If you are currently using the Python package on PyPI, please migrate to this
259-
release. The Python package is now deprecated and will no longer receive updates:
260-
https://pypi.org/project/stackql-deploy/
261-
262-
The CLI interface is fully compatible — existing `stackql_manifest.yml` files and
263-
project layouts work without modification.
264-
265-
### Install (quick)
266-
267-
**Linux / macOS:**
268-
```sh
269-
curl -sSL https://github.com/stackql/stackql-deploy/releases/download/${{ github.ref_name }}/stackql-deploy-linux-x86_64.tar.gz \
270-
| tar -xz -C /usr/local/bin
271-
```
272-
273-
**Windows (PowerShell):**
274-
```powershell
275-
Invoke-WebRequest -Uri https://github.com/stackql/stackql-deploy/releases/download/${{ github.ref_name }}/stackql-deploy-windows-x86_64.zip `
276-
-OutFile stackql-deploy.zip
277-
Expand-Archive stackql-deploy.zip -DestinationPath $env:LOCALAPPDATA\stackql-deploy
278-
```
279-
280-
Or install via `cargo`:
281-
```sh
282-
cargo install stackql-deploy
283-
```
259+
body_path: release-body.md
284260

285261
# --no-verify skips the verification build that cargo publish runs by default.
286262
# That build fails because build.rs writes contributors.csv into the package

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ stackql*.zip
66
stackql*.pkg
77
stackql_history.txt
88
stackql.log
9+
stackql-zip
910
.env
1011
nohup.out
1112
contributors.csv
13+
.claude/
14+
nohup.out

CHANGELOG.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,74 @@
11
# Changelog
22

3+
## 2.0.4 (2026-03-18)
4+
5+
### Identifier capture from `exists` queries
6+
7+
The `exists` query can now return a named field (e.g. `vpc_id`) instead of `count`. The returned value is automatically captured as a resource-scoped variable (`{{ this.<field> }}`) and made available to all subsequent queries (`statecheck`, `exports`, `delete`) for that resource. This enables a two-step workflow where `exists` discovers the resource identifier and `statecheck` verifies its properties.
8+
9+
- When `exists` returns `null` or empty for the captured field, the resource is treated as non-existent
10+
- Multiple rows from an `exists` (identifier pattern) or `exports` query is now a fatal error
11+
- After a `create`, the `exists` query is automatically re-run to capture the identifier for use in post-deploy `statecheck` and `exports` queries
12+
13+
### `RETURNING *` identifier capture
14+
15+
When a `create` statement includes `RETURNING *` and the response contains an `Identifier` field, it is automatically injected as `this.identifier` — skipping the post-create `exists` re-run and saving an API call per resource.
16+
17+
### `return_vals` manifest field
18+
19+
New optional `return_vals` field on resources to explicitly map fields from `RETURNING *` responses to resource-scoped variables:
20+
21+
```yaml
22+
return_vals:
23+
create:
24+
- Identifier: identifier # rename pattern
25+
- ErrorCode # direct capture
26+
```
27+
28+
If `return_vals` is specified but the field is missing from the response, the build fails.
29+
30+
### `to_aws_tag_filters` template filter
31+
32+
New AWS-specific Tera filter that converts `global_tags` (list of `Key`/`Value` pairs) to the AWS Resource Groups Tagging API `TagFilters` format:
33+
34+
```sql
35+
AND TagFilters = '{{ global_tags | to_aws_tag_filters }}'
36+
```
37+
38+
### YAML type preservation fix
39+
40+
Fixed an issue where YAML string values that look like numbers (e.g. `IpProtocol: "-1"`) were being coerced to integers during JSON serialization. String types declared in YAML are now preserved through to the rendered query.
41+
42+
### Teardown improvements
43+
44+
- Teardown no longer retries exports queries that return empty results — missing exports are set to `<unknown>` and teardown continues best-effort
45+
- Post-delete existence checks accept the first empty response instead of retrying, reducing teardown time significantly
46+
47+
### AWS starter template updated
48+
49+
The `stackql-deploy init --provider aws` starter template now uses:
50+
- `awscc` (Cloud Control) provider instead of `aws`
51+
- CTE + INNER JOIN exists pattern with `to_aws_tag_filters`
52+
- `AWS_POLICY_EQUAL` for statecheck tag comparison
53+
- `this.<field>` identifier capture pattern
54+
- `RETURNING *` on create statements
55+
- `stackql:stack-name` / `stackql:stack-env` / `stackql:resource-name` tag taxonomy
56+
57+
### AWS VPC Web Server example
58+
59+
Complete rewrite of the `examples/aws/aws-vpc-webserver` stack (renamed from `aws-stack`) using the `awscc` provider exclusively. Includes 10 resources demonstrating all query patterns: tag-based discovery, identifier capture, property-level statechecks, PatchDocument updates, and the `to_aws_tag_filters` filter.
60+
61+
### Patch Document Test example
62+
63+
New `examples/aws/patch-doc-test` example demonstrating the Cloud Control API `UPDATE` workflow with `PatchDocument` — deploy an S3 bucket, modify its versioning config in the manifest, and re-deploy to apply the update.
64+
65+
### Other changes
66+
67+
- Fixed `init` command missing `--env` argument (defaulting to `dev`)
68+
- Added `debug` log import to build command
69+
- Debug logging now shows full `RETURNING *` payloads
70+
- Documentation updates: `resource-query-files.md`, `template-filters.md`, `manifest-file.md`, and AWS template library
71+
372
## 2.0.0 (2026-03-14)
473

574
### Initial Rust Release

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "stackql-deploy"
3-
version = "2.0.3"
3+
version = "2.0.4"
44
edition = "2021"
55
rust-version = "1.75"
66
description = "Infrastructure-as-code framework for declarative cloud resource management using StackQL"

0 commit comments

Comments
 (0)