Skip to content

feat: persist volume ttl#40

Merged
rowan-stein merged 3 commits intomainfrom
noa/issue-20
Apr 12, 2026
Merged

feat: persist volume ttl#40
rowan-stein merged 3 commits intomainfrom
noa/issue-20

Conversation

@casey-brooks
Copy link
Copy Markdown
Contributor

Summary

  • persist volume ttl on create/update and return it in responses
  • add migration for volumes.ttl column and adjust store queries
  • pin buf generation to api commit ec008b1 and extend volume tests

Testing

  • CGO_ENABLED=0 go test ./...
  • CGO_ENABLED=0 go build ./...
  • CGO_ENABLED=0 go test -json ./...

Related: agynio/runners#20

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Summary

  • persist volume ttl on create/update and return it in responses
  • add idempotent migration for volumes.ttl and update store queries
  • pin buf generation to api commit ec008b1 and extend volume coverage

Testing

  • CGO_ENABLED=0 go test ./...
  • CGO_ENABLED=0 go build ./...
  • CGO_ENABLED=0 go test -json ./...

Tests: passed 2, failed 0, skipped 0
Lint: no errors

noa-lucent
noa-lucent previously approved these changes Apr 12, 2026
Copy link
Copy Markdown

@noa-lucent noa-lucent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed all 10 files. Clean, minimal implementation that fully covers the agents-service scope of issue #20 (Volume gains ttl duration string).

What's good:

  • Migration is idempotent and adds a nullable TEXT column — no data mutations.
  • scanVolume column order matches volumeColumns (9 columns verified).
  • Create/Update handlers pass *string TTL cleanly through the boundary into the store, consistent with the existing optional-field pattern for other Volume fields.
  • Converter correctly maps nullable pgtype.Text*string via the existing stringPtrFromPg helper.
  • Unit tests cover both TTL-present and TTL-nil converter paths.
  • E2E test verifies the full create → update → get roundtrip with TTL values.

No issues found. Approving.

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Summary

  • run buf generate inside /tmp/agynio-api with workspace template/output paths
  • update CI, Dockerfile, and devspace commands to avoid outside-context errors

Testing

  • CGO_ENABLED=0 go test ./...
  • CGO_ENABLED=0 go build ./...
  • CGO_ENABLED=0 go test -json ./...

Tests: passed 2, failed 0, skipped 0
Lint: no errors

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Summary

  • run buf generate inside /tmp/agynio-api with workspace template/output paths
  • update CI, Dockerfile, and devspace commands to avoid outside-context errors

Testing

  • CGO_ENABLED=0 go vet ./...
  • CGO_ENABLED=0 go test ./...
  • CGO_ENABLED=0 go build ./...
  • CGO_ENABLED=0 go test -json ./...

Tests: passed 2, failed 0, skipped 0
Lint: no errors

noa-lucent
noa-lucent previously approved these changes Apr 12, 2026
Copy link
Copy Markdown

@noa-lucent noa-lucent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after new commit 708331e ("fix: run buf generate in api repo").

The new commit changes only build infrastructure (CI, Dockerfile, devspace) — cd into the cloned api directory before buf generate, use absolute paths for template and output. Same pattern applied across all Milestone 1 repos.

Zero changes to application code (git diff cc0a15f..708331e -- internal/ migrations/ test/ is empty). All previously reviewed logic remains intact:

  • ✅ Migration 0010_volume_ttl.sql — idempotent nullable TEXT column
  • ✅ Store: scanVolume aligned with 9-column volumeColumns, create/update handle TTL
  • ✅ Converter: toProtoVolume maps nullable pgtype.Text*string via stringPtrFromPg
  • ✅ Server: CreateVolume/UpdateVolume pass TTL through boundary to store
  • ✅ Tests: converter unit tests (TTL present/nil) + E2E create→update→get roundtrip

No new issues. Re-approving.

@casey-brooks
Copy link
Copy Markdown
Contributor Author

Summary

  • Rebased noa/issue-20 onto main and resolved store column conflicts to keep idle_timeout + volume TTL.
  • Switched Dockerfile/devspace/CI proto generation back to BSR paths to align with current API (idle_timeout).
  • Regenerated identity bindings for the updated API schema.

Testing

  • GOTOOLCHAIN=local go vet ./...
  • GOTOOLCHAIN=local go test ./...

Test Results

  • Passed: 1 package
  • Failed: 0
  • Skipped: 0
  • Lint: no errors

Copy link
Copy Markdown

@noa-lucent noa-lucent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review after rebase onto latest main (merge conflict resolution).

New commit 7e3510a ("fix(proto): align buf generation"):
Reverts CI, Dockerfile, and devspace from git-clone + commit-pin back to BSR (buf.build/agynio/api), consistent with this repo's convention on main. Dockerfile also drops the now-unnecessary apk add --no-cache git. Generated .gen/ identity stubs updated.

Application code unchanged — verified git diff a4bedb6..7e3510a -- internal/ migrations/ test/ and git diff 65a0284..a4bedb6 -- internal/ migrations/ test/ both produce zero output. All previously reviewed logic (TTL persistence, migration, converter, store, tests) remains intact.

No issues. Re-approving.

@rowan-stein rowan-stein merged commit 7f2190c into main Apr 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants