Module: RSpecTracer::Storage::Schema Private
- Defined in:
- lib/rspec_tracer/storage/schema.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Cache schema version and compatibility policy. 1.x shipped caches without any version stamp; 2.0’s first migration is simply to start emitting a version and refuse to load anything else.
Compatibility rule (from ARCHITECTURE.md):
- `CURRENT` is written into every new cache manifest.
- `SUPPORTED` is the set of versions this backend is willing
to load. For 2.0 there is exactly one supported version.
- On mismatch, `load_graph` returns nil after an `info` log
line and the run proceeds cold. No in-place migrators.
Future version bumps (schema_version 3, 4, …) add entries to ‘SUPPORTED` only if the backend can load both shapes. If a change is breaking, `SUPPORTED` resets to `[CURRENT]` and the caller pays one cold run on upgrade - the deal 1.x users already expect for any rspec-tracer version bump.
Constant Summary collapse
- CURRENT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
schema_version 2 was the first versioned schema (1.x was unstamped). 2.0 adds ‘Snapshot.boot_set` - breaking for any reader that assumed the v2 field list - so CURRENT bumps to 3 and SUPPORTED narrows to only the new version. No v2 caches were ever persisted in user land.
3- SUPPORTED =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Internal constant.
[CURRENT].freeze
Class Method Summary collapse
-
.supported?(version) ⇒ Boolean
private
True when the caller can load a cache stamped with ‘version`.
Class Method Details
.supported?(version) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
True when the caller can load a cache stamped with ‘version`. nil (an unstamped 1.x cache) is explicitly unsupported - treating nil as “compatible” would defeat the whole point of the version field. The caller logs and falls back to cold run.
38 39 40 |
# File 'lib/rspec_tracer/storage/schema.rb', line 38 def self.supported?(version) SUPPORTED.include?(version) end |