Added post export permissions to the backup integration - #30138
Conversation
|
It looks like this PR contains a migration 👀 General requirements
Schema changes
Data changes
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: QUIET Plan: Pro Run ID: 📒 Files selected for processing (1)
Included review availability: 2 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour. 📜 Recent review details⏰ Context from checks skipped due to timeout. (11)
🧰 Additional context used📓 Path-based instructions (3)**/*.{js,jsx,cjs,mjs}📄 CodeRabbit inference engine (Custom checks)
Files:
⚙️ CodeRabbit configuration file
Files:
**/*📄 CodeRabbit inference engine (AGENTS.md)
Files:
⚙️ CodeRabbit configuration file
Files:
**/*{.,-}{test,spec}.{js,jsx,ts,tsx}⚙️ CodeRabbit configuration file
Files:
🔇 Additional comments (1)
WalkthroughThe 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run ghost:test:ci:integration |
✅ Succeeded | 2m 59s | View ↗ |
nx run ghost:test:integration |
✅ Succeeded | 3m 25s | View ↗ |
nx run ghost:test:e2e |
✅ Succeeded | 3m 4s | View ↗ |
nx run ghost:test:legacy |
✅ Succeeded | 2m 30s | View ↗ |
nx run ghost-monorepo:lint:boundaries |
✅ Succeeded | 22s | View ↗ |
nx run-many -t lint -p ghost,ghost-monorepo |
✅ Succeeded | 24s | View ↗ |
nx run-many -t test:unit -p ghost |
✅ Succeeded | 27s | View ↗ |
nx run @tryghost/admin:build |
✅ Succeeded | 8s | View ↗ |
nx run-many --target=build --projects=tag:publi... |
✅ Succeeded | <1s | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-08-20 13:29:37 UTC
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #30138 +/- ##
==========================================
- Coverage 75.54% 75.54% -0.01%
==========================================
Files 1635 1635
Lines 145877 145920 +43
Branches 18189 18202 +13
==========================================
+ Hits 110197 110229 +32
- Misses 34652 34689 +37
+ Partials 1028 1002 -26
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
7da2404 to
5fa7d38
Compare
ref https://linear.app/ghost/issue/GVA-907/ - Ghost(Pro) archives are gaining a `post-analytics.csv` alongside the existing `members.csv`, fetched from `GET /ghost/api/admin/posts/export/` with the `ghost-backup` integration key, and that endpoint is gated on `browse post` - There is no explicit export posts permission, so we use browse posts - exactly how `browse member` was added to this role in v5.121.0 to allow the members export - The role already holds `db: all`, and `posts` is in the database exporter's `TABLES_ALLOWLIST`, so the key can already read every post in full through the db export; this grants no data it could not already reach, just a narrower capability through a different door - It does open `/posts/` browse generally rather than only the export route, since permissions are per action type rather than per endpoint - Applied in fixtures and with a migration so both new and existing sites get the update, and mirrored into the test fixtures
5fa7d38 to
4c67d5d
Compare

ref https://linear.app/ghost/issue/GVA-907/
post-analytics.csvalongside the existingmembers.csv, fetched fromGET /ghost/api/admin/posts/export/with theghost-backupintegration key, and that endpoint is gated onbrowse postbrowse memberwas added to this role in v5.121.0 to allow the members exportpostsis in the exporter'sTABLES_ALLOWLIST, so a plainGET /db/already returns every post's title, html and lexical. The analytics counts: they derive fromemails,email_recipients,members_click_eventsandmembers_feedback, none of which are in that allowlist - butexportContentaccepts anincludeoption validated againstBACKUP_TABLES(db.js:45-56), which contains all of them, soGET /db/?include=emails,members_click_eventsworks with today's key/posts/browse generally rather than only the export route, since permissions are per action type rather than per endpointpost|browse, and theghost-backupkey then gets a 200 from/posts/export/?limit=all. A Zapier key is still refused on/db/