GitHub user yangzhang75 added a comment to the discussion: Proposal: Report a 
Public Workflow

Implemented on my fork, split into 3 small stacked PRs. Feedback welcome before 
I open them.

### Demo

video link : 
https://drive.google.com/file/d/1nMyHOhSdPEiS7viiSHcJ8maG9ehS6eqI/view?usp=sharing

<img width="1470" height="749" alt="Screenshot 2026-07-14 at 1 10 28 PM" 
src="https://github.com/user-attachments/assets/c14552a2-94a3-4100-84ae-ef3727df7db1";
 />
<img width="1504" height="753" alt="Screenshot 2026-07-14 at 1 11 08 PM" 
src="https://github.com/user-attachments/assets/d74c8021-877d-4018-8218-2f8b98d72b71";
 />

<img width="1280" height="585" alt="Screenshot 2026-07-14 at 1 12 12 PM" 
src="https://github.com/user-attachments/assets/c1a719b6-7f8c-4a52-bdf1-ca0ae4742682";
 />


<img width="1042" height="589" alt="Screenshot 2026-07-14 at 1 11 32 PM" 
src="https://github.com/user-attachments/assets/44c9f0e9-f55e-463d-8108-9b9414cad8fe";
 />


### Flow

```mermaid
flowchart TD
    R["User reports a<br/>public workflow"] --> P[("PENDING")]
    P --> A{"Admin reviews"}
    A -->|"Dismiss"| C["CLOSED"]
    A -->|"Unpublish"| U["workflow → private<br/>(ACTIONED)"]
    U --> O["Owner notified<br/>(dialog + ⚠️)"]
    O -->|"Republish"| C
```


- **Reporter** — clicks **Report** on a public workflow, picks a reason. Can't 
report their own, or twice while pending.
- **Admin** — an **Admin ▸ Reports** page shows pending reports (still-public 
only), grouped by workflow; can **Dismiss** or **Unpublish**.
- **Owner** — when unpublished by moderation, sees a one-time dialog + a ⚠️ 
marker; republishing clears it.

### Backend

One new table `workflow_report` + enum `report_status_enum` (PENDING / CLOSED / 
ACTIONED), migration 28. Endpoints under `/report`: report, list, dismiss, 
unpublish, and two owner-notice reads.

<details><summary>schema</summary>

```sql
CREATE TYPE report_status_enum AS ENUM ('PENDING', 'CLOSED', 'ACTIONED');

CREATE TABLE workflow_report (
    report_id       SERIAL PRIMARY KEY,
    wid             INT NOT NULL,
    reporter_uid    INT NOT NULL,
    reason          VARCHAR(64) NOT NULL,
    detail          TEXT,
    status          report_status_enum NOT NULL DEFAULT 'PENDING',
    resolver_uid    INT,
    creation_time   TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    resolved_time   TIMESTAMP,
    FOREIGN KEY (wid)          REFERENCES workflow(wid) ON DELETE CASCADE,
    FOREIGN KEY (reporter_uid) REFERENCES "user"(uid)   ON DELETE CASCADE,
    FOREIGN KEY (resolver_uid) REFERENCES "user"(uid)   ON DELETE SET NULL
);
```
</details>

### PR plan (merge in order)

1. **Backend + schema** — table, migration 28, `ReportResource` + tests.
2. **Frontend: report + admin** — Report dialog on the Hub, Admin ▸ Reports 
page. _(needs part 1)_
3. **Frontend: owner notice** — dialog + ⚠️ markers. _(needs part 2)_

GitHub link: 
https://github.com/apache/texera/discussions/6242#discussioncomment-17640224

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to