Skip to content

Renamed TopContentStatsService to ContentStatsService #23148

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

Merged
merged 3 commits into from
May 5, 2025

Conversation

cmraible
Copy link
Collaborator

@cmraible cmraible commented May 1, 2025

no refs

Renaming this service and its test files to align with the pattern in the other stats services. There are likely to be other content endpoints that aren't necessarily top-*, which can be added to this service and given their own endpoints.

Copy link
Contributor

coderabbitai bot commented May 1, 2025

"""

Walkthrough

The changes involve renaming the TopContentStatsService class to ContentStatsService within the core server services and updating all corresponding references accordingly. This includes modifying the class declaration and export in the service file, updating constructor parameters and method calls in StatsService.js to use the new service name and property names, and adjusting the static create method to instantiate ContentStatsService instead of TopContentStatsService. The unit tests were also updated to reflect the renamed service in imports, instantiations, and descriptions without altering test logic or coverage. No functional or behavioral changes were made to the service methods, logic, or error handling. The modifications are strictly related to renaming, property updates, and reference consistency across the codebase.

Possibly related PRs


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9af2131 and 8f71a31.

📒 Files selected for processing (3)
  • ghost/core/core/server/services/stats/ContentStatsService.js (12 hunks)
  • ghost/core/core/server/services/stats/StatsService.js (6 hunks)
  • ghost/core/test/unit/server/services/stats/content.test.js.js (20 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
  • ghost/core/test/unit/server/services/stats/content.test.js.js
  • ghost/core/core/server/services/stats/ContentStatsService.js
  • ghost/core/core/server/services/stats/StatsService.js
⏰ Context from checks skipped due to timeout of 90000ms (10)
  • GitHub Check: Ghost-CLI tests
  • GitHub Check: Regression tests (Node 20.11.1, sqlite3)
  • GitHub Check: Regression tests (Node 20.11.1, mysql8)
  • GitHub Check: Unit tests (Node 22.13.1)
  • GitHub Check: Unit tests (Node 20.11.1)
  • GitHub Check: Database tests (Node 20.11.1, sqlite3)
  • GitHub Check: Database tests (Node 22.13.1, mysql8)
  • GitHub Check: i18n
  • GitHub Check: Database tests (Node 20.11.1, mysql8)
  • GitHub Check: Lint
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@cmraible cmraible force-pushed the rename-top-content-service branch from ae74817 to 23b5588 Compare May 1, 2025 22:19
@cmraible cmraible marked this pull request as ready for review May 1, 2025 22:30
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 80aa346 and 23b5588.

📒 Files selected for processing (3)
  • ghost/core/core/server/services/stats/ContentStatsService.js (12 hunks)
  • ghost/core/core/server/services/stats/StatsService.js (6 hunks)
  • ghost/core/test/unit/server/services/stats/content.test.js.js (20 hunks)
🔇 Additional comments (11)
ghost/core/test/unit/server/services/stats/content.test.js.js (4)

3-3: Import path correctly updated.

The import statement has been updated to reflect the renamed service.


38-42: Service instantiation correctly updated.

The service instantiation has been properly updated to use the renamed class.


162-165: Service without urlService instantiation correctly updated.

The service instantiation without the urlService has been properly updated to use the renamed class.


422-425: Service without Tinybird client instantiation correctly updated.

The service instantiation without the Tinybird client has been properly updated to use the renamed class.

ghost/core/core/server/services/stats/ContentStatsService.js (2)

12-12: Class name correctly renamed.

The class has been properly renamed from TopContentStatsService to ContentStatsService to align with the service's broader functionality and naming patterns in the codebase.


196-196: Module export correctly updated.

The module export has been properly updated to export the renamed class.

ghost/core/core/server/services/stats/StatsService.js (5)

6-6: Import statement correctly updated.

The import statement has been properly updated to use the renamed service.


17-17: JSDoc annotation correctly updated.

The JSDoc annotation has been properly updated to reflect the renamed service.


70-70: Method call correctly updated.

The method call has been properly updated to use the renamed property.


80-80: Method call correctly updated.

The method call has been properly updated to use the renamed property.


114-115: Service instantiation correctly updated.

The service instantiation in the static create method has been properly updated to use the renamed class.

@cmraible cmraible force-pushed the rename-top-content-service branch from fd700f7 to 9af2131 Compare May 2, 2025 23:58
@cmraible cmraible force-pushed the rename-top-content-service branch from 9af2131 to 8f71a31 Compare May 5, 2025 18:28
@cmraible cmraible changed the title Renamed TopContentStatsService to ContentStatsService Renamed TopContentStatsService to ContentStatsService May 5, 2025
@cmraible cmraible merged commit 3ac5c5f into main May 5, 2025
26 checks passed
@cmraible cmraible deleted the rename-top-content-service branch May 5, 2025 18:43
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.

1 participant