Skip to content

Add notes import command - #229

Merged
andrew merged 1 commit into
git-pkgs:mainfrom
abhinavgautam01:feature/notes-import-124
Jun 8, 2026
Merged

andrew merged 1 commit into
git-pkgs:mainfrom
abhinavgautam01:feature/notes-import-124

Conversation

@abhinavgautam01

Copy link
Copy Markdown
Contributor

closes #124

Summary

Adds git pkgs notes import <file> for bulk-importing package notes from YAML or JSON policy files...

Changes

  • Add notes import <file> subcommand
  • Support YAML and JSON arrays with purl, namespace, origin, message and metadata
  • Use --namespace and --origin as defaults when entries omit those fields
  • Upsert imported notes by existing purl + namespace
  • Document policy-file imports in docs/notes.md
  • Add integration tests for YAML import, JSON import, and missing purl validation

Testing

  • go test ./cmd -run Notes
  • go test ./cmd -run TestNotesImport -count=1
  • go test ./...
  • go tool golangci-lint run ./...
  • git diff --check

@andrew andrew left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested locally — YAML and JSON import, per-entry namespace overrides, upsert on re-import, and missing-purl/empty-file errors all behave as documented.

@andrew
andrew merged commit faaab47 into git-pkgs:main Jun 8, 2026
4 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.

Notes import from file

2 participants