Repository navigation
feat: workflow counts + task times (contract v0.9.0) - #26
Merged
Merged
Conversation
- WorkflowCounts (contract.WorkflowCounter): GROUP BY state, same rows as WorkflowKeys - index __sqliteq_wf_workflows_state (state, created_at DESC, id) - task times on TaskRecord + Undo: EnqueuedAt at release, StartedAt in Runnable on true, FinishedAt at end/cancel/drop/fail-fast - Runnable: one write tx, check then stamp; unknown workflow makes no row - __sqliteq_wf_tasks: six INTEGER DEFAULT 0 time columns, guarded ALTER at open - on-demand purge store runs init: old tables migrate before Purge loads them - tests: counts per state incl. purge + sweep, task times, v0.8 schema migration
- Runnable: answer from lock-free read; yes -> stamp started_at in own write, guarded on pending state. Stamp error logged, answer stays true. Foreign write lock no longer gives "database is locked" (worker ran task on that error). - purgeStore returns err when workflow tables may exist but store cannot be prepared (check, open, init fail); Purge logs, deletes nothing. - HostLocal marker; guarded ALTER for task time columns (concurrent open). - Doc: enqueued_at = release time, kept while push waits in outbox. - Tests: Runnable under foreign lock, stamp guard, count query plan uses state index, Purge keeps jobs on corrupt workflow file.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Workflow counts + task times. Implements
contract.WorkflowCounter,contract.HostLocalandTaskRecordtimes (contract v0.9.0, goptics/varmq#191).HostLocalmarker: varmq adds host name to the store ID inGET /workflow-counts; same path on two hosts = two stores.go.mod: contract v0.8.0 -> v0.9.0; varmq ->8057d16(merge commit of feat: workflow counts + task times (contract v0.9.0) varmq#191, pseudo-version; no varmq release tag yet).Evidence
main: noWorkflowCounts, records carry no times;Runnableunder a foreign write lock gives an error.After:
GOWORK=off go build ./... && go vet ./... && go test -race -count=1 ./...queue_test.go,migration_test.go:TestWorkflowCounts,TestWorkflowTaskTimes,TestRunnableUnderForeignLock,TestRunnableStampGuard,TestPurgeKeepsJobsWithoutStore,TestMigrateWorkflowTaskTimes.Merge Danger
Door: one-way (schema)
ALTER TABLE ... ADD COLUMNon open. Older sqliteq reads the upgraded file fine (extra columns ignored); columns stay after a revert.Blast Radius: workflow store
ADD COLUMN+ oneCREATE INDEX.ADD COLUMN(not covered by a test).go.modpins varmq by pseudo-version: re-pin when varmq tags its next release.