Skip to content

refactor(apply): move document model to internal/asset - #255

Open
mmanciop wants to merge 1 commit into
feat/sync-actionfrom
refactor/shared-document-model
Open

refactor(apply): move document model to internal/asset#255
mmanciop wants to merge 1 commit into
feat/sync-actionfrom
refactor/shared-document-model

Conversation

@mmanciop

Copy link
Copy Markdown
Member

Summary

  • Extracts assetDocument and its reading/parsing helpers (readMultiDocumentYAML, parseMultiDocumentYAML, readDirectory, discoverFiles, parseDocumentHeader, formatNameAndId, pluralize) out of internal/apply into internal/asset as exported Document/ReadMultiDocumentYAML/etc.
  • Pure refactor, no behavior change: apply is updated to use the new exported types/functions, and the corresponding tests moved to internal/asset/document_test.go.
  • Prepares for the upcoming dash0 diff command (stacked on top of this branch), which needs the same document discovery/parsing but must not depend on apply's write-path logic.

Why this is stacked

This PR targets feat/sync-action (not main), since it builds on the apply --since/--force work in #253. The diff command PR will stack on top of this one.

Test plan

  • go build ./...
  • go vet ./...
  • go test ./...
  • go test -tags=integration ./...
  • make lint

Extract assetDocument and its reading/parsing helpers (readMultiDocumentYAML,
parseMultiDocumentYAML, readDirectory, discoverFiles, parseDocumentHeader,
formatNameAndId, pluralize) out of internal/apply into internal/asset as
exported Document/ReadMultiDocumentYAML/etc.

apply is the only current caller, but the upcoming diff command needs the
same document discovery and parsing without apply's write-path baggage, and
project convention already places logic shared across apply and per-asset
commands in internal/asset.
@mmanciop
mmanciop requested a review from a team as a code owner August 17, 2026 14:28
@mmanciop mmanciop mentioned this pull request Aug 17, 2026
9 tasks
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.

1 participant