Skip to content

fix(backend): satisfy prettier + eslint on CORS helper (unblock main CI)#216

Open
ianlintner wants to merge 3 commits into
mainfrom
fix/ci-lint-format-post-merge
Open

fix(backend): satisfy prettier + eslint on CORS helper (unblock main CI)#216
ianlintner wants to merge 3 commits into
mainfrom
fix/ci-lint-format-post-merge

Conversation

@ianlintner
Copy link
Copy Markdown
Owner

Why

PR #211 merged successfully but the follow-up CI on main failed on two steps:

  1. Format check (prettier --check .)backend/src/index.ts was not prettier-clean.
  2. Backend lint (eslint src --ext .ts) — 2 errors + 4 curly warnings in the new CORS helper.

As a consequence the embed bundle was never rebuilt/redeployed, so the production widget at chat.cat-herding.net/embed/cat-herding-chat.js is still the old Apr 22 version: still light-themed, sign-in gate still takes the full panel, input row still hidden when unauthed. The CORS fix is live (backend image was rebuilt separately), but the widget UX fixes from #211 are invisible to users until CI goes green here.

What

backend/src/index.ts:

  • Collapse CAT_HERDING_ORIGIN_RE assignment + regex literal onto a single line (prettier).
  • Wrap every early-return if (...) return true; inside isAllowedOrigin() in { ... } braces to satisfy eslint-plugin-* curly rule.

No functional change — the CORS decision logic is identical.

Verification

  • Original CI errors (run 24814565934):
    • 101:30 error Delete ⏎·
    • 119:7 error Replace ... with ...
    • 117:16, 118:43, 120:5, 122:5 warning Expected { after 'if' condition
  • All lines rewritten to match prettier + eslint expectations.

After merging

CI on main should go green, the embed bundle gets rebuilt, and chat.cat-herding.net/embed/cat-herding-chat.js starts serving the dark-themed + always-on input + compact sign-in banner version. Portfolio /chat page will pick it up automatically on next load.

- Keep CAT_HERDING_ORIGIN_RE on a single line (prettier)
- Wrap all early-return 'if' bodies in braces to satisfy eslint curly rule

Unblocks main CI so the embed bundle can be rebuilt and the widget
unauthenticated + dark theme fixes from #211 can actually ship.
@github-actions github-actions Bot added the claude-code claude-code-action trigger label Apr 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

@claude caretaker is requesting a full code review for this PR.

Repo: ianlintner/Example-React-AI-Chat-App · PR: #216
Routing reason: score=0 [low-complexity] → inline

Please review this pull request for:

  • Correctness and logic errors
  • Security vulnerabilities or unsafe patterns
  • API contract and backward-compatibility concerns
  • Test coverage gaps
  • Any blocking issues before merge

Post a review comment summary and inline comments where applicable.

Delegated by caretaker's PRReviewerAgent via ClaudeCodeExecutor hand-off.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 25, 2026

⚠️ Caretaker Escalation

This PR requires human attention.

Reason: Open >24h with no human approval — needs review

The automated system has exhausted its ability to resolve this. Please review and take appropriate action.

Escalation debug dump

Generated at: 2026-05-23T15:26:59.126947+00:00

{
  "debug": {
    "copilot_attempts": 0,
    "fix_cycles": 0,
    "pr_age_hours": 722.5996325355557,
    "recommended_action": "escalate",
    "stuck_age_hours": 24,
    "stuck_confidence": 0.5,
    "stuck_reason": "abandoned"
  },
  "owner": "ianlintner",
  "pull_request": {
    "base_ref": "main",
    "draft": false,
    "head_ref": "fix/ci-lint-format-post-merge",
    "html_url": "https://github.com/ianlintner/Example-React-AI-Chat-App/pull/216",
    "is_copilot_pr": false,
    "is_maintainer_pr": true,
    "mergeable": null,
    "number": 216,
    "state": "open",
    "title": "fix(backend): satisfy prettier + eslint on CORS helper (unblock main CI)"
  },
  "reason": "Open >24h with no human approval \u2014 needs review",
  "repo": "Example-React-AI-Chat-App",
  "type": "pr_escalation"
}

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

{
  "summary": "This PR fixes formatting and linting issues by adding braces to conditional statements and reformatting code to satisfy prettier and eslint rules. The changes are purely stylistic with no functional modifications to the CORS logic.",
  "verdict": "APPROVE",
  "comments": []
}

@github-actions github-actions Bot added the caretaker:reviewed Reviewed by caretaker label Apr 25, 2026
@ianlintner
Copy link
Copy Markdown
Owner Author

@copilot please fix ci type errors

Copy link
Copy Markdown
Contributor

Copilot AI commented May 5, 2026

@copilot please fix ci type errors

Fixed in 33c3a31. The CI embed job was failing with TS6133: 'inputRowEl' is declared but its value is never read — the property was stored but never used after the input row was made always-visible. Removed the private field declaration and its assignment; npm run typecheck and npm run build in embed/ both pass cleanly now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

caretaker:reviewed Reviewed by caretaker claude-code claude-code-action trigger maintainer:escalated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants