Skip to content

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

Open
tomerqodo wants to merge 2 commits intoqodo_full_base_renamed_files_to_kebab-case_-_core_-_services__-_part_2_pr7from
qodo_full_head_renamed_files_to_kebab-case_-_core_-_services__-_part_2_pr7
Open

Renamed files to kebab-case - core - services - part 2#9
tomerqodo wants to merge 2 commits intoqodo_full_base_renamed_files_to_kebab-case_-_core_-_services__-_part_2_pr7from
qodo_full_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
• Several newly added require(...) statements in members-api.js omit semicolons, relying on ASI.
• This violates the repo style requirement that statements end with semicolons and introduces
  inconsistency in the same file where later require lines do use semicolons.
• Inconsistent semicolon usage can lead to subtle parsing issues and reduces codebase
  readability/consistency.
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 21 requires semicolons for statements. The added top-of-file require statements
(lines 1-10) are missing semicolons, while subsequent lines (e.g., 12-19) still include them,
showing the inconsistency introduced by this change.

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
Several newly added `require(...)` statements in `members-api.js` are missing trailing semicolons, violating the repo JS style rules.

## Issue Context
This file mixes semicolon-less and semicolon-terminated statements, which is inconsistent and against the compliance checklist requirement.

## 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. Email analytics require mismatch 🐞 Bug ✓ Correctness
Description
EmailAnalyticsServiceWrapper now requires ../email-service/email-event-storage and
  ../email-service/email-event-processor, but the repo contains EmailEventStorage.js and
  EmailEventProcessor.js (PascalCase).
• On case-sensitive filesystems, Node will not resolve these mismatched paths, causing Email
  Analytics init to fail with MODULE_NOT_FOUND.
• Impact: email analytics worker/service initialization can crash at startup, preventing analytics
  ingestion/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
The updated wrapper requires kebab-case modules, while the email-service directory contains the
PascalCase implementations, indicating the new paths do not map to existing modules.

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-8]

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 email-service implementations in this repo are `EmailEventStorage.js` and `EmailEventProcessor.js`. On case-sensitive filesystems this will throw `MODULE_NOT_FOUND` when initializing Email Analytics.

## Issue Context
This PR appears to standardize filenames/imports to kebab-case, but the email-service event modules were not renamed (or shims were not added) to match the new require paths.

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

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


3. MagicLink require mismatch 🐞 Bug ✓ Correctness
Description
• Members API now requires ../../lib/magic-link/magic-link, but the implementation present is
  services/lib/magic-link/MagicLink.js.
• Other parts of the codebase still import MagicLink via the PascalCase path, reinforcing that the
  kebab-case module path is not valid.
• Impact: loading Members API can fail at require-time, breaking magic-link-based member flows.
Code

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

+const MagicLink = require('../../lib/magic-link/magic-link');
Evidence
Members API requires a kebab-case file that does not correspond to the existing MagicLink
implementation filename, while other code continues to require the PascalCase module path.

ghost/core/core/server/services/members/members-api/members-api.js[18-20]
ghost/core/core/server/services/lib/magic-link/MagicLink.js[30-36]
ghost/core/core/server/services/settings/settings-bread-service.js[6-8]

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 repo contains `services/lib/magic-link/MagicLink.js` and other code still imports `../lib/magic-link/MagicLink`. On case-sensitive filesystems this will throw `MODULE_NOT_FOUND` when Members API is loaded.

## Issue Context
This PR is performing kebab-case normalization, but MagicLink’s file path was updated without adding/renaming the underlying file.

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

ⓘ 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

• Several newly added require(...) statements in members-api.js omit semicolons, relying on ASI.
• This violates the repo style requirement that statements end with semicolons and introduces
  inconsistency in the same file where later require lines do use semicolons.
• Inconsistent semicolon usage can lead to subtle parsing issues and reduces codebase
  readability/consistency.
Agent prompt
## Issue description
Several newly added `require(...)` statements in `members-api.js` are missing trailing semicolons, violating the repo JS style rules.

## Issue Context
This file mixes semicolon-less and semicolon-terminated statements, which is inconsistent and against the compliance checklist requirement.

## 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

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

2. Email analytics require mismatch 🐞 Bug ✓ Correctness

EmailAnalyticsServiceWrapper now requires ../email-service/email-event-storage and
  ../email-service/email-event-processor, but the repo contains EmailEventStorage.js and
  EmailEventProcessor.js (PascalCase).
• On case-sensitive filesystems, Node will not resolve these mismatched paths, causing Email
  Analytics init to fail with MODULE_NOT_FOUND.
• Impact: email analytics worker/service initialization can crash at startup, preventing analytics
  ingestion/processing.
Agent prompt
## Issue description
`EmailAnalyticsServiceWrapper` requires `../email-service/email-event-storage` and `../email-service/email-event-processor`, but the email-service implementations in this repo are `EmailEventStorage.js` and `EmailEventProcessor.js`. On case-sensitive filesystems this will throw `MODULE_NOT_FOUND` when initializing Email Analytics.

## Issue Context
This PR appears to standardize filenames/imports to kebab-case, but the email-service event modules were not renamed (or shims were not added) to match the new require paths.

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

ⓘ 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

3. Magiclink require mismatch 🐞 Bug ✓ Correctness

• Members API now requires ../../lib/magic-link/magic-link, but the implementation present is
  services/lib/magic-link/MagicLink.js.
• Other parts of the codebase still import MagicLink via the PascalCase path, reinforcing that the
  kebab-case module path is not valid.
• Impact: loading Members API can fail at require-time, breaking magic-link-based member flows.
Agent prompt
## Issue description
`MembersAPI` requires `../../lib/magic-link/magic-link`, but the repo contains `services/lib/magic-link/MagicLink.js` and other code still imports `../lib/magic-link/MagicLink`. On case-sensitive filesystems this will throw `MODULE_NOT_FOUND` when Members API is loaded.

## Issue Context
This PR is performing kebab-case normalization, but MagicLink’s file path was updated without adding/renaming the underlying file.

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

ⓘ 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