Skip to content

Update to support member.status = gift#98

Merged
JohnONolan merged 1 commit intomainfrom
gift-member-status
May 3, 2026
Merged

Update to support member.status = gift#98
JohnONolan merged 1 commit intomainfrom
gift-member-status

Conversation

@mike182uk
Copy link
Copy Markdown
Member

@mike182uk mike182uk commented Apr 30, 2026

ref https://linear.app/ghost/issue/BER-3594

Ghost added a new gift value to member.status (alongside free,paid, and comped) to represent members with a gift subscription. This change extends the CLI to recognise it:

  • Allow --status gift on ghst member list (Zod schema + help text).
  • Sum row.gift in normalizeMembersSeries's total_members fallback, so gift members aren't silently dropped from totals when Ghost's /stats/member_count/ response omits a precomputed total. Verified against Ghost 6.36, which already emits a gift bucket in member count rows and meta.totals.

Audience filtering (stats --audience) is intentionally unchanged: Ghost's Tinybird pipes only accept undefined|free|paid as inputs and fold gift sessions into paid server-side (per TryGhost/Ghost#27614), so no client change is needed there

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dc3e942e-86d4-4c90-be7c-bab3136707c6

📥 Commits

Reviewing files that changed from the base of the PR and between f8735c3 and b768e8c.

📒 Files selected for processing (6)
  • src/commands/member.ts
  • src/lib/stats.ts
  • src/schemas/member.ts
  • tests/commands-and-run.test.ts
  • tests/lib-stats.test.ts
  • tests/schemas.test.ts

Walkthrough

This change adds support for a new 'gift' member status throughout the application. The --status CLI option documentation is updated to include the new value, the input schema is extended to validate 'gift' as an accepted status, member statistics normalization logic is modified to include gift counts in total member calculations when other totals are missing, and test coverage is added across multiple test suites to verify the new status is accepted and handled correctly in command execution, schema validation, and statistics computations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding support for the 'gift' member status value across the codebase.
Description check ✅ Passed The description provides relevant context and technical details about the change, including the motivation (Ghost added a new member status), implementation details (schema updates, normalization logic), and explains intentional non-changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch gift-member-status

Review rate limit: 3/5 reviews remaining, refill in 14 minutes and 7 seconds.

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

@mike182uk mike182uk changed the title Ghost added a new gift value to member.status (alongside free, Update to support member.status = gift Apr 30, 2026
ref https://linear.app/ghost/issue/BER-3594

Ghost added a new `gift` value to `member.status` (alongside `free`,
`paid`, and `comped`) to represent members with a gift subscription.
This change extends the CLI to recognise it:

- Allow `--status gift` on `ghst member list` (Zod schema + help text).
- Sum `row.gift` in `normalizeMembersSeries`'s `total_members` fallback,
so gift members aren't silently dropped from totals when Ghost's
`/stats/member_count/` response omits a precomputed total. Verified
against Ghost 6.36, which already emits a `gift` bucket in member
count rows and `meta.totals`.

Audience filtering (`stats --audience`) is intentionally unchanged:
Ghost's Tinybird pipes only accept `undefined|free|paid` as inputs and
fold gift sessions into `paid` server-side (per TryGhost/Ghost#27614),
so no client change is needed there
@mike182uk mike182uk force-pushed the gift-member-status branch from c5146b7 to b768e8c Compare April 30, 2026 13:47
@mike182uk mike182uk marked this pull request as ready for review May 1, 2026 08:33
@JohnONolan JohnONolan merged commit 3ec9df8 into main May 3, 2026
4 checks passed
@JohnONolan JohnONolan deleted the gift-member-status branch May 3, 2026 23:20
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