Run encryption tests in CI with test keys #4335
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.60) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.60 · 238 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.328
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.060
Real PR Conversation Timeline
1 comments
"Review active on #4335"
general
weight: 0.35
jjmata
Problem
Every encryption test skips in CI. They check
encryption_ready?, which is only true when the Active Record encryption keys come from ENV or credentials.config/environments/test.rbsets the keys as runtime config only, and thetest_unitjob sets noACTIVE_RECORD_ENCRYPTION_*variables. Soencryptsdeclarations, thesecurity:backfill_encryptiontask and encryption data migrations are never exercised in CI, and a regression in them stays green.Change
A new step at the end of
test_unitsets throwaway keys and reruns every test file that containsencryption_ready?(12 files on current main). Files are selected by grep, so new encryption tests are picked up without a hand-kept list, and the step fails if none are found. It runs withif: ${{ !cancelled() }}, so it still reports when the main test run fails.Only these files run with keys. Running the whole suite with keys fails in about 185 unrelated tests that assume encryption is off, so that is out of scope here.
Effects
test_unittakes about 30 seconds longer. No new job, no app or data changes.encryption_ready?usesready?), these tests already run in the main step and this step can be removed.Validation
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
- Added automated coverage for encryption-related functionality in the test workflow.
- The workflow now detects relevant tests, verifies they exist, and runs them with temporary encryption settings.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->