-
Notifications
You must be signed in to change notification settings - Fork 0
Changed member welcome email job to run based on config #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: coderabbit_combined_20260121_qodo_grep_cursor_copilot_base_changed_member_welcome_email_job_to_run_based_on_config_pr246
Are you sure you want to change the base?
Changes from all commits
6d57f83
3fa71dd
5d1fdee
ca932dd
30dff3b
96cac63
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,7 @@ const ObjectId = require('bson-objectid').default; | |||||||||
| const {NotFoundError} = require('@tryghost/errors'); | ||||||||||
| const validator = require('@tryghost/validator'); | ||||||||||
| const crypto = require('crypto'); | ||||||||||
| const config = require('../../../../../shared/config'); | ||||||||||
|
|
||||||||||
| const messages = { | ||||||||||
| noStripeConnection: 'Cannot {action} without a Stripe Connection', | ||||||||||
|
|
@@ -336,8 +337,9 @@ module.exports = class MemberRepository { | |||||||||
| const eventData = _.pick(data, ['created_at']); | ||||||||||
|
|
||||||||||
| const memberAddOptions = {...(options || {}), withRelated}; | ||||||||||
| let member; | ||||||||||
| if (this._labsService.isSet('welcomeEmails') && WELCOME_EMAIL_SOURCES.includes(source)) { | ||||||||||
| var member; | ||||||||||
| const welcomeEmailConfig = config.get('memberWelcomeEmailTestInbox'); | ||||||||||
| if (welcomeEmailConfig || WELCOME_EMAIL_SOURCES.includes(source)) { | ||||||||||
|
Comment on lines
+341
to
+342
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -type f -name "MemberRepository.js" | head -5Repository: qodo-benchmark/Ghost-combined-coderabbit Length of output: 170 🏁 Script executed: wc -l ghost/core/core/server/services/members/members-api/repositories/MemberRepository.jsRepository: qodo-benchmark/Ghost-combined-coderabbit Length of output: 173 🏁 Script executed: sed -n '330,355p' ghost/core/core/server/services/members/members-api/repositories/MemberRepository.jsRepository: qodo-benchmark/Ghost-combined-coderabbit Length of output: 1182 🏁 Script executed: # Find unit tests related to welcome email or this repository
find . -type f -name "*.test.js" -o -name "*.spec.js" | xargs grep -l "does not create outbox entry for disallowed sources" 2>/dev/nullRepository: qodo-benchmark/Ghost-combined-coderabbit Length of output: 180 🏁 Script executed: # Search for WELCOME_EMAIL_SOURCES definition
rg "WELCOME_EMAIL_SOURCES" --type js -B 2 -A 2Repository: qodo-benchmark/Ghost-combined-coderabbit Length of output: 1329 🏁 Script executed: grep -n "does not create outbox entry for disallowed sources" ghost/core/test/unit/server/services/members/members-api/repositories/MemberRepository.test.jsRepository: qodo-benchmark/Ghost-combined-coderabbit Length of output: 173 🏁 Script executed: # Get context around that test
sed -n '1,3000p' ghost/core/test/unit/server/services/members/members-api/repositories/MemberRepository.test.js | grep -B 20 -A 40 "does not create outbox entry for disallowed sources"Repository: qodo-benchmark/Ghost-combined-coderabbit Length of output: 2492 🏁 Script executed: # Look for tests that verify outbox entry IS created (positive case)
sed -n '540,575p' ghost/core/test/unit/server/services/members/members-api/repositories/MemberRepository.test.jsRepository: qodo-benchmark/Ghost-combined-coderabbit Length of output: 1572 🏁 Script executed: # Check how _resolveContextSource works to understand source resolution
rg "_resolveContextSource" ghost/core/core/server/services/members/members-api/repositories/MemberRepository.js -B 2 -A 8Repository: qodo-benchmark/Ghost-combined-coderabbit Length of output: 3812 🏁 Script executed: # Check if there's any other context or comments explaining this feature
sed -n '320,380p' ghost/core/core/server/services/members/members-api/repositories/MemberRepository.jsRepository: qodo-benchmark/Ghost-combined-coderabbit Length of output: 2451 🏁 Script executed: # Check if there are other tests that create outbox when config IS set
grep -B 5 -A 15 "creates outbox entry\|creates an outbox" ghost/core/test/unit/server/services/members/members-api/repositories/MemberRepository.test.js | head -40Repository: qodo-benchmark/Ghost-combined-coderabbit Length of output: 862 Fix logic operator: The condition Change the operator to 🐛 Fix const welcomeEmailConfig = config.get('memberWelcomeEmailTestInbox');
- if (welcomeEmailConfig || WELCOME_EMAIL_SOURCES.includes(source)) {
+ if (welcomeEmailConfig && WELCOME_EMAIL_SOURCES.includes(source)) {📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| const runMemberCreation = async (transacting) => { | ||||||||||
| const newMember = await this._Member.add({ | ||||||||||
| ...memberData, | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
letinstead ofvarfor block-scoped variable.ESLint flags this as a violation of the
no-varrule.Suggested fix
📝 Committable suggestion
🧰 Tools
🪛 ESLint
[error] 340-340: Unexpected var, use let or const instead.
(no-var)
🤖 Prompt for AI Agents