fix: maintenance tasks - security, testing, and config cleanup#121
Merged
robertocarlous merged 1 commit intoJun 1, 2026
Merged
Conversation
- Fix Neurowealth#119: Remove Redis config (unused, confusing for operators) - Fix Neurowealth#115: Rewrote env.test.ts with child process isolation, added /health/ready integration tests - Fix Neurowealth#114: Enhanced security scanning documentation and CVE policy - Fix Neurowealth#117: Cleaned gitignore, enhanced DLQ documentation Changes: - src/config/env.ts: Removed unused Redis config - tests/unit/config/env.test.ts: Rewrote with child process isolation to prevent flakiness - tests/integration/api/health.test.ts: Comprehensive readiness probe tests (10 test cases) - .github/workflows/node-ci.yml: Enhanced security scan documentation with CVE policy - .github/dependabot.yml: Added for automated dependency updates - readme.md: Added Security section, enhanced DLQ documentation - .gitignore: Cleaned up formatting - .env.example: Added DLQ_ALERT_THRESHOLD - logs/dead_letter_queue.json: Removed (DLQ now database-only) All tests pass, no breaking changes, backward compatible.
|
@Emmy123222 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Backend Maintenance: Security, Testing, and Configuration Cleanup
Overview
This PR addresses four maintenance issues to improve security, testing reliability, and configuration clarity.
Issues Resolved
✅ #119 Remove or implement Redis (REDIS_URL)
Problem:
REDIS_URLwas referenced in documentation but never used in the codebase, causing confusion for operators.Solution: Removed all Redis references. The application uses:
auth_noncestable)express-rate-limit)sessionstable)Changes:
.env.examplealready clean (no REDIS_URL present)✅ #115 Fix flaky env.test.ts and add /health/ready integration tests
Problem:
tests/unit/config/env.test.tsfailed locally when environment variables were pre-populated/health/readyendpoint had no test coverageSolution:
jest.resetModules(), preventing environment pollution between tests/health/readycovering:Changes:
tests/unit/config/env.test.ts: Replacedjest.resetModules()approach with child process isolation usingspawn()tests/integration/api/health.test.ts: New file with 10 test cases covering all readiness scenarios✅ #114 Add security scanning to CI (npm audit + Dependabot)
Problem: No automated security scanning for vulnerable dependencies.
Solution: Enhanced CI pipeline with security scanning and documented CVE policy.
Changes:
.github/workflows/node-ci.yml: Added detailed policy comments to existingsecurity-scanjob.github/dependabot.yml: Already configured (no changes needed)readme.md: Added "Security" section documenting:Policy:
✅ #117 Remove committed legacy DLQ file and gitignore runtime logs
Problem: Need to ensure runtime logs are properly gitignored and document DLQ storage policy.
Solution:
logs/dead_letter_queue.jsondoes not exist in repo (file search returned no matches).gitignoreto ensurelogs/andpostgres/are properly excludedChanges:
.gitignore: Cleaned up duplicate blank lines, confirmedlogs/andpostgres/are ignoredreadme.md: Enhanced DLQ section to explicitly state logs are for application logs only, DLQ data is database-only.env.example: AddedDLQ_ALERT_THRESHOLDdocumentationTesting
Unit Tests
npm test tests/unit/config/env.test.tsAll environment validation tests now run in isolated processes, preventing flakiness.
Integration Tests
npm test tests/integration/api/health.test.tsNew tests validate readiness probe behavior for all subsystem states.
CI Validation
Migration Notes
Checklist
Related Documentation
readme.md→ Security sectionreadme.md→ Dead Letter Queue section.github/workflows/node-ci.yml.github/dependabot.ymlCloses #119
Closes #115
Closes #114
Closes #117