Skip to content

feat(bridge): issue reports — create, list for the reporter and for staff, triage - #167

Merged
LESdylan merged 4 commits into
developfrom
feat/ai-issues-bridge
Oct 25, 2026
Merged

LESdylan merged 4 commits into
developfrom
feat/ai-issues-bridge

Conversation

@LESdylan

@LESdylan LESdylan commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Users had no way to report a problem from inside osionos; this adds the bridge routes for issue reports. The UI and the table ship in their own PRs.

Why

User request (2026-10-25): an Issues panel and a "Report an issue" action with a screenshot, which staff turn into a prefilled GitHub issue.

What changed

  • scripts/bridge-issues.mjs:
    • POST /api/issues creates a report for the caller. The reporter is the token's user, the workspace must be one they belong to, and the screenshot must be one of their own uploads.
    • GET /api/issues?scope=mine|all lists reports: all is staff only (requireAdmin), and staff also get the reporter's name.
    • PATCH /api/issues/:id changes the status or the GitHub link (staff).
  • Title, body, errors, app version and user agent are validated against the table's limits before PostgREST sees them:
    • tabs and CRLF are normalised;
    • other control characters are refused;
    • text is redacted (JWTs, bearer tokens, secret query values, emails);
    • each field is cut to its column after redaction.
  • A missing limit means 50, and 100 at most.
  • The daily cap (20, enforced by the table) answers 429 issue_report_daily_cap.

Evidence

  • test-bridge 4195 pass / 0 fail, lint exits 0.
  • tests/bridge/bridge-issues.test.mjs: 23 tests.
  • Revert proofs:
    • the own-upload check dropped → the POST suite fails;
    • scope=all ungated → the GET suite fails;
    • no cut after redaction → the limits suite fails.
  • The table (osionos_issue_reports) is a groot migration, applied live only on the owner's go. Until then the routes fail: a create answers 502 issue_report_failed.

Summary by CodeRabbit

  • New Features
    • Added authenticated issue reporting, including optional screenshots and workspace association.
    • Users can view their submitted reports; administrators can view reports across users and update report status or add a GitHub issue link.
    • Sensitive-looking tokens and email addresses are redacted from report text before submission. Screenshots are accepted only from the submitting user’s media path.

…tion, and ship their tests

A tab or CRLF in a report body reached PostgREST as a 502; redaction could
grow a title past its 120-character column; and a list with no limit read
Number(null) = 0 and returned one row. Tabs and line ends are normalised
before the check, every redacted field is cut to its column, and a missing
limit means 50. The suite proves each: the own-uuid check, the staff gate on
scope=all, and the cut after redaction each fail it when reverted.
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 51e79888-d406-4191-8bc5-afeb97bb1805
Commits

Reviewing files that changed from the base of the PR and between faf5a6d and 09bd9cc.

Files selected for processing: 6
  • deploy/bridge-fly/Dockerfile
  • scripts/bridge-api.mjs
  • scripts/bridge-issue-redact.mjs
  • scripts/bridge-issues.mjs
  • tests/bridge/bridge-issues.test.mjs
  • tests/bridge/support/issues-postgrest.mjs
+------------------------------------------------------+
| This code is a locked door with the key taped to it. |
+------------------------------------------------------+
  \
   \     /)/)
        ( '')
        /  |
      o(___)
Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

…b sorts with a compare

SonarCloud failed #167 on reliability: the stub's two bare sort() calls, and
the email pattern whose domain part and its dot traded characters. Labels now
exclude the dot; on 4000-character adversarial inputs the old and new
patterns both run in about 6 ms (inputs are length-checked before redaction),
and the same five sample addresses redact the same way.
@sonarqubecloud

Copy link
Copy Markdown

@SMOSTAFAH1 SMOSTAFAH1 self-assigned this Oct 25, 2026
@SMOSTAFAH1 SMOSTAFAH1 added the enhancement New feature or request label Oct 25, 2026
@SMOSTAFAH1
SMOSTAFAH1 added this pull request to stack #170 October 25, 2026 21:34
@SMOSTAFAH1
SMOSTAFAH1 removed this pull request from stack #170 October 25, 2026 21:35
@LESdylan
LESdylan merged commit 2e03a09 into develop Oct 25, 2026
53 of 58 checks passed
@SMOSTAFAH1
SMOSTAFAH1 deleted the feat/ai-issues-bridge branch October 25, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants