Skip to content

ci: integration tests + boot backfill for legacy skill versions#21

Merged
segidev merged 2 commits into
mainfrom
20-ci-run-integration-tests-in-ci-postgres-backed-no-silent-skip
Jun 1, 2026
Merged

ci: integration tests + boot backfill for legacy skill versions#21
segidev merged 2 commits into
mainfrom
20-ci-run-integration-tests-in-ci-postgres-backed-no-silent-skip

Conversation

@segidev

@segidev segidev commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

What

Two changes, both gated by the new integration CI job:

  1. CI: run integration tests (closes ci: run integration tests in CI (Postgres-backed, no silent skip) #20). New integration job runs make test-integration on every PR to main: provisions Postgres via docker-compose.test.yml, sets REQUIRE_TEST_DB=true so an unreachable DB fails the job instead of silently skipping.

  2. Boot backfill for legacy skills. Skills imported before the version system carry a 0.0.0 placeholder and no is_active pointer (prod: 9 skills all 0.0.0; staging: 3). New idempotent boot job (internal/backfill) repoints each 0.0.0 → 1.0.0 (S3 copy via registry.CopyVersion + DB rename across skills, approval_requests, tenant_approved_skills), deletes the legacy S3 key, then sets is_active on one resolved version per skill (newest available, else newest by uploaded_at). Mirrors aigent's S3KeyBackfill: per-skill errors are logged and the pass continues, so a later boot retries. Collisions (1.0.0 already present) are skipped, legacy row left intact.

Why backfill on boot, not a SQL migration

The version is part of the S3 key (<tenant>/skills/<name>/<version>/skill.zip), so renaming the DB version without moving the artifact breaks skill download. A goose migration has no S3 access; the boot job has both store + registry.

Test

  • New Postgres-backed integration test (internal/backfill/skills_integration_test.go): rename + activate + approval repoint + collision-skip.
  • Idempotent: renamed rows leave the legacy set; is_active guarded by NOT EXISTS active.

🤖 Generated with Claude Code

segidev added 2 commits June 1, 2026 17:59
Add Postgres-backed integration job that runs make test-integration on
every PR to main. The target provisions docker-compose.test.yml and sets
REQUIRE_TEST_DB=true so an unreachable DB fails the job instead of
silently skipping.

Closes #20
Skills imported before the version system carry a 0.0.0 placeholder and no
active-version pointer. Add an idempotent boot job that repoints each to
1.0.0 (S3 copy + DB rename + approval rows), deletes the legacy key, then
sets is_active on one version per skill. Mirrors aigent's S3KeyBackfill:
per-skill errors are logged and the pass continues, so a later boot retries.
Collisions (1.0.0 already present) are skipped, leaving the legacy row intact.
@segidev segidev linked an issue Jun 1, 2026 that may be closed by this pull request
3 tasks
@segidev segidev merged commit 506064a into main Jun 1, 2026
5 checks passed
@segidev segidev deleted the 20-ci-run-integration-tests-in-ci-postgres-backed-no-silent-skip branch June 1, 2026 16:45
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.

ci: run integration tests in CI (Postgres-backed, no silent skip)

1 participant