Closed github-actions[bot] closed 1 month ago
Workflow name: flow-feature-development Workflow run URL: https://github.com/xn-intenton-z2a/repository0/actions/runs/15259178348 Workflow event: schedule Workflow inputs: null HEAD of main URL: https://github.com/xn-intenton-z2a/repository0/commit/c2fc4430c2702c551ac9fbaabca85322198a2e55
Workflow name: flow-feature-development Workflow run URL: https://github.com/xn-intenton-z2a/repository0/actions/runs/15259178348 Workflow event: schedule Workflow inputs: null HEAD of main URL: https://github.com/xn-intenton-z2a/repository0/commit/aaa4174cdc862d1598eac7f475a6324abc2a1eae
Workflow name: flow-feature-development Workflow run URL: https://github.com/xn-intenton-z2a/repository0/actions/runs/15259178348 Workflow event: schedule Workflow inputs: null HEAD of main URL: https://github.com/xn-intenton-z2a/repository0/commit/aaa4174cdc862d1598eac7f475a6324abc2a1eae
Add batch ingest (--ingest-all) support with tests and docs updates
Workflow name: transformation-05-issue-to-ready-issue Workflow run URL: https://github.com/xn-intenton-z2a/repository0/actions/runs/15259412003 Workflow event: schedule Workflow inputs: null HEAD of main URL: https://github.com/xn-intenton-z2a/repository0/commit/6ba6df20f15fe715ab1a5764c93c3850689843e5
This feature has already been implemented, tested, and documented; all tests pass and the CLI supports the --ingest-all flag.
Summary
To further our mission of building a knowledge graph by crawling public data sources, introduce a new CLI flag
--ingest-all <url>
to fetch a JSON array of records, normalize each one, and append them all tograph.json
in a single batch. This enables bulk ingestion from any public API endpoint that returns an array of items.Changes Required
src/lib/main.js
main
function, before or after the existing--ingest
block, add handling for:appendRecord
insrc/lib/graph.js
to accept either a single record or an array of records (batch) and save accordingly.--help
,--version
,--mission
,--ingest
) and default behavior remain unchanged.tests/unit/main.test.js
describe("Batch Ingest Command", ...)
suite with tests that:fetch
to return an array of raw objects (e.g.,[{ id: 1, foo: "a" }, { id: 2, foo: "b" }]
).appendRecord
(or a newappendRecords
) to capture the passed array.console.log
and mockprocess.exit
to throw.await main(["--ingest-all", "https://example.com/data"]);
and assert:appendRecord
was called with the full normalized array.console.log
was called withIngested 2 records from https://example.com/data
.process.exit(0)
was invoked.fetchData
returns non-array (e.g., an object): expect exit code 1 and error message.docs/USAGE.md and README.md
Verification
npm test
to ensure all existing tests and the new batch ingest tests pass.graph.json
contains all fetched records.0
.No other files should be created or deleted. Update only src/lib/main.js, src/lib/graph.js, tests/unit/main.test.js, docs/USAGE.md, and **README.md.