[HDLS-696] Fail loudly on silent no-ops in sequences add-contacts and bulk-enrich - #52
Draft
alexander-rykhlitskiap wants to merge 1 commit into
Draft
[HDLS-696] Fail loudly on silent no-ops in sequences add-contacts and bulk-enrich#52alexander-rykhlitskiap wants to merge 1 commit into
alexander-rykhlitskiap wants to merge 1 commit into
Conversation
… bulk-enrich Two defects from an external partner report (Creatop, CLI v2.1.0): - sequences add-contacts could exit 0 having enrolled nobody. Ids packed into a single argument are now split before they reach the API, every entry in skipped_contact_ids is reported on stderr, and the command exits non-zero when nothing was enrolled. - people bulk-enrich --file accepted files larger than the server's 10-record cap and only failed after the request. The cap is now validated client-side and stated in --help.
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
Kodem Security Scan Summary
Note: Kai marked all findings as likely false positives. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the two items from the external CLI + MCP defect report that are unambiguously ours to fix in the CLI. Triage of the full 11-item report is in HDLS-696; the rest need API/MCP/docs decisions and are tracked there.
Source: Slack thread in #apollo-headless-feedback (report reproduced live against CLI v2.1.0).
1.
sequences add-contactscould report success while enrolling nobodyThe reporter's launch step returned HTTP 200, exit code 0 with an empty campaign. The response gives it away — one
skipped_contact_idskey containing all five ids space-joined:{"contacts": [], "skipped_contact_ids": {"6a9570afd7400f001011956b 6a9570b3087bc9001871f233 …": "contact_not_found"}}Two independent problems, both fixed:
normalizeIdshelper splits a variadic id option on whitespace and commas, so--contact-id "id1 id2"becomes["id1", "id2"]instead of one id Apollo cannot match. Applied to--contact-idand--from-email-accountonadd-contacts, and--contact-id/--sequence-idonremove-contacts. Label options are left alone — label names legitimately contain spaces.summarizeAddContactsnow reads the response: everyskipped_contact_idsentry is reported on stderr, and the command exits non-zero when nothing was enrolled. An operator running a launch no longer sees exit 0 on an empty campaign.The stdout payload still prints first and unchanged, so
jqpipelines are unaffected.2.
people bulk-enrich --fileaccepted a file it could not send--filetook a JSON array of any length and passed it straight through; the server rejected anything over 10 with400 RECORD_LIMIT_EXCEEDED, and the cap was not in--help. The cap is now checked client-side before the request and stated in the command and option help.I did not auto-chunk, which was the reporter's other suggestion:
/people/bulk_matchreturns counters (total_requested_enrichments,credits_consumed, …) alongsidematches, and merging those across batches invents response semantics the API does not define. Failing early with a clear message is the safe half; auto-chunking is worth a follow-up once merge semantics are agreed. Their own 10-per-call script loop worked fine over 1,000 records.Also folded the duplicated file-reading block in
bulk-enrichinto the existingreadJsonArrayFilehelper.Tests
Unit tests added for
normalizeIds(src/utils.test.ts, new) andsummarizeAddContacts(src/commands/sequences.test.ts), following the existing pure-builder-plus-vitest pattern.npm testornpm run typecheck— this was written in a fresh worktree with nonode_modules, and the install wasn't available to me. Please run both before approving.