Skip to content

Conversation

@rob-ghost
Copy link
Contributor

@rob-ghost rob-ghost commented Jan 13, 2026

ref https://linear.app/ghost/issue/FEA-487

Summary

Adds schema support for member comment moderation, enabling admins to disable/enable commenting for specific members.

Changes

  • Added can_comment (boolean) to member properties - computed field indicating if member can comment
  • Added commenting property to member schema with member-commenting definition:
    • disabled (boolean, required): whether commenting is disabled
    • disabled_reason (string, minLength: 1, maxLength: 2000): explanation for disabling
    • disabled_until (string|null, format: date-time): optional expiration for temporary disables
  • Added member_commenting.json base schema for the disable endpoint
  • Added member_commenting-disable.json schema for /members/:id/commenting endpoint

@coderabbitai
Copy link

coderabbitai bot commented Jan 13, 2026

Walkthrough

The PR removes packages/admin-api-schema/lib/schemas/comment_bans-add.json, adds packages/admin-api-schema/lib/schemas/member_commenting-disable.json, renames schema $id/title/description and the definition name from "comment_bans"/"comment_ban" to "member_commenting"/"member_commenting" in packages/admin-api-schema/lib/schemas/member_commenting.json, updates packages/admin-api-schema/lib/schemas/index.js to export 'member_commenting-disable' instead of 'comment_bans-add', replaces an inline comment ban schema in members-edit.json with a $ref to members#/definitions/member-commenting, and replaces the comment_ban property in members.json with a commenting property plus a new member-commenting definition.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title accurately describes the main objective: adding member commenting schema for comment moderation functionality.
Description check ✅ Passed The description is directly related to the changeset, providing clear context about adding schema support for member comment moderation with relevant property details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @packages/admin-api-schema/lib/schemas/member_commenting.json:
- Around line 3-7: Index.js still imports or references the removed
"comment_bans-add" schema causing runtime failures; open
packages/admin-api-schema/lib/schemas/index.js, locate the reference to
"comment_bans-add" and either replace it with the new "member_commenting" (or
"member_commenting-disable" if that was intended) or remove the entry if it's
obsolete, and update any export/key names to match the renamed schema
identifiers so the schema loader references the existing member_commenting
files.
🧹 Nitpick comments (1)
packages/admin-api-schema/lib/schemas/member_commenting-disable.json (1)

13-15: Consider simplifying the allOf wrapper.

The allOf with a single $ref is slightly redundant. You can reference the definition directly in items.

✨ Suggested simplification
       "items": {
-        "allOf": [{ "$ref": "member_commenting#/definitions/member_commenting" }]
+        "$ref": "member_commenting#/definitions/member_commenting"
       }
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a5b249c and a5ba3c9.

📒 Files selected for processing (3)
  • packages/admin-api-schema/lib/schemas/comment_bans-add.json
  • packages/admin-api-schema/lib/schemas/member_commenting-disable.json
  • packages/admin-api-schema/lib/schemas/member_commenting.json
💤 Files with no reviewable changes (1)
  • packages/admin-api-schema/lib/schemas/comment_bans-add.json
🔇 Additional comments (1)
packages/admin-api-schema/lib/schemas/member_commenting-disable.json (1)

1-19: Verify if an enable endpoint requires a corresponding schema file.

The schema naming convention documented in the README uses {resourceName}-{methodName}.json for endpoint-specific schemas. A member_commenting-disable.json file exists, but there is no member_commenting-enable.json. If an enable endpoint is also being implemented, following the established convention would require adding a corresponding schema file for request body validation. Confirm whether the enable endpoint is in scope for this PR.

@rob-ghost rob-ghost force-pushed the rob/commenting-api branch 3 times, most recently from a45dc47 to 53b99ac Compare January 13, 2026 13:24
@rob-ghost rob-ghost marked this pull request as draft January 13, 2026 13:35
@rob-ghost rob-ghost force-pushed the rob/commenting-api branch 2 times, most recently from 21f47a8 to cddf551 Compare January 13, 2026 13:40
@rob-ghost rob-ghost marked this pull request as ready for review January 13, 2026 13:46
ref https://linear.app/ghost/issue/FEA-487

- Added `can_comment` (boolean) to member properties
- Added `commenting` property to member with `member-commenting` definition:
  - `disabled` (boolean, required)
  - `disabled_reason` (string, minLength: 1, maxLength: 2000)
  - `disabled_until` (string|null, format: date-time)
- Added `member_commenting.json` base schema for disable endpoint
- Added `member_commenting-disable.json` schema for `/members/:id/commenting` endpoint
@rob-ghost rob-ghost changed the title Renamed comment_bans schema to member_commenting Added member commenting schema for comment moderation Jan 20, 2026
ref https://linear.app/ghost/issue/FEA-487

Adds optional `hide_comments` boolean to the disable endpoint, allowing
admins to hide a member's existing comments when disabling their ability
to comment.
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