Skip to content

dalli 4.x および 5.x のサポート#19

Draft
matsubara0507 wants to merge 5 commits into
masterfrom
support-dalli-4-5
Draft

dalli 4.x および 5.x のサポート#19
matsubara0507 wants to merge 5 commits into
masterfrom
support-dalli-4-5

Conversation

@matsubara0507
Copy link
Copy Markdown
Contributor

@matsubara0507 matsubara0507 commented May 8, 2026

概要

このPRは、dalli 3.x との後方互換性を維持しながら、dalli 4.x および 5.x のサポートを追加します。

変更内容

依存関係の更新

  • dalli の依存を ~> 3.0 から >= 3.0, < 6.0 に変更
  • Ruby 要件を >= 2.5 から >= 3.1 に変更
  • .ruby-version を 3.2.3 から 3.3.8 に更新

テストマトリクスの改善

  • EOL の Ruby バージョンを削除 (2.5, 2.6, 2.7, 3.0)
  • モダンな Ruby バージョンを追加 (3.3, 3.4)
  • EOL の ActiveSupport バージョンを削除 (5.2, 6.0, 6.1)
  • 現在サポート中の ActiveSupport バージョンを追加 (7.0, 7.1, 7.2)
  • dalli バージョン別のテストを追加 (3.x, 4.x, 5.x)

テストカバレッジ

  • テスト組み合わせ総数: 26 (Ruby 3.1-3.4 × 7 gemfiles - 2 除外)
  • 除外: dalli 5.x は Ruby 3.3+ が必要
  • ActiveSupport 7.x では MemCacheStore のテストをスキップ(初期化 API の変更により非互換)

テストの修正

  • dalli 4.x+ の raw mode で文字列値が必須となったため、テストフィクスチャを修正
  • ActiveSupport 6.1 は Ruby 3.1+ で動作しないため削除(Logger の標準ライブラリからの削除が原因)

背景

dalli 4.x には、以前はカスタムモンキーパッチでのみ利用可能だった set_multi の upstream 実装が含まれています。これにより、ユーザーは破壊的変更なしに dalli 4.x にアップグレードできます。

dalli 5.x は Ruby 3.3+ および memcached 1.6+ が必要で、binary protocol と SASL 認証のサポートが削除されています。

関連 Issue

https://github.com/monsterstrike/server/issues/35244 対応のために必要です。

🤖 Generated with Claude Code

matsubara0507 and others added 5 commits May 8, 2026 13:44
## Changes

### Dependency updates
- Update dalli dependency from `~> 3.0` to `>= 3.0, < 6.0`
- Update Ruby requirement from `>= 2.5` to `>= 3.1`
- Update `.ruby-version` from 3.2.3 to 3.3.8

### Test matrix improvements
- Remove EOL Ruby versions (2.5, 2.6, 2.7, 3.0)
- Add modern Ruby versions (3.3, 3.4)
- Remove EOL ActiveSupport versions (5.2, 6.0)
- Add current ActiveSupport versions (7.1, 7.2)
- Add dalli version-specific tests (3.x, 4.x, 5.x)

### Test coverage
- Total test combinations: 30 (4 Ruby × 8 gemfile - 2 excludes)
- Excludes: dalli 5.x requires Ruby 3.3+

This update ensures compatibility with dalli 4.x and 5.x while maintaining
backward compatibility with dalli 3.x, allowing users to upgrade dalli
without breaking changes.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Update TargetRubyVersion from 2.5 to 3.1 in .rubocop.yml
- Fix gem order in dalli_*.gemfile (activesupport should come before dalli)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Dalli 4.x enforces that raw mode values must be strings. Integer
values cause MarshalError: "Dalli raw mode requires string values,
got: Integer"

Changed all raw mode test fixtures from integers to strings to
maintain compatibility with dalli 3.x, 4.x, and 5.x.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
ActiveSupport 7.x changed the MemCacheStore initialization API,
causing compatibility issues. Skip these tests when AS >= 7 to focus
on Dalli::Client compatibility testing.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
ActiveSupport 6.1 is EOL and incompatible with Ruby 3.1+ due to
Logger being removed from the standard library. Removed from both
Appraisals and GitHub Actions workflow.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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