Repository navigation
feat: conversation ID validation + CI pipeline - #1
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df0359d9f2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| push: | ||
| branches: [master, dev] | ||
| pull_request: | ||
| branches: [master] |
There was a problem hiding this comment.
Include dev in pull_request branch filters
The workflow only runs for pull_request events targeting master, so PRs opened against dev skip CI entirely even though dev is included for push. In teams that gate changes through PRs into dev, syntax checks in this workflow will never execute before merge, which weakens branch protection and allows breakages to land unnoticed.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR hardens the backend conversation endpoints by validating conversation IDs to prevent unsafe filesystem path usage, and adds a minimal CI workflow to syntax-check the backend server entrypoint.
Changes:
- Added
isValidId()validation for conversation IDs and enforced it on GET/POST/DELETE conversation routes. - Introduced
npm run check(node --check server.js) for quick backend syntax validation. - Added a GitHub Actions CI workflow to run the check on pushes/PRs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| backend/server.js | Adds conversation ID regex validation and returns 400 on invalid IDs for conversation routes. |
| backend/package.json | Adds check script for syntax-checking server.js. |
| .github/workflows/ci.yml | Adds CI job to install dependencies and run npm run check on Node 20. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| - run: cd backend && npm install |
Changes
Security: Conversation ID validation
isValidId()regex check (/^[a-z0-9_-]{6,40}$/) for all conversation routesGET /api/conversations/:id,POST /api/conversations, andDELETE /api/conversations/:idEngineering: CI + check script
npm run checkscript (node --check server.js).github/workflows/ci.yml)