-
Notifications
You must be signed in to change notification settings - Fork 0
feat(fixtures): plug-in framework + eql_v2_int4 reference fixture #238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c68c4b4
docs: design encrypted domain type prototype
tobyhede c43b5ba
feat(bench): fixture and benchmark data-generation foundation
tobyhede 4d0a81c
feat(fixtures): add typed SQLx fixture generation
tobyhede 457b9d1
refactor(fixtures): replace Proxy with direct cipherstash-client
tobyhede f8dfd92
Add CipherStash secrets to EQL test workflow
tobyhede ded50df
perf(fixtures): batch encrypt_store and add cipherstash test coverage
tobyhede ecacbe3
chore(mise): make test:sqlx depend on build
tobyhede d1718ad
fix(ci): supply client-key creds to fixture generator in test workflow
tobyhede File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| ["fixture:generate"] | ||
| description = "Generate a SQLx fixture script via cipherstash-client" | ||
| # Runs the gated generator for the named fixture. Writes | ||
| # tests/sqlx/fixtures/<fixture>.sql. Must run inside the crate — there is no | ||
| # root Cargo.toml — matching test:schema / test:sqlx:watch. | ||
| # | ||
| # Prerequisites: | ||
| # - mise run postgres:up (Postgres with EQL installed) | ||
| # - CS_* credentials in the shell environment. The generator needs BOTH | ||
| # pairs — they are not alternatives: | ||
| # CS_CLIENT_ACCESS_KEY + CS_WORKSPACE_CRN ZeroKMS auth (AutoStrategy) | ||
| # CS_CLIENT_ID + CS_CLIENT_KEY client key (EnvKeyProvider) | ||
| # | ||
| # Usage: mise run fixture:generate eql_v2_int4 | ||
| dir = "{{config_root}}/tests/sqlx" | ||
| run = """ | ||
| fixture="{{arg(name="fixture")}}" | ||
| case "$fixture" in | ||
| (*[!a-z0-9_]*|'') echo "Invalid fixture name: $fixture (expected [a-z0-9_]+)" >&2; exit 1 ;; | ||
| esac | ||
|
|
||
| cargo test --features fixture-gen --lib \ | ||
| "fixtures::${fixture}::generate" \ | ||
| -- --ignored --exact --nocapture | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| """ | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test:sqlxnow hard-requires CS credentials and breaks the default CI test path.This step is unconditional, so SQLx tests fail in environments without
CS_*secrets (already visible in current pipeline failures). Make fixture regeneration opt-in or conditional, and keeptest:sqlxrunnable without external credentials.Suggested adjustment
# Regenerate fixtures every run — they are not committed (see .gitignore). # Generator encrypts via cipherstash-client directly; CS_* credentials must # be present in the shell environment (CS_CLIENT_ACCESS_KEY + # CS_WORKSPACE_CRN, or the legacy CS_CLIENT_ID/CS_CLIENT_KEY pair). echo "Regenerating SQLx fixtures..." cd "{{config_root}}" -mise run fixture:generate eql_v2_int4 +if { [ -n "${CS_CLIENT_ACCESS_KEY:-}" ] && [ -n "${CS_WORKSPACE_CRN:-}" ]; } || \ + { [ -n "${CS_CLIENT_ID:-}" ] && [ -n "${CS_CLIENT_KEY:-}" ]; }; then + mise run fixture:generate eql_v2_int4 +else + echo "Skipping fixture regeneration (CS_* credentials not present)." +fi🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test coverage requires the fixtures. This is a hard requirement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tobyhede, understood — if the fixtures are a mandatory test dependency and CI is already provisioned with the required credentials, keeping regeneration unconditional makes sense. I'll withdraw the suggestion.✏️ Learnings added