Skip to content

docs: the legacy API is removed in 2.1, not 3.0 - #241

Closed
pftg wants to merge 1 commit into
masterfrom
docs/v2-1-removal-vocabulary
Closed

docs: the legacy API is removed in 2.1, not 3.0#241
pftg wants to merge 1 commit into
masterfrom
docs/v2-1-removal-vocabulary

Conversation

@pftg

@pftg pftg commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

The repo currently tells users the v1 API is "REMOVED in 3.0" — in the runtime
migration notice that ships inside 2.0, in docs/UPGRADING.md, and in ~50 code
comments. Per ADR-008's final amendment there is no 3.0:

  • 2.0.0 final ships with the full legacy compatibility layer — shims,
    per-constant deprecation warnings, one-per-process migration notice.
  • 2.1 deletes the legacy namespace trees, legacy_shims.rb, deprecation.rb,
    test/legacy/, and the chunky_png driver + shift_distance_limit.

If the current text ships in 2.0 we publish a promise we intend to break, and #240
cannot fix it because it removes the file that carries the text.

The user-facing string

before

... It still works in 2.x and is REMOVED in 3.0 -- see docs/UPGRADING.md ...

after

... It still works in 2.0 and is REMOVED in 2.1 -- see docs/UPGRADING.md ...

A test does pin it: test/legacy/snap_diff_deprecation_test.rb:189. It was
asserting only "REMOVED in 3.0"; it now matches the whole clause
"still works in 2.0 and is REMOVED in 2.1", so a wrong window fails it too and
not just a wrong removal version. Mutation-checked: setting the notice to
REMOVED in 9.9 makes it fail with the expected diff.

The per-constant warning text carries no version at all
(`X` is deprecated (constant); use `Y` instead.) and is left alone — the
migration notice always precedes the first constant warning in a process, so the
version is stated exactly once rather than on every line.

Per-file breakdown

File Changes What
lib/snap_diff/deprecation.rb 3 migration notice text + its comment
test/legacy/snap_diff_deprecation_test.rb 4 the pin, strengthened
docs/UPGRADING.md 4 + new para notice sample, the NameError sentence, CONFIG_MAPPING; new plain statement of the contract at the top of "Deprecation Warnings"
docs/architecture.md 2 legacy_shims.rb reframed as the removal layer, not a permanent fixture, naming the three gates; dropped a stale "3.0-readiness pass"
docs/drivers.md +6 chunky_png deprecated in 2.0 / removed in 2.1, with the migration off it
docs/configuration.md +5 shift_distance_limit deprecation callout
CHANGELOG.md +16 new [Unreleased] corrective note (see below)
Rakefile 3 "THE 3.0 SPLIT/GATE" → legacy-removal / 2.1
test/unit/deletion_3_0_test.rbtest/unit/legacy_deletion_test.rb rename + 10 Deletion30TestLegacyDeletionTest
test/unit/core_tree_has_no_legacy_deps_test.rb 6 DELETED_IN_3_0DELETED_WITH_LEGACY_TREES
test/unit/canonical_suite_has_no_legacy_refs_test.rb 1 allowlist key follows the rename
9 × test/legacy/*.rb 23 3.02.1
lib/snap_diff{.rb,/config.rb,/drivers.rb,/dsl.rb,/legacy_shims.rb}, lib/capybara/.../config_legacy.rb 8 comments
test/unit/{support_load_probe,snap_diff,snap_diff_config,config_default_timing,drivers,errors,image_compare}_test.rb, test/support/{dsl_stub,driver_coverage}.rb 13 comments

Left alone deliberately

  • test/unit/backtrace_filter_test.rb:35"/gems/rack-3.0.0/lib/rack.rb", a Rack version in a fixture backtrace.
  • test/unit/drivers/vips_driver_test.rb:52"[11.0,3.0,49.0,21.0]", region coordinates.
  • docs/UPGRADING.md:313-344, CHANGELOG.md:226v1.13.0, matched only because 3.0 is a substring.
  • CHANGELOG.md:103 ("removing them in 3.0 is a deletion") and :96 ("v3's scroll-preservation work") — published v2.0.0.beta3 history, not rewritten. The [Unreleased] note covers them.

The prior scan's counts did not hold up: docs/configuration.md, docs/framework-setup.md and README.md contain zero 3.0 matches (claimed 31/19/13), and docs/UPGRADING.md had 7, not 62 — 4 of which are v1.13.0.

CHANGELOG judgment call

The CHANGELOG does promise 3.0, at line 103 in the published v2.0.0.beta3
section ("…so removing them in 3.0 is a deletion, not a refactor"). beta3 is
tagged, so I did not rewrite it. There was no [Unreleased] section, so I added
one carrying two corrective bullets: the legacy API moves to 2.1 (with "read every
earlier mention of 3.0 as 2.1"), and chunky_png + shift_distance_limit go at 2.1
too. No version.rb bump.

Overlap with #240 (draft)

#240 also renames some of this. Where a version number added nothing I used durable
phrasing so the branches conflict as little as possible:

  • deletion_3_0_test.rblegacy_deletion_test.rb / Deletion30TestLegacyDeletionTest
  • DELETED_IN_3_0DELETED_WITH_LEGACY_TREES
  • comments: "3.0 readiness" → "legacy-removal readiness"; "deleted with the v1 trees in 3.0" → "deleted with the v1 trees"; "what 3.0 keeps" → "what survives the removal of the legacy trees"

2.1 is used only where the sentence is the removal contract (the notice, the
docs, legacy_shims.rb's and config_legacy.rb's file headers, the Rakefile gate).

Everything under test/legacy/ uses 2.1 — those files are deleted by #240 anyway.

Verification

  • rake test:unit572 runs, 0 failures (baseline 572/0)
  • rake test600 runs, 0 failures, 1 skip (baseline 600/0/1)
  • rake test:canonical469 runs, 0 failures, 1 skip
  • standardrb → 158 files, no offenses
  • Notice pin mutation-checked (REMOVED in 9.9 → red)

Do not merge — for reconciliation with #240 first.

Summary by Sourcery

Correct the project’s release and migration messaging to establish 2.0 as the legacy compatibility window and 2.1 as the removal release.

Enhancements:

  • Align documentation, runtime messaging, comments, and test terminology with the legacy API removal planned for 2.1.
  • Clarify the migration path for the ChunkyPNG driver and shift_distance_limit, including their removal in 2.1.
  • Rename and generalize legacy-deletion tests and gates to reflect the removal milestone rather than a nonexistent 3.0 release.

Build:

  • Update Rake test gate descriptions and migration comments to identify 2.1 as the legacy-removal release.

Documentation:

  • Correct the documented legacy API removal version from 3.0 to 2.1 and describe 2.0 as the compatibility and migration window.
  • Document the 2.1 removal of the ChunkyPNG driver and shift_distance_limit, including recommended VIPS-based replacements.
  • Add an unreleased changelog correction covering the legacy API, driver, and configuration option removal timelines.

Tests:

  • Strengthen the migration notice test to validate the complete 2.0-to-2.1 compatibility window.
  • Update legacy-surface tests and deletion gates to use 2.1/removal-oriented terminology.

Chores:

  • Replace stale references to a future 3.0 release while preserving historical changelog entries.

The repo told users the v1 Capybara::Screenshot* / CapybaraScreenshotDiff*
API is "REMOVED in 3.0" -- in the runtime migration notice that ships in
2.0, in UPGRADING.md, and in ~50 code comments. Per ADR-008's final
amendment there is no 3.0: 2.0.0 final ships WITH the full compatibility
layer, and 2.1 deletes the legacy trees, legacy_shims.rb, deprecation.rb,
test/legacy/, the chunky_png driver and shift_distance_limit.

Shipping the old text would publish a promise we intend to break.

- Migration notice now reads "still works in 2.0 and is REMOVED in 2.1";
  the pinning assertion in snap_diff_deprecation_test.rb matches the whole
  clause instead of just the version, and was mutation-checked.
- UPGRADING.md states the contract plainly up front: legacy names work in
  2.0 with warnings, all of it removed in 2.1.
- architecture.md reframes legacy_shims.rb as the removal layer rather than
  a permanent fixture, and names the gates that keep the removal a git rm.
- drivers.md / configuration.md now say chunky_png and shift_distance_limit
  are deprecated in 2.0 and removed in 2.1 (docs only; the runtime warnings
  are separate work).
- deletion_3_0_test.rb -> legacy_deletion_test.rb, DELETED_IN_3_0 ->
  DELETED_WITH_LEGACY_TREES. Version-free phrasing elsewhere so the
  comments stop carrying a release number that adds nothing.
- CHANGELOG gains an Unreleased corrective note; the published beta
  sections are left as history.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry @pftg, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@pftg, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 5 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 57dc1387-8c06-4623-8cd8-dc61f102f373

📥 Commits

Reviewing files that changed from the base of the PR and between 785f413 and 0752c43.

📒 Files selected for processing (34)
  • CHANGELOG.md
  • Rakefile
  • docs/UPGRADING.md
  • docs/architecture.md
  • docs/configuration.md
  • docs/drivers.md
  • lib/capybara/screenshot/diff/config_legacy.rb
  • lib/snap_diff.rb
  • lib/snap_diff/config.rb
  • lib/snap_diff/deprecation.rb
  • lib/snap_diff/drivers.rb
  • lib/snap_diff/dsl.rb
  • lib/snap_diff/legacy_shims.rb
  • test/legacy/errors_alias_test.rb
  • test/legacy/legacy_config_accessors_test.rb
  • test/legacy/legacy_config_default_timing_test.rb
  • test/legacy/legacy_entry_point_probe_test.rb
  • test/legacy/legacy_forwarders_test.rb
  • test/legacy/legacy_namespace_deprecation_test.rb
  • test/legacy/legacy_tree_is_alias_only_test.rb
  • test/legacy/namespace_forwarding_test.rb
  • test/legacy/snap_diff_deprecation_test.rb
  • test/support/driver_coverage.rb
  • test/support/dsl_stub.rb
  • test/unit/canonical_suite_has_no_legacy_refs_test.rb
  • test/unit/config_default_timing_test.rb
  • test/unit/core_tree_has_no_legacy_deps_test.rb
  • test/unit/drivers_test.rb
  • test/unit/errors_test.rb
  • test/unit/image_compare_test.rb
  • test/unit/legacy_deletion_test.rb
  • test/unit/snap_diff_config_test.rb
  • test/unit/snap_diff_test.rb
  • test/unit/support_load_probe_test.rb

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

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai

sourcery-ai Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Aligns all documentation, migration messaging, and test gates with the decision that the legacy v1 API, ChunkyPNG driver, and shift_distance_limit are removed in 2.1 (with 2.0 as the migration window), and reframes internal comments/tests from a hypothetical 3.0 deletion to a concrete 2.1 legacy-removal event.

Sequence diagram for the legacy API migration notice

sequenceDiagram
    participant App
    participant LegacyAPI
    participant Deprecation

    App->>LegacyAPI: access legacy API
    LegacyAPI->>Deprecation: warn_once
    Deprecation-->>App: migration notice: works in 2.0, removed in 2.1
    LegacyAPI-->>App: compatibility behavior
    Note over Deprecation: Notice shown once per process
Loading

Flow diagram for the legacy API removal timeline

flowchart LR
    V20["2.0.0 final"] --> W["Legacy compatibility layer works and warns\nMigration window"]
    W --> V21["2.1"]
    V21 --> R["Remove v1 namespaces, shims,\ndeprecation machinery, and legacy tests"]
Loading

File-Level Changes

Change Details Files
Update the deprecation migration notice and strengthen its test pin so the exact 2.0→2.1 window is enforced.
  • Change MIGRATION_NOTICE text from "still works in 2.x and is REMOVED in 3.0" to "still works in 2.0 and is REMOVED in 2.1".
  • Adjust nearby comments to describe silence up to a 2.1 NameError rather than a 3.0 NameError.
  • Update the migration notice test to assert the full clause "still works in 2.0 and is REMOVED in 2.1" instead of just the removal version.
lib/snap_diff/deprecation.rb
test/legacy/snap_diff_deprecation_test.rb
Clarify upgrade documentation to state the legacy contract (2.0 works and warns; removal in 2.1), and update references to legacy internals accordingly.
  • Add a plain-text contract paragraph under "Deprecation Warnings" describing 2.0 as the migration window and deletion in 2.1.
  • Update the sample migration notice string and surrounding narrative to reference 2.0/2.1 instead of 2.x/3.0.
  • Change the NameError discussion to talk about a 2.1 failure case, not 3.0.
  • Update the CONFIG_MAPPING note to say it disappears in 2.1 with the v1 surface.
docs/UPGRADING.md
Reframe architecture and driver documentation around legacy removal in 2.1 and deprecation of ChunkyPNG/shift_distance_limit in 2.0.
  • Remove "3.0-readiness" wording from the driver registry description and describe AVAILABLE_DRIVERS as the canonical home without referencing 3.0.
  • Describe legacy_shims.rb as the temporary removal layer that exists solely to make the 2.1 deletion a git rm, listing the mechanical gates and deletion behavior.
  • Document that :chunky_png is deprecated in 2.0 and removed in 2.1, and that shift_distance_limit goes away with it, pointing users to VIPS and replacement options.
  • Add a deprecation callout for shift_distance_limit in configuration docs, linking it to the ChunkyPNG driver removal and suggesting median_filter_window_size as the alternative.
docs/architecture.md
docs/drivers.md
docs/configuration.md
Introduce an [Unreleased] CHANGELOG section to correct previously published references to a 3.0 legacy deletion and driver/config removals.
  • Add an [Unreleased] section describing that the legacy API is actually removed in 2.1, not 3.0, and instruct readers to reinterpret earlier "3.0" mentions as "2.1".
  • Note that the ChunkyPNG driver and shift_distance_limit are removed in 2.1 (deprecated in 2.0), with guidance on moving to VIPS and alternative config options.
  • Leave historical v2.0.0.beta3 text untouched while explicitly covering its promises via the new corrective bullets.
CHANGELOG.md
Retarget Rake gates and test descriptions from a 3.0 split to a 2.1 legacy-removal split, keeping the gate semantics but aligning terminology.
  • Rename the top-level Rake comments from "THE 3.0 SPLIT/GATE" to "LEGACY-REMOVAL"/"2.1 GATE" while preserving which tests are canonical vs legacy.
  • Update the Rake task description for test:canonical to say it guards the 2.1 deletion of the v1 surface instead of 3.0.
  • Adjust comments to say test/legacy is deleted in 2.1 with the v1 trees and that canonical tests define what survives the legacy removal.
Rakefile
Rename the deletion gate test and its internals from a 3.0-specific narrative to a general legacy-deletion narrative, keyed to 2.1.
  • Rename test/unit/deletion_3_0_test.rb to test/unit/legacy_deletion_test.rb and update references in the canonical-suite gate.
  • Rename Deletion30Test to LegacyDeletionTest and update test descriptions to talk about "legacy deletion" instead of "3.0 deletion".
  • Reword comments, the DELETED set explanation, and edit assertions to reference 2.1 and the legacy removal, not an abstract 3.0 release.
test/unit/legacy_deletion_test.rb
test/unit/canonical_suite_has_no_legacy_refs_test.rb
Generalize and future-proof core/legacy separation tests and comments so they describe a legacy-tree deletion rather than a hard-coded 3.0 release, while still naming the deletion set explicitly as 2.1.
  • Replace DELETED_IN_3_0 with DELETED_WITH_LEGACY_TREES in the core-tree gate and update its narrative to talk about the legacy deletion set instead of 3.0.
  • Update comments in core_tree_has_no_legacy_deps_test.rb and legacy_tree_is_alias_only_test.rb to describe the mechanical guarantees in terms of "legacy removal" and the 2.1 git rm rather than "3.0".
  • Adjust various unit test comments (drivers, errors, image_compare, config, snap_diff, support_load_probe) to refer to the legacy trees being removed in 2.1, or generically "when the legacy trees are removed", instead of a specific 3.0 release.
test/unit/core_tree_has_no_legacy_deps_test.rb
test/legacy/legacy_tree_is_alias_only_test.rb
test/unit/drivers_test.rb
test/unit/errors_test.rb
test/unit/image_compare_test.rb
test/unit/config_default_timing_test.rb
test/unit/snap_diff_config_test.rb
test/unit/snap_diff_test.rb
test/unit/support_load_probe_test.rb
Align legacy test suite comments and expectations with the 2.1 deletion, ensuring all references to the removal event are consistent and do not promise a 3.0.
  • Update comments across test/legacy/* to say the files and v1 surface are deleted in 2.1 along with lib/capybara*, legacy_shims.rb, and deprecation.rb, instead of referencing 3.0.
  • Adjust narrative in legacy tests about alias-only trees, umbrella loading, namespace forwarding, and SnapDiff.start to talk about the 2.1 deletion and its gates.
  • Keep actual test behavior the same while ensuring deprecation and deletion timing is described accurately.
test/legacy/errors_alias_test.rb
test/legacy/legacy_config_accessors_test.rb
test/legacy/legacy_config_default_timing_test.rb
test/legacy/legacy_entry_point_probe_test.rb
test/legacy/legacy_forwarders_test.rb
test/legacy/legacy_namespace_deprecation_test.rb
test/legacy/legacy_tree_is_alias_only_test.rb
test/legacy/namespace_forwarding_test.rb
test/legacy/snap_diff_deprecation_test.rb
Tighten test-support comments to avoid referencing a removed 3.0 release while preserving their role in guarding against legacy namespace leakage.
  • Update DriverCoverage and DSLStub helper comments to say they must not reopen the v1 namespace that the legacy deletion removes, instead of naming 3.0 explicitly.
  • Clarify that these scaffolding modules are top-level and should not be tied to the legacy trees that will be deleted.
test/support/driver_coverage.rb
test/support/dsl_stub.rb
Update core library comments to describe legacy-removal readiness rather than 3.0 readiness, keeping the technical guarantees intact while aligning with 2.1.
  • Change config, drivers, and dsl comments from "3.0 readiness" to "legacy-removal readiness" while retaining the explanation of why core code cannot depend on v1 trees.
  • Update snap_diff.rb to describe the canonical entry point as what survives the removal of the legacy trees, and note that the legacy_shims require line is the only one that goes away with the legacy trees.
  • Clarify that legacy_shims.rb plus the v1 trees are exactly what 2.1 deletes, matching the tests and Rakefile gate.
lib/snap_diff.rb
lib/snap_diff/config.rb
lib/snap_diff/drivers.rb
lib/snap_diff/dsl.rb
lib/snap_diff/legacy_shims.rb
lib/capybara/screenshot/diff/config_legacy.rb

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions

Copy link
Copy Markdown

Screenshot diffs detected

Artifact Link
HTML report (inline) N/A
Full report with images N/A
All artifacts Browse all

@pftg

pftg commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #247. This branch could not be rebased cleanly — #246 landed 2.1 language in docs/drivers.md and docs/configuration.md in the meantime, so the sweep conflicted with work that overtook it. Both substantive ideas are carried over in #247: the notice test now asserts the whole clause rather than the version alone, and DELETED_IN_3_0 became DELETED_WITH_LEGACY_TREES.

@pftg pftg closed this Aug 23, 2026
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