Conversation
Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
… TTL caching Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add step.db_query_cached for single-step database query with TTL caching
feat: Add step.db_query_cached — single-step DB query with in-process TTL caching
Mar 2, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new pipeline step type, step.db_query_cached, to reduce the common cache_get → db_query → cache_set pattern into a single step that performs a DB SELECT and caches the first-row result in-process with a TTL.
Changes:
- Implements
DBQueryCachedStepwith an in-step TTL cache keyed by a template-resolvedcache_key. - Registers the new step across plugin registration, schema/type registries, and CLI known-types.
- Adds unit tests covering cache hit/miss, TTL expiry, scan_fields filtering, template params, and validation errors.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
module/pipeline_step_db_query_cached.go |
New cached DB query step implementation (TTL map + query execution). |
module/pipeline_step_db_query_cached_test.go |
Unit tests for cached behavior and config validation. |
plugins/pipelinesteps/plugin.go |
Registers step.db_query_cached in step types and factories. |
plugins/pipelinesteps/plugin_test.go |
Updates expected step factory list to include the new step. |
schema/schema.go |
Adds step.db_query_cached to core step/module types list. |
schema/module_schema.go |
Adds schema definition for the new step’s config fields. |
cmd/wfctl/type_registry.go |
Adds CLI registry entry for step.db_query_cached. |
example/go.mod / example/go.sum |
Updates indirect dependencies in the example module. |
Contributor
|
@copilot apply changes based on the comments in this thread Also address failing linter checks |
…chema clarity, test coverage Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
Contributor
Author
Applied all review feedback in d2cfbe8:
|
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.
module/pipeline_step_db_query_cached.gowithDBQueryCachedStep(in-memory TTL cache + DB query)module/pipeline_step_db_query_cached_test.gowith unit testsstep.db_query_cachedinplugins/pipelinesteps/plugin.gostep.db_query_cachedtoschema/schema.go(coreStepTypes list)schema/module_schema.gocmd/wfctl/type_registry.goOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.