Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions ghost/core/core/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,12 @@ async function initServices() {
debug('Begin: initServices');

debug('Begin: Services');
// NOTE: If you need to add dependencies for services, use npm install <package>
const identityTokens = require('./server/services/identity-tokens');
const stripe = require('./server/services/stripe');
const members = require('./server/services/members');
const tiers = require('./server/services/tiers');
const permissions = require('./server/services/permissions');
const xmlrpc = require('./server/services/xmlrpc');
const slack = require('./server/services/slack');
const webhooks = require('./server/services/webhooks');
const scheduling = require('./server/adapters/scheduling');
Expand Down Expand Up @@ -347,9 +347,9 @@ async function initServices() {
await stripe.init();

// NOTE: newsletter service and email service depend on email address service
await emailAddressService.init(),

await Promise.all([
emailAddressService.init(),
identityTokens.init(),
memberAttribution.init(),
mentionsService.init(),
Expand All @@ -361,15 +361,11 @@ async function initServices() {
postsPublic.init(),
membersEvents.init(),
permissions.init(),
xmlrpc.listen(),
slack.listen(),
audienceFeedback.init(),
emailService.init(),
emailAnalytics.init(),
webhooks.listen(),
scheduling.init({
apiUrl: urlUtils.urlFor('api', {type: 'admin'}, true)
}),
scheduling.init(),
comments.init(),
Comment on lines 366 to 369
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for scheduling-related files
echo "=== Searching for scheduling adapter files ==="
fd "scheduling" --type f -E node_modules | head -20

echo ""
echo "=== Searching for scheduling.init() implementations ==="
rg "scheduling.*init\s*\(" --type js -A 5 -B 2 | head -50

echo ""
echo "=== Searching for init method in adapter files ==="
rg -t js "^\s*init\s*\(" | grep -i scheduling | head -20

Repository: qodo-benchmark/Ghost-combined-coderabbit

Length of output: 1022


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Look for the scheduling adapter in ghost/core
find ghost/core -name "*scheduling*" -type f 2>/dev/null | head -20

Repository: qodo-benchmark/Ghost-combined-coderabbit

Length of output: 434


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Search for adapter files more broadly
find . -path ./node_modules -prune -o -name "adapter*" -type f -print 2>/dev/null | grep -i schedul

# Also search for init files
find . -path ./node_modules -prune -o -name "*.js" -type f -print 2>/dev/null | xargs grep -l "scheduling.*init" | head -10

Repository: qodo-benchmark/Ghost-combined-coderabbit

Length of output: 66


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== scheduling-default.js ==="
cat -n ghost/core/core/server/adapters/scheduling/scheduling-default.js

echo ""
echo "=== scheduling-base.js ==="
cat -n ghost/core/core/server/adapters/scheduling/scheduling-base.js

Repository: qodo-benchmark/Ghost-combined-coderabbit

Length of output: 13105


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check size first
wc -l ghost/core/core/server/adapters/scheduling/scheduling-default.js
wc -l ghost/core/core/server/adapters/scheduling/scheduling-base.js

Repository: qodo-benchmark/Ghost-combined-coderabbit

Length of output: 216


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== boot.js context around line 366-369 ==="
sed -n '340,400p' ghost/core/core/boot.js

echo ""
echo "=== Searching for scheduling initialization/import in boot.js ==="
rg -n "scheduling\s*=" ghost/core/core/boot.js -B 3 -A 3

Repository: qodo-benchmark/Ghost-combined-coderabbit

Length of output: 2557


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== post-scheduling-service.js content ==="
wc -l ghost/core/core/server/services/posts/post-scheduling-service.js
head -150 ghost/core/core/server/services/posts/post-scheduling-service.js

Repository: qodo-benchmark/Ghost-combined-coderabbit

Length of output: 3558


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Files in scheduling adapter directory ==="
ls -la ghost/core/core/server/adapters/scheduling/

echo ""
echo "=== Look for index.js or check package structure ==="
find ghost/core/core/server/adapters/scheduling -name "*.js" -type f | sort

Repository: qodo-benchmark/Ghost-combined-coderabbit

Length of output: 1165


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Checking for index.js or wrapper ==="
find ghost/core/core/server/adapters/scheduling -maxdepth 1 -name "index.js" -o -name "wrapper.js"

echo ""
echo "=== Searching for init function in scheduling adapter ==="
rg -n "init\s*\(" ghost/core/core/server/adapters/scheduling/ --type js

Repository: qodo-benchmark/Ghost-combined-coderabbit

Length of output: 330


🏁 Script executed:

#!/bin/bash
set -euoripefail

echo "=== scheduling adapter index.js ==="
cat -n ghost/core/core/server/adapters/scheduling/index.js

echo ""
echo "=== PostScheduler.js ==="
cat -n ghost/core/core/server/adapters/scheduling/post-scheduling/PostScheduler.js

echo ""
echo "=== post-scheduling/index.js ==="
cat -n ghost/core/core/server/adapters/scheduling/post-scheduling/index.js

Repository: qodo-benchmark/Ghost-combined-coderabbit

Length of output: 758


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== scheduling adapter index.js ==="
cat -n ghost/core/core/server/adapters/scheduling/index.js

echo ""
echo "=== PostScheduler.js ==="
cat -n ghost/core/core/server/adapters/scheduling/post-scheduling/PostScheduler.js

echo ""
echo "=== post-scheduling/index.js ==="
cat -n ghost/core/core/server/adapters/scheduling/post-scheduling/index.js

Repository: qodo-benchmark/Ghost-combined-coderabbit

Length of output: 6504


scheduling.init() is missing required apiUrl parameter.

In post-scheduling/index.js line 46, the PostScheduler constructor receives apiUrl: options.apiUrl, and the PostScheduler class (line 10 in PostScheduler.js) explicitly throws an IncorrectUsageError if apiUrl is missing. Since scheduling.init() is called without arguments in boot.js, this will cause a boot failure. The adapter does not fall back to deriving the URL from config—the parameter must be passed to init().

🤖 Prompt for AI Agents
In `@ghost/core/core/boot.js` around lines 366 - 369, scheduling.init() is being
called without the required apiUrl causing PostScheduler to throw; update the
boot sequence to call scheduling.init(...) passing the API URL option used to
construct PostScheduler (the same options.apiUrl passed in
post-scheduling/index.js to PostScheduler), i.e. locate the scheduling.init()
call in core/boot.js and supply the apiUrl from the boot options/context so
PostScheduler (PostScheduler.js) receives apiUrl and does not raise
IncorrectUsageError.

linkTracking.init(),
emailSuppressionList.init(),
Expand Down
134 changes: 0 additions & 134 deletions ghost/core/core/server/services/xmlrpc.js

This file was deleted.

1 change: 0 additions & 1 deletion ghost/core/core/shared/config/env/config.development.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"contentPath": "content/"
},
"privacy": {
"useRpcPing": false,
"useUpdateCheck": true
},
"useMinFiles": false,
Expand Down
Loading