Skip to content

feat(cli): move raw OASF retrieval to dirctl pull; drop --format=oasf from export#1707

Merged
akijakya merged 2 commits into
mainfrom
feat/pull-batch-export-oasf
Jun 30, 2026
Merged

feat(cli): move raw OASF retrieval to dirctl pull; drop --format=oasf from export#1707
akijakya merged 2 commits into
mainfrom
feat/pull-batch-export-oasf

Conversation

@akijakya

Copy link
Copy Markdown
Member

Closes #1702

@akijakya akijakya self-assigned this Jun 26, 2026
@akijakya
akijakya requested a review from a team as a code owner June 26, 2026 12:13
@github-actions github-actions Bot added the size/M Denotes a PR that changes 200-999 lines label Jun 26, 2026
@akijakya
akijakya force-pushed the feat/pull-batch-export-oasf branch 2 times, most recently from 7ab8a42 to aceb27c Compare June 29, 2026 11:48
…asf` from export

Signed-off-by: András Jáky <ajaky@cisco.com>
@akijakya
akijakya force-pushed the feat/pull-batch-export-oasf branch from aceb27c to c2e52f2 Compare June 29, 2026 11:49
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.50000% with 28 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cli/util/records/records.go 82.7% 9 Missing and 4 partials ⚠️
cli/cmd/pull/batch.go 74.3% 5 Missing and 4 partials ⚠️
cli/cmd/pull/pull.go 81.8% 2 Missing and 2 partials ⚠️
cli/cmd/export/export.go 84.6% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the CLI so that “raw OASF record JSON” retrieval lives under dirctl pull (including batch-to-files behavior), and dirctl export is limited to module-derived formats (rejecting --format=oasf and requiring --format explicitly).

Changes:

  • Extend dirctl pull to default to JSON stdout, add --output-file, and add batch pull via --output-dir with standard search filters.
  • Remove oasf as an export format in dirctl export, adding validation + tests and updating docs accordingly.
  • Introduce shared bulk record helpers in cli/util/records and refactor export batch utilities to reuse them.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/e2e/local/11_pull_test.go Adds E2E coverage for pull’s default JSON output and new file/dir output modes.
tests/e2e/local/10_export_test.go Updates E2E expectations for export requiring --format and rejecting oasf.
docs/content/dir/dir-cli-reference.md Documents pull’s new defaults/flags and export’s removal of oasf.
cli/util/records/records.go Adds shared search→CID→pull helpers plus filename/dedup utilities for batch operations.
cli/util/records/records_test.go Unit tests for sanitize/dedup/filename helper behavior.
cli/presenter/output.go Adds AddOutputFlagsWithDefault to allow per-command output defaults.
cli/presenter/output_test.go Tests the new output-default helper behavior.
cli/cmd/pull/pull.go Adds batch-mode branching and --output-file behavior; defaults pull output to JSON.
cli/cmd/pull/options.go Adds pull flags for output destinations and standard search filters.
cli/cmd/pull/batch.go Implements batch pull to directory with validation and per-record JSON writing.
cli/cmd/pull/batch_test.go Unit tests for pull invocation validation logic.
cli/cmd/export/options.go Makes --format required (no default) and updates help text to direct users to pull for raw OASF.
cli/cmd/export/format_test.go Adds unit tests for rejecting empty format and oasf.
cli/cmd/export/export.go Enforces --format required and rejects --format=oasf; refactors batch pull to shared helpers.
cli/cmd/export/batch.go Refactors batch utilities to use cli/util/records helpers.
cli/cmd/export/batch_test.go Removes tests for the inlined batch utilities that were moved to the shared package.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cli/util/records/records.go
Signed-off-by: András Jáky <ajaky@cisco.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 16 out of 16 changed files in this pull request and generated no new comments.

@akijakya
akijakya merged commit 12bdd5e into main Jun 30, 2026
36 checks passed
@akijakya
akijakya deleted the feat/pull-batch-export-oasf branch June 30, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 200-999 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cli): move raw OASF export to dirctl pull (batch + file output); drop --format=oasf from export

3 participants