Skip to content

Accept every read_gifts source in check and train --task leadership (supersedes #359) - #372

Merged
shivamlalakiya merged 2 commits into
mainfrom
feat/cli-all-gift-sources-v2
Nov 5, 2026
Merged

shivamlalakiya merged 2 commits into
mainfrom
feat/cli-all-gift-sources-v2

Conversation

@shivamlalakiya

Copy link
Copy Markdown
Contributor

Supersedes #359 by @Sudhakar7J, carrying their registry and row-filter helpers with the open review points applied. Their commits are squashed in with a Co-authored-by trailer, and their CHANGELOG and CONTRIBUTORS entries are kept.

philanthropy check and philanthropy train --task leadership read a raw gift export through _read_raw_gifts, which only knew four sources and quietly read anything else as CiviCRM. This change:

  • Adds a _raw_gift_readers() registry covering every GIFT_SOURCES name, so an unknown source now stops with "Unknown gift source" instead. A test fails if a new source is added to GIFT_SOURCES without a reader.
  • Extracts _bloomerang_received_rows, _donorperfect_received_rows, _blackbaud_crm_received_rows, _little_green_light_received_rows and _ellucian_advance_received_rows, the same split the Raiser's Edge, NPSP and Nonprofit Cloud helpers already use. Each *_to_features calls its helper, so the CLI and features count the same rows. The missing-type-column warnings live only in the helpers, with stacklevel=3, so they point at the caller.
  • Adds a pledge-vs-gift case per new source to _RAW_GIFT_EXPORTS, so test_raw_gift_log_drops_the_rows_features_drops covers all nine.

Changes from #359's last push:

  • The Ellucian helper defaults exclude_transaction_types to DEFAULT_EXCLUDED_ADVANCE_TRANSACTION_TYPES and passes None through, so exclude_transaction_types=None disables filtering again (it was being reset to the default, which failed three existing tests).
  • Removed the undefined Union / Optional annotations in _ellucian_advance.py (flake8 F821) in favour of the module's own X | None style.
  • Dropped the formatting-only reflows in cli.py, tests/test_cli.py and the Little Green Light alias table.
  • Added an ellucian_advance case to _RAW_GIFT_EXPORTS.

make ci and make riskcov pass locally.

Closes #341.

shivamlalakiya and others added 2 commits November 5, 2026 13:32
check and train --task leadership read raw gift exports through a
_raw_gift_readers() registry covering every GIFT_SOURCES entry, so an
export from a newly added source can no longer be read as CiviCRM by
accident. Bloomerang, DonorPerfect, Blackbaud CRM, Little Green Light and
Ellucian CRM Advance each get a _<source>_received_rows helper that their
*_to_features aggregator also calls, so the CLI and features count the
same rows. Supersedes #359 with the review points applied.

Co-authored-by: Sudhakar7J <[email protected]>
The source choices were still the four-name _FEATURE_SOURCES tuple, so
argparse rejected the new sources before _read_raw_gifts saw them.
@shivamlalakiya
shivamlalakiya merged commit 3496222 into main Nov 5, 2026
14 checks passed
@shivamlalakiya
shivamlalakiya deleted the feat/cli-all-gift-sources-v2 branch November 6, 2026 17:38
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.

feat(cli): check and train --task leadership accept every read_gifts source

1 participant