Skip to content

docs: usage examples and specs for merging several sources into one record - #14

Open
njakobsen wants to merge 3 commits into
masterfrom
docs/usage-examples
Open

njakobsen wants to merge 3 commits into
masterfrom
docs/usage-examples

Conversation

@njakobsen

@njakobsen njakobsen commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

The first of three stacked PRs. This one documents and tests how LaForge is used today, against the current API; the next two build on it.

Changes

  • Usage specs: spec/lib/usage_spec.rb adds one group per common use: an importer recording what it assigns and forging, an editor's override surviving later imports, falling back to the next source, entry priority, a source that stops reporting a record, an orphan sweep, inspecting where values came from, data migrations that delete a source's entries, forging a new record, and data sources. The examples follow a map that places entities from a cadastre, a business directory, a map editor and a geocoder.
  • README fix: the usage section called remove_data_entries(source1), which raises; it now calls it inside forge! with sources:, and notes that a marked entry blanks its attribute rather than falling back, which forms a source can be given in, and that the query scopes also work on data_entries and LaForge::DataEntry.
  • README examples: a new Examples section walks through the same uses as the specs.
  • CI: the test workflow now runs on pull requests into any branch, so the PRs stacked on this one are tested against their own base.

UAT Steps

  1. bundle exec rspec: 106 examples, 0 failures, 2 pending.

Closes

Unreported

🤖 Generated with Claude Code

njakobsen and others added 2 commits October 15, 2026 17:08
Issue: the specs exercised each method on its own, but not the ways an app combines them, such as an importer recording what it assigns and forging, an editor's override surviving later imports, falling back to the next source, a source authoritative for some attributes, an orphan sweep, and data migrations that delete a source's entries.

`spec/lib/usage_spec.rb` adds one group per intention, using a map that places entities from a cadastre, a business directory, a map editor and a geocoder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Issue: the README showed `remove_data_entries(source1)`, which raises because the method takes `attribute_names:` and `sources:` keywords, and it did not say that a marked entry blanks its attribute rather than falling back, which sources can be given as, or that the query scopes also work on `data_entries` and `LaForge::DataEntry`.

The usage section now calls `remove_data_entries` inside `forge!` with `sources:` and covers those points, and a new Examples section walks through importing, editor overrides, falling back to the next source, entry priority, a source that stops reporting a record, inspecting where values came from, and pitfalls, matching `spec/lib/usage_spec.rb`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Root cause: the workflow ran only for pull requests into `master`, so a pull request stacked on another branch got no test run until the one below it merged and it was retargeted.

The `pull_request` trigger no longer filters on the base branch, so every pull request in a stack is tested against its own base.

Co-Authored-By: Claude Opus 5.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.

2 participants