Skip to content
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

Moved @tryghost/adapter-cache-memory-ttl to adapter folder #22295

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

daniellockyer
Copy link
Member

fix https://linear.app/ghost/issue/ENG-2058/adapter-cache-memory-ttl

  • this commit moves the lib code and tests to the core folder so we can
    colocate code in one place rather than splitting it out across
    packages, which increases the cognitive load and overhead

fix https://linear.app/ghost/issue/ENG-2058/adapter-cache-memory-ttl

- this commit moves the lib code and tests to the core folder so we can
  colocate code in one place rather than splitting it out across
  packages, which increases the cognitive load and overhead
fix https://linear.app/ghost/issue/ENG-2059/external-media-inliner

- this commit moves the lib code and tests to the core folder so we can
  colocate code in one place rather than splitting it out across
  packages, which increases the cognitive load and overhead
Copy link
Contributor

coderabbitai bot commented Feb 27, 2025

Walkthrough

This pull request makes several modifications to the Ghost project’s configuration and module handling. The changes remove volume declarations in the Docker compose file related to mounting node module directories for caching and media inlining. Several files associated with the @tryghost/adapter-cache-memory-ttl and @tryghost/external-media-inliner packages, including ESLint configuration files, README files, primary entry points, and package metadata, are deleted. In parallel, import statements in core server code and corresponding test files have been updated to reference local implementations instead of external packages. Additionally, the project’s primary package configuration has been updated to include new dependencies such as @isaacs/ttlcache, file-type, and mime-types, while removing the external media inliner dependency. These changes adjust how caching and media inlining functionalities are structured and referenced across the codebase.


📜 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 c2c986f and 890277f.

⛔ Files ignored due to path filters (3)
  • ghost/core/test/unit/server/services/media-inliner/test/fixtures/fixture.exe is excluded by !**/*.exe
  • ghost/core/test/unit/server/services/media-inliner/test/fixtures/ghost-logo.png is excluded by !**/*.png
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (16)
  • compose.yml (0 hunks)
  • ghost/adapter-cache-memory-ttl/.eslintrc.js (0 hunks)
  • ghost/adapter-cache-memory-ttl/README.md (0 hunks)
  • ghost/adapter-cache-memory-ttl/index.js (0 hunks)
  • ghost/adapter-cache-memory-ttl/package.json (0 hunks)
  • ghost/adapter-cache-memory-ttl/test/.eslintrc.js (0 hunks)
  • ghost/core/core/server/adapters/cache/memory-ttl.js (1 hunks)
  • ghost/core/core/server/services/media-inliner/service.js (1 hunks)
  • ghost/core/package.json (3 hunks)
  • ghost/core/test/unit/server/adapters/cache/adapter-cache-memory-ttl.test.js (1 hunks)
  • ghost/core/test/unit/server/services/media-inliner/test/ExternalMediaInliner.test.js (1 hunks)
  • ghost/external-media-inliner/.eslintrc.js (0 hunks)
  • ghost/external-media-inliner/README.md (0 hunks)
  • ghost/external-media-inliner/index.js (0 hunks)
  • ghost/external-media-inliner/package.json (0 hunks)
  • ghost/external-media-inliner/test/.eslintrc.js (0 hunks)
💤 Files with no reviewable changes (11)
  • ghost/external-media-inliner/README.md
  • ghost/adapter-cache-memory-ttl/.eslintrc.js
  • ghost/adapter-cache-memory-ttl/index.js
  • ghost/external-media-inliner/package.json
  • ghost/adapter-cache-memory-ttl/test/.eslintrc.js
  • ghost/adapter-cache-memory-ttl/README.md
  • ghost/external-media-inliner/index.js
  • ghost/external-media-inliner/test/.eslintrc.js
  • ghost/adapter-cache-memory-ttl/package.json
  • compose.yml
  • ghost/external-media-inliner/.eslintrc.js
✅ Files skipped from review due to trivial changes (4)
  • ghost/core/core/server/adapters/cache/memory-ttl.js
  • ghost/core/test/unit/server/adapters/cache/adapter-cache-memory-ttl.test.js
  • ghost/core/test/unit/server/services/media-inliner/test/ExternalMediaInliner.test.js
  • ghost/core/core/server/services/media-inliner/service.js
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Setup
🔇 Additional comments (3)
ghost/core/package.json (3)

61-61: Integrate new TTLCache dependency.
The addition of "@isaacs/ttlcache": "1.4.1" supports the updated caching strategy by replacing the old memory TTL adapter. Please verify that all references to the previous caching adapter have been updated accordingly.


189-189: Review addition of the file-type dependency.
The new "file-type": "16.5.4" dependency is useful for robust file type detection. Confirm that its usage is consistent across the codebase—especially in areas handling media processing—and ensure the integration is well-covered by tests.


218-218: Confirm proper integration of MIME types handling.
The inclusion of "mime-types": "2.1.35" appears to complement the media handling adjustments. Please verify that any functionality previously dependent on external media inliner behavior now correctly leverages this dependency without conflicts.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.

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

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