Skip to content

Renamed files to kebab-case - core - services - part 2#22

Open
tomerqodo wants to merge 2 commits intoqodo_action_req_base_renamed_files_to_kebab-case_-_core_-_services__-_part_2_pr7from
qodo_action_req_head_renamed_files_to_kebab-case_-_core_-_services__-_part_2_pr7
Open

Renamed files to kebab-case - core - services - part 2#22
tomerqodo wants to merge 2 commits intoqodo_action_req_base_renamed_files_to_kebab-case_-_core_-_services__-_part_2_pr7from
qodo_action_req_head_renamed_files_to_kebab-case_-_core_-_services__-_part_2_pr7

Conversation

@tomerqodo
Copy link
Copy Markdown

Benchmark PR from agentic-review-benchmarks#7

@qodo-code-review
Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (1) 📎 Requirement gaps (0)

Grey Divider


Action required

1. Missing semicolons in members-api.js 📘 Rule violation ✓ Correctness
Description
members-api.js includes multiple new const ... = require(...) statements without terminating
  semicolons, relying on ASI.
• This violates the requirement that all JavaScript statements end with explicit semicolons, and
  introduces inconsistency since later require lines in the same file do use semicolons.
• This can lead to subtle parsing issues in certain edge cases and reduces formatting consistency
  across the codebase.
Code

ghost/core/core/server/services/members/members-api/members-api.js[R1-10]

+const {Router} = require('express')
+const body = require('body-parser')
+const errors = require('@tryghost/errors')
+const logging = require('@tryghost/logging')
+
+const PaymentsService = require('./services/payments-service')
+const TokenService = require('./services/token-service')
+const GeolocationService = require('./services/geolocation-service')
+const MemberBREADService = require('./services/member-bread-service')
+const MemberRepository = require('./repositories/member-repository')
Evidence
PR Compliance ID 23 requires explicit semicolons at the end of JavaScript statements. In
members-api.js, the newly added top-level require assignments on lines 1-10 do not end with
semicolons.

AGENTS.md
ghost/core/core/server/services/members/members-api/members-api.js[1-10]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The file `members-api.js` has multiple `const ... = require(...)` statements without trailing semicolons, relying on automatic semicolon insertion (ASI), which violates the semicolon requirement and is inconsistent with other imports in the same file.

## Issue Context
Compliance requires explicit semicolons for all JS/TS statements.

## Fix Focus Areas
- ghost/core/core/server/services/members/members-api/members-api.js[1-10]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. MagicLink require mismatch 🐞 Bug ✓ Correctness
Description
• Members API now requires a lowercase path for MagicLink, but the implementation file in that
  directory is still named MagicLink.js (PascalCase).
• On case-sensitive filesystems, this will throw MODULE_NOT_FOUND when Members API is initialized.
• This is inconsistent with other call sites (e.g. newsletters) which still require
  ../lib/magic-link/MagicLink, indicating the file was not actually renamed in this PR branch.
Code

ghost/core/core/server/services/members/members-api/members-api.js[19]

+const MagicLink = require('../../lib/magic-link/magic-link');
Evidence
The Members API was changed to require ../../lib/magic-link/magic-link, but the repo still
contains MagicLink.js as the concrete implementation, and other runtime code continues to require
../lib/magic-link/MagicLink. This casing mismatch will break Node resolution on Linux.

ghost/core/core/server/services/members/members-api/members-api.js[12-20]
ghost/core/core/server/services/lib/magic-link/MagicLink.js[1-4]
ghost/core/core/server/services/newsletters/newsletters-service.js[8-10]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`MembersAPI` requires `../../lib/magic-link/magic-link`, but the implementation file is `MagicLink.js`. On case-sensitive systems this will cause `MODULE_NOT_FOUND`.

### Issue Context
Other code (e.g. newsletters) still requires `../lib/magic-link/MagicLink`, strongly suggesting the file was not renamed in this branch.

### Fix Focus Areas
- ghost/core/core/server/services/members/members-api/members-api.js[18-20]
- ghost/core/core/server/services/newsletters/newsletters-service.js[8-10]
- ghost/core/core/server/services/lib/magic-link/MagicLink.js[1-4]

### Suggested fix
Option A (minimal): change the Members API import to `require('../../lib/magic-link/MagicLink')`.

Option B (complete rename): rename `MagicLink.js` to `magic-link.js` (or add a `magic-link.js` re-export) and update *all* `MagicLink` requires accordingly.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Email analytics requires broken 🐞 Bug ✓ Correctness
Description
EmailAnalyticsServiceWrapper now requires ../email-service/email-event-storage and
  ../email-service/email-event-processor.
• The email-service implementations in this branch are still EmailEventStorage.js and
  EmailEventProcessor.js (PascalCase).
• This will crash email analytics initialization on case-sensitive filesystems, disabling analytics
  jobs/event processing.
Code

ghost/core/core/server/services/email-analytics/email-analytics-service-wrapper.js[R12-13]

+        const EmailEventStorage = require('../email-service/email-event-storage');
+        const EmailEventProcessor = require('../email-service/email-event-processor');
Evidence
Email analytics wrapper was updated to require kebab-case filenames, but the actual email-service
module filenames are still PascalCase in this branch. Node module resolution is case-sensitive on
Linux, so these requires will fail at runtime.

ghost/core/core/server/services/email-analytics/email-analytics-service-wrapper.js[8-16]
ghost/core/core/server/services/email-service/EmailEventStorage.js[1-6]
ghost/core/core/server/services/email-service/EmailEventProcessor.js[1-9]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`EmailAnalyticsServiceWrapper` requires `../email-service/email-event-storage` and `../email-service/email-event-processor`, but the existing email-service files are `EmailEventStorage.js` and `EmailEventProcessor.js`. This will cause runtime failures on case-sensitive systems.

### Issue Context
This PR is standardizing filenames/paths. Either the email-service files need to be renamed too, or the wrapper should keep requiring the existing PascalCase files.

### Fix Focus Areas
- ghost/core/core/server/services/email-analytics/email-analytics-service-wrapper.js[11-14]
- ghost/core/core/server/services/email-service/EmailEventStorage.js[1-6]
- ghost/core/core/server/services/email-service/EmailEventProcessor.js[1-9]

### Suggested fix
Option A (minimal): change the requires back to:
- `require('../email-service/EmailEventStorage')`
- `require('../email-service/EmailEventProcessor')`

Option B (complete rename): rename the email-service files to `email-event-storage.js` / `email-event-processor.js` and update any other references consistently.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



ⓘ The new review experience is currently in Beta. Learn more

Qodo Logo

Comment on lines +1 to +10
const {Router} = require('express')
const body = require('body-parser')
const errors = require('@tryghost/errors')
const logging = require('@tryghost/logging')

const PaymentsService = require('./services/payments-service')
const TokenService = require('./services/token-service')
const GeolocationService = require('./services/geolocation-service')
const MemberBREADService = require('./services/member-bread-service')
const MemberRepository = require('./repositories/member-repository')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Missing semicolons in members-api.js 📘 Rule violation ✓ Correctness

members-api.js includes multiple new const ... = require(...) statements without terminating
  semicolons, relying on ASI.
• This violates the requirement that all JavaScript statements end with explicit semicolons, and
  introduces inconsistency since later require lines in the same file do use semicolons.
• This can lead to subtle parsing issues in certain edge cases and reduces formatting consistency
  across the codebase.
Agent prompt
## Issue description
The file `members-api.js` has multiple `const ... = require(...)` statements without trailing semicolons, relying on automatic semicolon insertion (ASI), which violates the semicolon requirement and is inconsistent with other imports in the same file.

## Issue Context
Compliance requires explicit semicolons for all JS/TS statements.

## Fix Focus Areas
- ghost/core/core/server/services/members/members-api/members-api.js[1-10]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

const WellKnownController = require('./controllers/well-known-controller');

const {EmailSuppressedEvent} = require('../../email-suppression-list/email-suppression-list');
const MagicLink = require('../../lib/magic-link/magic-link');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

2. Magiclink require mismatch 🐞 Bug ✓ Correctness

• Members API now requires a lowercase path for MagicLink, but the implementation file in that
  directory is still named MagicLink.js (PascalCase).
• On case-sensitive filesystems, this will throw MODULE_NOT_FOUND when Members API is initialized.
• This is inconsistent with other call sites (e.g. newsletters) which still require
  ../lib/magic-link/MagicLink, indicating the file was not actually renamed in this PR branch.
Agent prompt
### Issue description
`MembersAPI` requires `../../lib/magic-link/magic-link`, but the implementation file is `MagicLink.js`. On case-sensitive systems this will cause `MODULE_NOT_FOUND`.

### Issue Context
Other code (e.g. newsletters) still requires `../lib/magic-link/MagicLink`, strongly suggesting the file was not renamed in this branch.

### Fix Focus Areas
- ghost/core/core/server/services/members/members-api/members-api.js[18-20]
- ghost/core/core/server/services/newsletters/newsletters-service.js[8-10]
- ghost/core/core/server/services/lib/magic-link/MagicLink.js[1-4]

### Suggested fix
Option A (minimal): change the Members API import to `require('../../lib/magic-link/MagicLink')`.

Option B (complete rename): rename `MagicLink.js` to `magic-link.js` (or add a `magic-link.js` re-export) and update *all* `MagicLink` requires accordingly.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +12 to +13
const EmailEventStorage = require('../email-service/email-event-storage');
const EmailEventProcessor = require('../email-service/email-event-processor');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

3. Email analytics requires broken 🐞 Bug ✓ Correctness

EmailAnalyticsServiceWrapper now requires ../email-service/email-event-storage and
  ../email-service/email-event-processor.
• The email-service implementations in this branch are still EmailEventStorage.js and
  EmailEventProcessor.js (PascalCase).
• This will crash email analytics initialization on case-sensitive filesystems, disabling analytics
  jobs/event processing.
Agent prompt
### Issue description
`EmailAnalyticsServiceWrapper` requires `../email-service/email-event-storage` and `../email-service/email-event-processor`, but the existing email-service files are `EmailEventStorage.js` and `EmailEventProcessor.js`. This will cause runtime failures on case-sensitive systems.

### Issue Context
This PR is standardizing filenames/paths. Either the email-service files need to be renamed too, or the wrapper should keep requiring the existing PascalCase files.

### Fix Focus Areas
- ghost/core/core/server/services/email-analytics/email-analytics-service-wrapper.js[11-14]
- ghost/core/core/server/services/email-service/EmailEventStorage.js[1-6]
- ghost/core/core/server/services/email-service/EmailEventProcessor.js[1-9]

### Suggested fix
Option A (minimal): change the requires back to:
- `require('../email-service/EmailEventStorage')`
- `require('../email-service/EmailEventProcessor')`

Option B (complete rename): rename the email-service files to `email-event-storage.js` / `email-event-processor.js` and update any other references consistently.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

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