Skip to content

fix(cli): features --source accepts every GIFT_SOURCES preset - #354

Merged
shivamlalakiya merged 3 commits into
PhilanthroPy-Project:mainfrom
ShahadatTest:fix/cli-gift-sources
Nov 4, 2026
Merged

shivamlalakiya merged 3 commits into
PhilanthroPy-Project:mainfrom
ShahadatTest:fix/cli-gift-sources

Conversation

@ShahadatTest

@ShahadatTest ShahadatTest commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Allow philanthropy features --source to accept every GIFT_SOURCES preset through read_gifts, while retaining the existing source restrictions for train/check. Merge current main (b63242a), add the required Unreleased Fixed changelog entry and contributor credit and import GIFT_SOURCES lazily inside _build_parser as suggested in review.

Follow-up validation on Linux: all 49 CLI tests pass; all 3,097 project tests collect; full Flake8 over philanthropy/tests/examples and git diff --check pass. The project credit guard also passes, and all feature-related CLI tests pass again after the final update. The full project suite was not rerun for this follow-up; the original and current hosted checks are reported separately. Five existing low-confidence-data warnings occurred in CLI tests.

Closes #338.

AI assistance: the original PR was submitted with AI assistance. This review follow-up was inspected and validated with OpenAI Codex at the account owner's request. No independent human review is claimed.

Wire features choices and _cmd_features through ingest.read_gifts /
GIFT_SOURCES so bloomerang, donorperfect, and blackbaud_crm work like
the library API. Leave train/check on the four _FEATURE_SOURCES until
PhilanthroPy-Project#337. Test that argparse accepts every GIFT_SOURCES name.

Fixes PhilanthroPy-Project#338
@shivamlalakiya

Copy link
Copy Markdown
Contributor

Thanks for picking this up, and for claiming it on #338 first. The change is right: features goes through read_gifts, --source uses GIFT_SOURCES, and keeping check / train on the four sources was the right call. Two things before it can merge:

  1. CHANGELOG entry. The "Changelog and contributor credit" check is failing because the PR doesn't touch CHANGELOG.md. Add one bullet at the end of the ### Fixed list under ## [Unreleased], for example: "philanthropy features --source accepts every GIFT_SOURCES preset (adds bloomerang, donorperfect and blackbaud_crm); the four-source if/elif is replaced by read_gifts (closes bug: CLI --source accepts only 4 of the 7 read_gifts presets #338)." Adding yourself to CONTRIBUTORS.md is optional.
  2. Update the branch. It's behind main (fix(cli): drop non-gift rows from the raw gift log used by check and leadership #353 just landed in cli.py and CHANGELOG.md). Merging or rebasing main in should go cleanly.

One small optional change: the module-level from .ingest import GIFT_SOURCES makes every CLI start import the whole ingest package. The rest of cli.py imports ingest lazily inside functions, so importing GIFT_SOURCES inside _build_parser would keep that pattern. Not a blocker.

Once CI is green, this is ready to merge.

@shivamlalakiya

Copy link
Copy Markdown
Contributor

Thanks for the follow-up, this is good to go: features now reads through read_gifts, the choices follow GIFT_SOURCES, and the new test keeps them in step. Merging.

@shivamlalakiya
shivamlalakiya merged commit 5f74baf into PhilanthroPy-Project:main Nov 4, 2026
14 checks passed
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.

bug: CLI --source accepts only 4 of the 7 read_gifts presets

2 participants