Skip to content

feat: conversation ID validation + CI pipeline - #1

Merged
mc3545dada merged 1 commit into
masterfrom
dev
May 5, 2026
Merged

mc3545dada merged 1 commit into
masterfrom
dev

Conversation

@mc3545dada

Copy link
Copy Markdown
Owner

Changes

Security: Conversation ID validation

  • Added isValidId() regex check (/^[a-z0-9_-]{6,40}$/) for all conversation routes
  • Applied to GET /api/conversations/:id, POST /api/conversations, and DELETE /api/conversations/:id
  • Returns 400 for invalid IDs to prevent path traversal

Engineering: CI + check script

  • Added npm run check script (node --check server.js)
  • Added GitHub Actions workflow (.github/workflows/ci.yml)
    • Runs on push/PR to master and dev
    • Installs deps and syntax-checks server.js

Copilot AI review requested due to automatic review settings May 5, 2026 09:04

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread .github/workflows/ci.yml
push:
branches: [master, dev]
pull_request:
branches: [master]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread .github/workflows/ci.yml
- uses: actions/setup-node@v4
with:
node-version: 20
- run: cd backend && npm install
@mc3545dada
mc3545dada merged commit c721fb7 into master May 5, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants