Skip to content

Decide the fate of the Mongoid and DataMapper specs (never executed in CI) #185

Open

Description

@eitoball

Summary

Discovered while implementing #182: spec/comma/rails/mongoid_spec.rb and spec/comma/rails/data_mapper_collection_spec.rb never actually run, in any CI configuration this repo has today.

Problem

Both spec files are guarded by if defined? Mongoid / if defined? DataMapper. No Gemfile, gemfiles/*.gemfile, or Appraisals entry in this repo installs the mongoid or data_mapper gem — Appraisals only defines rails*/active* (ActiveRecord) appraisals. spec/spec_helper.rb's ORM loader (%w[data_mapper mongoid active_record].each { ... require ... break }) will therefore never require either gem successfully, so both spec files' describe bodies are dead code, and so are the corresponding new spec/support/models/mongoid_models.rb / data_mapper_models.rb files added in #182 (each wrapped in the same always-false if defined?(...) guard).

Separately: lib/comma/mongoid.rb and lib/comma/data_mapper_collection.rb are shipped library code (not just specs) implementing support for these two ORMs, which is consequently untested by CI despite being part of the public gem surface.

This isn't a regression from #182 — the condition predates it — but it means the "spec suite" for two of the library's supported integrations provides no actual regression protection today.

Proposed approach (needs a decision, not just an implementation)

One of:

  1. Add real Appraisal/gemfile entries for mongoid and data_mapper so these specs and the corresponding lib/ code actually run in CI again.
  2. Drop Mongoid/DataMapper support (specs + lib/comma/mongoid.rb + lib/comma/data_mapper_collection.rb + gemspec references, if any) if these integrations are no longer meant to be supported, with a note in the changelog.
  3. Leave as documentation-only, but make the dead-code status explicit (e.g. a comment at the top of each spec file and support model, or a README/CONTRIBUTING note) so it doesn't look like accidental oversight to future contributors.

This needs a decision on intent (still-supported ORM vs. legacy vs. abandoned) before any code changes — that's a decision for the maintainer, not something to infer from the code.

Acceptance criteria

  • A decision recorded on which of the above (or another option) to pursue
  • If option 1: CI runs mongoid/data_mapper specs and they pass
  • If option 2: dead code and its references (gemspec, lib, spec, spec/support/models) are removed together, not partially
  • If option 3: dead-code status is documented in the affected files

Depends on

#182 (where this was discovered)

Out of scope

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions